/*
Theme Name: Saigon Pickler Child
Description: A mobile-first magazine for pickleball, city life and travel.
Template: twentytwentyfive
Version: 1.0.5
Requires at least: 6.7
Requires PHP: 7.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: saigon-pickler-child
*/

/* Source Sans 3, licensed under the SIL Open Font License. */
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('assets/fonts/source-sans-3-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('assets/fonts/source-sans-3-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('assets/fonts/source-sans-3-vietnamese-wght-normal.woff2') format('woff2');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}

.sp-header {
  border-bottom: 1px solid var(--wp--preset--color--sp-line);
  background: var(--wp--preset--color--base);
}

.sp-header .sp-header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem 1rem;
  padding-block: 0.8rem;
}

.sp-header .wp-block-site-title {
  margin: 0;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.sp-header .wp-block-navigation {
  justify-self: end;
  min-width: 0;
  font-size: 1rem;
  font-weight: 600;
}

.sp-header .wp-block-site-title a,
.sp-header .wp-block-navigation a,
.sp-footer .wp-block-site-title a,
.sp-card .wp-block-post-title a {
  color: var(--wp--preset--color--contrast);
  text-decoration: none;
}

.sp-header .wp-block-site-title a:hover,
.sp-header .wp-block-navigation a:hover,
.sp-header .wp-block-navigation [aria-current='page'],
.sp-card .wp-block-post-title a:hover {
  color: var(--wp--preset--color--sp-green);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.sp-header .wp-block-navigation__responsive-container-open,
.sp-header .wp-block-navigation__responsive-container-close {
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.sp-header .is-menu-open .wp-block-navigation-item__content {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.sp-header .wp-block-search {
  grid-column: 1 / -1;
  margin: 0;
}

.sp-header .wp-block-search__input {
  min-width: 0;
  min-height: 44px;
  border: 1px solid #78887d;
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  background: #fff;
  color: var(--wp--preset--color--contrast);
  font-size: 1rem;
}

.sp-header .wp-block-search__button {
  min-width: 44px;
  min-height: 44px;
  margin-inline-start: 0.4rem;
  padding: 0.35rem;
  border-radius: 8px;
}

@media (min-width: 600px) and (max-width: 899px) {
  .sp-header .wp-block-navigation {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: start;
  }

  .sp-header .wp-block-search { grid-column: 2; grid-row: 1; }
}

@media (min-width: 900px) {
  .sp-header .sp-header-inner { grid-template-columns: auto minmax(0, 1fr) 12.5rem; }
  .sp-header .wp-block-search { grid-column: auto; }
}

/* 2026-11-17: 사이트 제목이 좁은 화면에서 1글자씩 세로로 꺾이던 문제 수정 */
/* 제목은 어떤 폭에서도 한 줄로 고정한다(테마의 overflow-wrap:anywhere를 덮어씀). */
.sp-header .wp-block-site-title {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  min-width: max-content;
}

.sp-header .wp-block-site-title a {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

/* 태블릿(600~899px): 제목 칸이 줄어들고 검색창은 고정 폭을 넘지 않게 */
@media (min-width: 600px) and (max-width: 899px) {
  .sp-header .sp-header-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 18rem); }
  .sp-header .wp-block-search { width: 100%; max-width: 100%; }
}

/* 모바일(599px 이하): 제목 / 메뉴 + 언어 / 검색 3단으로 쌓아 가로 압박을 없앤다. */
@media (max-width: 599px) {
  .sp-header .sp-header-inner {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0.55rem;
    padding-block: 0.7rem;
  }

  .sp-header .wp-block-site-title {
    grid-column: 1 / -1;
    grid-row: auto;
    font-size: 1.3rem;
  }

  .sp-header .sp-nav-wrap {
    grid-column: 1 / -1;
    grid-row: auto;
    justify-self: stretch;
    justify-content: space-between;
    gap: 0.3rem 0.9rem;
    max-width: 100%;
    box-sizing: border-box;
  }

  .sp-header .sp-nav-wrap .sp-lang { margin-inline-start: auto; }
  .sp-header .sp-nav ul.sp-nav-list { gap: 0.25rem 0.9rem; font-size: 0.95rem; }
  .sp-header .sp-lang .sp-lang-items { font-size: 0.78rem; }

  .sp-header .wp-block-search {
    grid-column: 1 / -1;
    grid-row: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .sp-header .wp-block-search__inside-wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

.sp-main {
  padding-block: clamp(2rem, 5vw, 4.5rem) clamp(3.5rem, 7vw, 6rem);
}

.sp-home { padding-top: clamp(1.4rem, 3.5vw, 3rem); }

.sp-main .sp-intro {
  padding-bottom: clamp(1.4rem, 3.4vw, 2.75rem);
  margin-bottom: clamp(1.4rem, 3.4vw, 2.75rem);
  border-bottom: 1px solid var(--wp--preset--color--sp-line);
}

.sp-intro h1, .sp-article .wp-block-post-title { letter-spacing: -0.035em; }
.sp-intro p { max-width: 56ch; margin-top: 0.55rem; color: var(--wp--preset--color--sp-muted); }
.sp-home .sp-section-title { margin-bottom: 1rem; }
.sp-main .wp-block-query-title, .sp-card a, .sp-article { overflow-wrap: anywhere; }

.sp-query .sp-posts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: clamp(1.5rem, 4vw, 2.75rem) clamp(1rem, 2.6vw, 2rem);
  padding: 0;
}

.sp-query .sp-posts > .wp-block-post { min-width: 0; margin: 0; }
.sp-card { border-bottom: 1px solid var(--wp--preset--color--sp-line); padding-bottom: 1.15rem; }
.sp-card .wp-block-post-featured-image { margin: 0; }

.sp-card .wp-block-post-featured-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
}

.sp-card .sp-card-body { margin-top: 0; }
.sp-card .wp-block-post-featured-image + .sp-card-body { margin-top: 0.75rem; }

.sp-card .wp-block-post-title {
  margin-block: 0.25rem 0;
  font-size: clamp(1.35rem, 2.6vw, 1.6rem);
  letter-spacing: -0.018em;
}

.sp-card .wp-block-post-date, .sp-article .wp-block-post-date {
  margin-top: 0.3rem;
  color: var(--wp--preset--color--sp-muted);
  font-size: 0.95rem;
}

.sp-card .wp-block-post-terms, .sp-article .wp-block-post-terms {
  font-size: 0.95rem;
  font-weight: 600;
}

.sp-card .wp-block-post-terms a { text-underline-offset: 0.14em; }
.sp-query .wp-block-query-pagination { margin-top: 2rem; row-gap: 0.4rem; }
.sp-query .wp-block-query-pagination a { display: inline-block; padding-block: 0.5rem; }
.sp-query .wp-block-query-pagination-numbers .page-numbers { padding-inline: 0.45rem; }
.sp-query .wp-block-query-pagination-numbers .current { font-weight: 700; }

@media (min-width: 640px) {
  .sp-query .sp-posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .sp-query .sp-posts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* The first post shares the main query and appears only once in the list. */
:where(body.home:not(.paged), .editor-styles-wrapper) .sp-home .sp-posts > li:first-child {
  grid-column: 1 / -1;
}

:where(body.home:not(.paged), .editor-styles-wrapper) .sp-home .sp-posts > li:first-child .sp-card {
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--wp--preset--color--sp-surface);
}

:where(body.home:not(.paged), .editor-styles-wrapper) .sp-home .sp-posts > li:first-child .sp-card-body {
  margin: 0;
  padding: clamp(1.125rem, 4vw, 2.75rem);
}

:where(body.home:not(.paged), .editor-styles-wrapper) .sp-home .sp-posts > li:first-child .wp-block-post-title {
  font-size: clamp(1.6rem, 3.4vw, 2.65rem);
}

@media (min-width: 800px) {
  :where(body.home:not(.paged), .editor-styles-wrapper) .sp-home .sp-posts > li:first-child .sp-card:has(> .wp-block-post-featured-image) {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: center;
  }
}

.sp-article .wp-block-post-featured-image img { display: block; height: auto; border-radius: 8px; }
.sp-article .wp-block-post-content { font-size: clamp(1.0625rem, 1.7vw, 1.1875rem); line-height: 1.72; }
.sp-article .wp-block-post-content a { text-underline-offset: 0.17em; }
.sp-footer { border-top: 1px solid var(--wp--preset--color--sp-line); padding-block: 1.4rem; }
.sp-footer .wp-block-site-title { font-size: 1.15rem; font-weight: 700; }

:where(.sp-header, .sp-main, .sp-footer) :where(a, button, input, textarea, select):focus-visible {
  outline: 2px solid var(--wp--preset--color--sp-green);
  outline-offset: 3px;
}

/*
2026-11-18 (ver 1.0.2) — 한국어 어절 중간 줄바꿈 수정
테마 기본값(word-break: normal)에서는 한글이 음절 단위로 줄바꿈되고,
일부 블록의 overflow-wrap: anywhere가 이를 더 밀어붙여 '시작하/기',
'게/임', '2/군'처럼 어절 중간에서 끊겼다. 한국어 문서에서만 keep-all로
어절 단위 줄바꿈을 강제하고, 한 어절이 줄 폭을 넘을 때만 break-word로 끊는다.
*/
html[lang^="ko"] body,
html[lang^="ko"] h1,
html[lang^="ko"] h2,
html[lang^="ko"] h3,
html[lang^="ko"] h4,
html[lang^="ko"] h5,
html[lang^="ko"] h6,
html[lang^="ko"] p,
html[lang^="ko"] li,
html[lang^="ko"] dt,
html[lang^="ko"] dd,
html[lang^="ko"] a,
html[lang^="ko"] span,
html[lang^="ko"] strong,
html[lang^="ko"] em,
html[lang^="ko"] small,
html[lang^="ko"] figcaption,
html[lang^="ko"] blockquote,
html[lang^="ko"] td,
html[lang^="ko"] th,
html[lang^="ko"] caption,
html[lang^="ko"] label,
html[lang^="ko"] button,
html[lang^="ko"] summary,
html[lang^="ko"] cite,
html[lang^="ko"] q,
html[lang^="ko"] time,
html[lang^="ko"] .wp-block-post-title,
html[lang^="ko"] .wp-block-post-excerpt,
html[lang^="ko"] .wp-block-post-excerpt__excerpt,
html[lang^="ko"] .wp-block-heading,
html[lang^="ko"] .wp-block-button__link,
html[lang^="ko"] .wp-element-button,
html[lang^="ko"] .wp-block-post-terms,
html[lang^="ko"] .wp-block-query-title {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* 테마·자식 테마가 직접 overflow-wrap: anywhere를 걸어 둔 컨테이너도 덮는다. */
html[lang^="ko"] .sp-main .wp-block-query-title,
html[lang^="ko"] .sp-card,
html[lang^="ko"] .sp-card a,
html[lang^="ko"] .sp-card .sp-card-body,
html[lang^="ko"] .sp-card .wp-block-post-title,
html[lang^="ko"] .sp-article,
html[lang^="ko"] .sp-article .wp-block-post-content,
html[lang^="ko"] .sp-intro,
html[lang^="ko"] .sp-intro p,
html[lang^="ko"] .sp-footer {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/*
2026-11-18 (ver 1.0.3) — 다열 표 모바일 가로 스크롤
코어 블록 CSS가 .wp-block-table에 overflow-x:auto를 걸어 두었지만 표에 min-width가
없어, 좁은 화면에서는 표가 폭 100%로 눌리며 열 안에서 단어·금액이 중간에서 끊겼다
(예: "65,000 / 95,000 VND" → "65, / 000", "95, / 000 VN / D").
3열 이상 표에만 최소 폭을 주어 표 내부에서만 가로 스크롤되게 하고(2열 표는 그대로),
셀 안의 단어는 중간에서 끊지 않는다(줄바꿈은 공백에서만).
*/
/*
2026-11-18 (ver 1.0.4) — PC(데스크톱)에서 표가 본문 폭을 넘던 문제
1.0.3의 `max-width: 100%`는 특이도(0,2,0)가 코어의 제약 레이아웃 규칙
`.is-layout-constrained > :where(...)`(0,1,0)보다 높아, 본문 문단·사진에
적용되던 720px 제한을 덮어썼다. 그 결과 표가 alignfull인 본문 컨테이너
전체 폭(1440px 화면에서 1,344px)으로 늘어나 문단·사진보다 좌우로 튀어나왔다.
표 폭을 본문과 같은 --wp--style--global--content-size로 되돌리고 가운데
정렬한다. 모바일 가로 스크롤(1.0.3)과 한국어 keep-all(1.0.2)은 그대로 둔다.
*/
.wp-block-post-content .wp-block-table,
.sp-article .wp-block-table {
  max-width: min(100%, var(--wp--style--global--content-size, 720px));
  margin-inline: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

/* alignwide가 붙은 표도 본문 문단과 같은 폭에 맞춘다. */
.wp-block-post-content .wp-block-table.alignwide,
.sp-article .wp-block-table.alignwide {
  margin-inline: auto;
  max-width: min(100%, var(--wp--style--global--content-size, 720px));
}

@media (max-width: 700px) {
  /* 3열 이상 표: 최소 폭을 확보해 열이 눌리지 않게 한다. 2열 표는 영향 없음. */
  .wp-block-post-content .wp-block-table:has(tbody tr > :nth-child(3)) table,
  .wp-block-post-content .wp-block-table:has(thead tr > :nth-child(3)) table,
  .sp-article .wp-block-table:has(tbody tr > :nth-child(3)) table,
  .sp-article .wp-block-table:has(thead tr > :nth-child(3)) table {
    min-width: 640px;
  }

  /* 표 셀 안의 단어·금액을 중간에서 끊지 않는다(영어·베트남어 문서). */
  html[lang="en-US"] .wp-block-post-content .wp-block-table th,
  html[lang="en-US"] .wp-block-post-content .wp-block-table td,
  html[lang="vi"] .wp-block-post-content .wp-block-table th,
  html[lang="vi"] .wp-block-post-content .wp-block-table td,
  html[lang="en-US"] .sp-article .wp-block-table th,
  html[lang="en-US"] .sp-article .wp-block-table td,
  html[lang="vi"] .sp-article .wp-block-table th,
  html[lang="vi"] .sp-article .wp-block-table td {
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
  }
}

/*
2026-11-19 (ver 1.0.5) — 홈 배너(히어로) 서브타이틀 한 줄 + 두 버튼 크기 정리
민호 님 요청: 메인 배너 서브타이틀이 불필요하게 2줄로 꺾이지 않게 한 줄로,
아래 버튼 두 개는 텍스트 크기에 맞는 깔끔한 크기로.
*/

/* 1) 서브타이틀 ----------------------------------------------------------
   기존 `.sp-intro p { max-width: 56ch }`(1440에서 504px) 때문에 18px 본문에서
   한 줄 폭(EN 713 / VI 742 / KO 660px)이 잘려 항상 2줄이었다.
   데스크톱에서는 폭 제한을 풀어 한 줄로 두고, 좁은 화면에서는 제한을 그대로
   두어 자연스럽게 줄바꿈되게 한다(넘침 없음). */
@media (min-width: 900px) {
  .sp-intro p { max-width: none; }
}

/* 2) 버튼 두 개 ---------------------------------------------------------
   코어/테마가 준 배너 버튼 패딩(16px 36px)이 18px 글자에 비해 지나치게 커서
   버튼이 텍스트보다 훨씬 넓고 높았다. 글자 크기에 비례하는 패딩으로 줄이고,
   라벨 폭에 맞춘 크기(fit-content)로 두며, 두 버튼 높이를 같게 맞춘다. */
.sp-intro .wp-block-buttons {
  gap: 0.75rem;
  align-items: center;
}

.sp-intro .wp-block-button {
  flex: 0 0 auto;
  max-width: 100%;
}

.sp-intro .wp-block-buttons .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: 100%;
  min-height: 2.75rem;          /* 터치 목표 44px은 유지 */
  padding: 0.5em 1.25em;
  border: 1px solid transparent; /* 아웃라인 버튼과 높이를 맞춘다 */
  border-radius: 8px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

/* 아웃라인 버튼의 테두리 색은 그대로 살린다. */
.sp-intro .wp-block-buttons .wp-block-button.is-style-outline .wp-block-button__link {
  border-color: currentColor;
}
