/*
Theme Name: 요리살림백과
Theme URI: https://yorisalimbaekgwa.com/
Author: 요리살림백과
Description: 요리·식재료·주방·청소·세탁·정리 정보를 고급 매거진 스타일로 전달하는 한국어 블록 테마입니다.
Version: 1.1.0
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: yorisalimbaekgwa
*/

:root {
  --ysb-ink: #20231e;
  --ysb-forest: #234b3a;
  --ysb-forest-dark: #173529;
  --ysb-copper: #a75e40;
  --ysb-bone: #f5f2ea;
  --ysb-paper: #fffefa;
  --ysb-line: rgba(32, 35, 30, 0.12);
  --ysb-radius-sm: 8px;
  --ysb-radius-md: 16px;
  --ysb-radius-lg: 28px;
  --ysb-shadow-sm: 0 10px 30px rgba(29, 39, 31, 0.06);
  --ysb-shadow: 0 24px 70px rgba(29, 39, 31, 0.11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: radial-gradient(circle at 8% 0%, rgba(167, 94, 64, 0.045), transparent 24rem), var(--ysb-bone);
}

a { text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
:where(a, button, input, textarea, select):focus-visible { outline: 3px solid var(--ysb-copper); outline-offset: 3px; }

/* Header */
.ysb-site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-top: 3px solid var(--ysb-forest);
  border-bottom: 1px solid rgba(32, 35, 30, 0.08);
  background: rgba(255, 254, 250, 0.92) !important;
  box-shadow: 0 8px 30px rgba(29, 39, 31, 0.035);
  backdrop-filter: blur(18px);
}

.ysb-brand-lockup { gap: 12px !important; }

.ysb-brand-mark {
  position: relative;
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: var(--ysb-forest);
  box-shadow: inset 0 0 0 4px rgba(255, 254, 250, 0.08), 0 8px 22px rgba(35, 75, 58, 0.2);
}

.ysb-brand-mark::before,
.ysb-brand-mark::after { content: ""; position: absolute; }
.ysb-brand-mark::before { width: 20px; height: 20px; border: 1.5px solid #fffefa; border-radius: 50%; }
.ysb-brand-mark::after { width: 9px; height: 15px; top: 6px; right: 6px; border-radius: 100% 0 100% 0; background: var(--ysb-copper); transform: rotate(18deg); }

.ysb-brand-copy { gap: 0 !important; }
.ysb-brand-copy .wp-block-site-title { line-height: 1.15; }
.ysb-brand-copy .wp-block-site-title a { color: var(--ysb-ink); text-decoration: none; }
.ysb-brand-note { margin-top: 3px !important; color: #77776f; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.12em; line-height: 1; text-transform: uppercase; }

.ysb-main-nav .wp-block-navigation-item__content { padding: 7px 2px; color: var(--ysb-ink); text-decoration: none; }
.ysb-main-nav .wp-block-navigation-item__content:hover { color: var(--ysb-copper); }

.ysb-header-search { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--ysb-line); border-radius: 50%; color: var(--ysb-forest); text-decoration: none; }
.ysb-header-search:hover { border-color: var(--ysb-forest); background: var(--ysb-forest); color: var(--ysb-paper); }
.ysb-search-icon { position: relative; width: 14px; height: 14px; border: 1.6px solid currentColor; border-radius: 50%; }
.ysb-search-icon::after { content: ""; position: absolute; width: 6px; height: 1.6px; right: -5px; bottom: -2px; border-radius: 2px; background: currentColor; transform: rotate(45deg); transform-origin: left center; }

/* Hero */
.ysb-hero {
  position: relative;
  overflow: hidden;
  min-height: 570px;
  border: 1px solid rgba(32, 35, 30, 0.1);
  border-radius: 4px 4px var(--ysb-radius-lg) var(--ysb-radius-lg);
  background: var(--ysb-paper);
  box-shadow: var(--ysb-shadow);
}

.ysb-hero::before { content: ""; position: absolute; width: 360px; height: 360px; left: -220px; bottom: -220px; border: 1px solid rgba(167, 94, 64, 0.2); border-radius: 50%; box-shadow: 0 0 0 46px rgba(167, 94, 64, 0.035), 0 0 0 92px rgba(167, 94, 64, 0.02); pointer-events: none; }
.ysb-hero-copy { position: relative; z-index: 2; }

.ysb-kicker,
.ysb-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--ysb-copper); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.12em; line-height: 1.3; text-transform: uppercase; }
.ysb-kicker::before,
.ysb-eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }

.ysb-hero-title { max-width: 660px; margin-top: 8px !important; font-family: 'Noto Serif KR', 'Nanum Myeongjo', Batang, serif; font-weight: 600 !important; letter-spacing: -0.055em !important; }
.ysb-hero-title em { color: var(--ysb-forest); font-style: normal; }
.ysb-hero-lede { max-width: 590px; color: #666860; line-height: 1.85; }

.ysb-search { max-width: 600px; }
.ysb-search .wp-block-search__inside-wrapper { padding: 5px; border: 1px solid rgba(32, 35, 30, 0.17); border-radius: 3px; background: #fff; box-shadow: var(--ysb-shadow-sm); }
.ysb-search .wp-block-search__input { min-height: 54px; padding-inline: 18px; border: 0; background: transparent; color: var(--ysb-ink); }
.ysb-search .wp-block-search__button { min-height: 54px; padding-inline: 25px; border-radius: 2px; background: var(--ysb-forest); }
.ysb-search-hints { margin-top: 13px !important; color: #85847d; font-size: 0.76rem; }

.ysb-hero-visual { position: relative; min-height: 430px; overflow: hidden; border-radius: 2px 2px 22px 2px; background: linear-gradient(145deg, rgba(255,255,255,0.05), transparent 46%), var(--ysb-forest); box-shadow: 0 28px 50px rgba(35, 75, 58, 0.2); }
.ysb-hero-visual::before { content: ""; position: absolute; width: 245px; height: 245px; right: -82px; top: -74px; border: 1px solid rgba(255, 254, 250, 0.22); border-radius: 50%; box-shadow: inset 0 0 0 34px rgba(255, 254, 250, 0.035), inset 0 0 0 68px rgba(255, 254, 250, 0.025); }
.ysb-hero-visual::after { content: ""; position: absolute; width: 110px; height: 165px; left: 26px; bottom: -50px; border-radius: 55% 45% 8px 8px; background: rgba(167, 94, 64, 0.84); transform: rotate(-14deg); }
.ysb-visual-label { position: absolute; top: 32px; left: 34px; z-index: 2; color: #dfe4dc; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.ysb-visual-card { position: absolute; z-index: 3; width: min(78%, 300px); right: 30px; bottom: 36px; padding: 30px 30px 27px; border: 1px solid rgba(32, 35, 30, 0.08); background: #f7f1e6; box-shadow: 0 24px 54px rgba(10, 24, 17, 0.28); transform: rotate(2deg); }
.ysb-visual-card::before { content: ""; position: absolute; width: 64px; height: 14px; left: 50%; top: -8px; background: rgba(225, 210, 182, 0.9); transform: translateX(-50%) rotate(-2deg); }
.ysb-visual-date { margin: 0 0 12px; color: var(--ysb-copper); font-size: 0.69rem; font-weight: 800; letter-spacing: 0.13em; }
.ysb-visual-title { margin: 0; color: var(--ysb-ink); font-family: 'Noto Serif KR', 'Nanum Myeongjo', Batang, serif; font-size: clamp(1.4rem, 2.3vw, 1.85rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.45; }
.ysb-visual-rule { width: 100%; height: 1px; margin: 20px 0; background: rgba(32, 35, 30, 0.15); }
.ysb-visual-list { display: grid; gap: 8px; margin: 0; padding: 0; color: #666860; font-size: 0.78rem; list-style: none; }
.ysb-visual-list li::before { content: "✓"; margin-right: 8px; color: var(--ysb-forest); font-weight: 800; }

/* Quick links */
.ysb-quick-strip { position: relative; z-index: 3; display: flex; width: min(1240px, calc(100% - 36px)); margin: -28px auto 0 !important; align-items: center; flex-wrap: wrap; border: 1px solid var(--ysb-line); background: rgba(255, 254, 250, 0.98); box-shadow: var(--ysb-shadow-sm); }
.ysb-quick-label { align-self: stretch; padding: 19px 24px; background: var(--ysb-ink); color: var(--ysb-paper); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.ysb-quick-link { position: relative; padding: 17px 24px; color: var(--ysb-ink); font-size: 0.87rem; font-weight: 700; text-decoration: none; }
.ysb-quick-link::after { content: "↗"; margin-left: 8px; color: var(--ysb-copper); }
.ysb-quick-link:hover { color: var(--ysb-copper); }

/* Sections and cards */
.ysb-section-title { max-width: 760px; }
.ysb-section-title h2 { margin-top: 8px !important; font-family: 'Noto Serif KR', 'Nanum Myeongjo', Batang, serif; font-weight: 650; letter-spacing: -0.045em; }
.ysb-section-rule { width: 100%; border-top: 1px solid var(--ysb-line); }

.ysb-category-card,
.ysb-post-card,
.ysb-policy-card { height: 100%; border: 1px solid var(--ysb-line); background: rgba(255, 254, 250, 0.9); transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease; }

.ysb-category-card { position: relative; min-height: 195px; overflow: hidden; border-radius: 2px 2px 14px 2px; }
.ysb-category-card::after { content: ""; position: absolute; width: 70px; height: 70px; right: -36px; bottom: -36px; border: 1px solid rgba(167, 94, 64, 0.18); border-radius: 50%; }
.ysb-category-card:hover,
.ysb-post-card:hover { transform: translateY(-5px); border-color: rgba(35, 75, 58, 0.34); box-shadow: var(--ysb-shadow-sm); }
.ysb-category-card h3 { margin-top: 30px !important; }
.ysb-category-card h3 a { color: var(--ysb-ink); text-decoration: none; }
.ysb-category-card h3 a:hover { color: var(--ysb-copper); }
.ysb-category-number { display: inline-flex; min-width: auto; margin: 0; align-items: center; color: var(--ysb-copper); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.16em; }
.ysb-category-number::after { content: ""; width: 34px; height: 1px; margin-left: 10px; background: rgba(167, 94, 64, 0.55); }

.ysb-editorial-band { position: relative; overflow: hidden; border-radius: 3px 3px 24px 3px; background: var(--ysb-forest); box-shadow: var(--ysb-shadow); }
.ysb-editorial-band::before { content: ""; position: absolute; width: 420px; height: 420px; right: -245px; top: -260px; border: 1px solid rgba(255,255,255,0.14); border-radius: 50%; box-shadow: 0 0 0 48px rgba(255,255,255,0.025), 0 0 0 96px rgba(255,255,255,0.018); }
.ysb-editorial-item { padding-left: 24px; border-left: 1px solid rgba(255, 254, 250, 0.22); }
.ysb-editorial-number { color: #cabfaf; font-family: Georgia, serif; font-size: 0.82rem; font-style: italic; }
.ysb-editorial-item h3 a { color: var(--ysb-paper); text-decoration: none; }
.ysb-editorial-item h3 a:hover { color: #e3c1b1; }

/* Post grid */
.ysb-latest-grid.wp-block-post-template { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ysb-latest-grid > li:first-child { grid-column: span 2; }
.ysb-post-card { overflow: hidden; border-radius: 2px 2px var(--ysb-radius-md) 2px; }
.ysb-post-card .wp-block-post-featured-image { margin: 0; overflow: hidden; background: #e5e0d5; }
.ysb-post-card .wp-block-post-featured-image img { aspect-ratio: 16 / 10; border-radius: 0; transition: transform 500ms ease; }
.ysb-latest-grid > li:first-child .wp-block-post-featured-image img { aspect-ratio: 16 / 7.4; }
.ysb-post-card:hover .wp-block-post-featured-image img { transform: scale(1.025); }
.ysb-post-card-body { padding: 24px 25px 27px; }
.ysb-post-card .wp-block-post-terms { color: var(--ysb-copper); font-size: 0.71rem; font-weight: 800; letter-spacing: 0.07em; }
.ysb-post-card .wp-block-post-title { margin-top: 10px; }
.ysb-post-card .wp-block-post-title a { color: var(--ysb-ink); text-decoration: none; }
.ysb-post-card .wp-block-post-excerpt__more-text { margin-top: 18px; color: var(--ysb-forest); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.03em; }
.ysb-post-card .wp-block-post-excerpt__more-link { text-decoration: none; }
.ysb-empty-state { min-height: 210px; display: grid; place-items: center; border: 1px dashed rgba(35, 75, 58, 0.3); background: rgba(255, 254, 250, 0.7); text-align: center; }

/* Trust and policy */
.ysb-trust-section { position: relative; overflow: hidden; border: 1px solid var(--ysb-line); border-radius: 3px 3px 24px 3px; background: var(--ysb-paper); box-shadow: var(--ysb-shadow-sm); }
.ysb-trust-intro { height: 100%; background: var(--ysb-ink); }
.ysb-trust-grid { height: 100%; }
.ysb-trust-item { min-height: 150px; padding: 24px; border-top: 1px solid var(--ysb-line); }
.ysb-trust-item:nth-child(odd) { border-right: 1px solid var(--ysb-line); }
.ysb-trust-icon { display: inline-grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(167, 94, 64, 0.35); border-radius: 50%; color: var(--ysb-copper); font-family: Georgia, serif; font-size: 0.77rem; font-style: italic; }

/* Articles */
.ysb-article-shell { border: 1px solid var(--ysb-line); border-radius: 3px 3px var(--ysb-radius-lg) 3px; background: var(--ysb-paper); box-shadow: var(--ysb-shadow); }
.ysb-article-shell :where(h2, h3) { scroll-margin-top: 110px; }
.ysb-article-shell h2 { font-family: 'Noto Serif KR', 'Nanum Myeongjo', Batang, serif; }
.ysb-article-shell table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.ysb-article-shell th,
.ysb-article-shell td { padding: 0.82rem; border: 1px solid var(--ysb-line); vertical-align: top; }
.ysb-article-shell th { background: #ece6da; text-align: left; }
.ysb-article-shell figure,
.ysb-article-shell img { border-radius: 2px 2px var(--ysb-radius-md) 2px; }
.ysb-meta { color: #6c6c64; font-size: 0.88rem; }
.ysb-notice { border-left: 3px solid var(--ysb-copper); background: #f7eee7; }
.ysb-calculator { border: 1px solid rgba(35, 75, 58, 0.24); border-radius: 3px 3px var(--ysb-radius-md) 3px; background: #f0f4ef; }
.ysb-calculator :where(input, select, button) { min-height: 46px; border-radius: 3px; }

/* Footer */
.ysb-site-footer { position: relative; overflow: hidden; border-top: 4px solid var(--ysb-copper); }
.ysb-site-footer > * { position: relative; z-index: 1; }
.ysb-site-footer::after { content: "요리살림백과"; position: absolute; right: -20px; bottom: -22px; color: rgba(255, 255, 255, 0.025); font-family: 'Noto Serif KR', 'Nanum Myeongjo', Batang, serif; font-size: clamp(4.5rem, 10vw, 10rem); font-weight: 800; line-height: 1; pointer-events: none; }
.ysb-footer-links { padding-left: 0; list-style: none; }
.ysb-footer-links a { color: #d8d2c7; text-decoration: none; }
.ysb-footer-links a:hover { color: #fffefa; }

.wp-block-query-pagination { gap: 10px; }
.wp-block-query-pagination a,
.wp-block-query-pagination-numbers .page-numbers { display: inline-flex; min-width: 42px; min-height: 42px; align-items: center; justify-content: center; border: 1px solid var(--ysb-line); border-radius: 50%; text-decoration: none; }

@media (max-width: 1020px) {
  .ysb-brand-note,
  .ysb-header-search { display: none; }
  .ysb-latest-grid.wp-block-post-template { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 781px) {
  .ysb-site-header { position: relative; }
  .ysb-hero { min-height: auto; border-radius: 3px 3px 20px 3px; }
  .ysb-hero-title br { display: none; }
  .ysb-hero-visual { min-height: 390px; margin-top: 12px; }
  .ysb-search .wp-block-search__inside-wrapper { border-radius: 3px; }
  .ysb-search .wp-block-search__button { padding-inline: 16px; }
  .ysb-quick-strip { margin-top: 18px !important; }
  .ysb-quick-label,
  .ysb-quick-link { width: 100%; }
  .ysb-category-card { min-height: 170px; }
  .ysb-editorial-item { padding: 20px 0 0; border-top: 1px solid rgba(255, 254, 250, 0.2); border-left: 0; }
  .ysb-latest-grid.wp-block-post-template { grid-template-columns: 1fr; }
  .ysb-latest-grid > li:first-child { grid-column: auto; }
  .ysb-latest-grid > li:first-child .wp-block-post-featured-image img { aspect-ratio: 16 / 10; }
  .ysb-trust-item:nth-child(odd) { border-right: 0; }
  .ysb-article-shell { border-radius: 3px 3px 20px 3px; }
  .ysb-article-shell .wp-block-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 480px) {
  .ysb-brand-mark { width: 38px; height: 38px; flex-basis: 38px; }
  .ysb-visual-card { width: calc(100% - 46px); right: 23px; padding: 25px; }
  .ysb-search-hints { display: none; }
}
