/*
Theme Name: Thơ Tình Hay
Theme URI: https://thotinhhay.com/
Author: Thơ Tình Hay
Author URI: https://thotinhhay.com/
Description: Giao diện tạp chí thơ Việt hiện đại, thanh lịch và tối ưu cho bài đọc dài.
Version: 1.0.4
Requires at least: 6.2
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: kira-thotinhhay-com
*/

:root {
  --wine: #7a1835;
  --wine-dark: #551126;
  --rose: #c17a8d;
  --cream: #fff9f3;
  --paper: #fffdf9;
  --ink: #291f23;
  --muted: #75686d;
  --line: #eadfd9;
  --shadow: 0 18px 55px rgba(80, 33, 47, .1);
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); font-size: 16px; line-height: 1.75; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--wine); text-decoration: none; transition: color .2s ease, opacity .2s ease, transform .2s ease; }
a:hover { color: var(--wine-dark); }
h1, h2, h3, h4 { color: var(--ink); font-family: var(--serif); line-height: 1.25; margin: 0 0 .7em; }
h1 { font-size: clamp(2.35rem, 5vw, 4.7rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.65rem, 3vw, 2.55rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1.3em; }
ul, ol { margin: 0 0 1.5em; }
button, input, textarea { font: inherit; }
.site-container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.narrow-content { max-width: 860px; }
.section-space { padding-block: 72px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.screen-reader-text:focus { top: 8px; left: 8px; width: auto; height: auto; padding: 12px 16px; clip: auto; z-index: 100000; background: #fff; }
.eyebrow { margin: 0 0 12px; color: var(--wine); font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow-light { color: #f3c8d3; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 24px; border: 1px solid var(--wine); border-radius: 4px; color: #fff; background: var(--wine); font-size: .92rem; font-weight: 700; }
.button:hover { color: #fff; background: var(--wine-dark); transform: translateY(-1px); }
.button-light { color: var(--wine); background: #fff; border-color: #fff; }
.button-light:hover { color: var(--wine-dark); background: var(--cream); }
.text-link, .read-more { font-size: .9rem; font-weight: 700; }
.text-link span, .read-more span { display: inline-block; margin-left: 4px; }

.top-note { padding: 7px 0; color: #f8dde5; background: var(--wine-dark); font-size: .76rem; text-align: center; letter-spacing: .04em; }
.site-header { position: relative; z-index: 50; background: rgba(255,253,249,.97); border-bottom: 1px solid var(--line); }
.branding-row { min-height: 88px; display: flex; align-items: center; gap: 26px; }
.site-branding { flex: 0 0 auto; }
.custom-logo-link, .fallback-logo { display: block; }
.custom-logo, .fallback-logo img { width: 208px; max-height: 74px; object-fit: contain; object-position: left center; }
.primary-menu-wrap { flex: 1; }
.primary-menu-wrap ul { display: flex; align-items: center; justify-content: flex-end; gap: clamp(18px, 2.6vw, 34px); margin: 0; padding: 0; list-style: none; }
.primary-menu-wrap a { position: relative; color: var(--ink); font-size: .9rem; font-weight: 600; }
.primary-menu-wrap a::after { content: ''; position: absolute; left: 0; right: 100%; bottom: -8px; height: 2px; background: var(--wine); transition: right .2s ease; }
.primary-menu-wrap a:hover::after, .primary-menu-wrap .current-menu-item > a::after { right: 0; }
.header-search { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); font-family: Georgia, serif; font-size: 1.45rem; }
.menu-toggle { display: none; width: 44px; height: 44px; padding: 10px; border: 0; background: transparent; }
.menu-toggle > span:not(.screen-reader-text) { display: block; height: 2px; margin: 5px 0; background: var(--ink); }

.home-hero { position: relative; min-height: 650px; display: grid; align-items: center; color: #fff; background-position: center 42%; background-size: cover; }
.home-hero::before { content: ''; position: absolute; inset: 0; background: rgba(31,16,23,.62); }
.hero-inner { position: relative; z-index: 1; padding-block: 96px; }
.hero-inner h1 { max-width: 760px; color: #fff; font-style: italic; font-weight: 600; }
.hero-lead { max-width: 620px; color: #f7edf0; font-size: 1.08rem; }
.hero-actions { display: flex; align-items: center; gap: 28px; margin-top: 30px; }
.hero-actions .text-link { color: #fff; }
.page-content-home { padding-top: 74px; }
.page-content-home .entry-content > .home-intro { max-width: 820px; margin-inline: auto; text-align: center; }
.home-intro .lead { color: var(--muted); font-family: var(--serif); font-size: 1.24rem; }
.values-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 48px; text-align: left; }
.value-card { padding: 28px; background: var(--cream); border-top: 3px solid var(--rose); }
.value-card h3 { margin-bottom: 8px; }
.value-card p { color: var(--muted); margin: 0; font-size: .92rem; }
.home-categories { background: #f8eee9; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.section-heading h2 { margin-bottom: 0; }
.category-showcase { display: grid; grid-template-columns: 1.5fr 1fr 1fr; grid-template-rows: repeat(2, 210px); gap: 18px; }
.category-tile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding: 28px; color: #fff; background-size: cover; background-position: center; overflow: hidden; }
.category-tile::before { content: ''; position: absolute; inset: 0; background: rgba(25,10,16,.45); }
.category-tile:first-child { grid-row: 1 / 3; }
.category-tile:hover { color: #fff; transform: translateY(-2px); }
.category-tile span, .category-tile small { position: relative; z-index: 1; }
.category-tile span { font-family: var(--serif); font-size: 1.55rem; font-weight: 600; }
.category-tile small { opacity: .82; }
.posts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.posts-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.post-card { min-width: 0; background: #fff; border: 1px solid var(--line); box-shadow: 0 12px 36px rgba(57,29,37,.06); }
.card-image { display: block; aspect-ratio: 1.52 / 1; overflow: hidden; background: #eee; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.post-card:hover .card-image img { transform: scale(1.035); }
.card-body { padding: 24px; }
.card-category { margin-bottom: 10px; color: var(--wine); font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.card-category a { color: inherit; }
.card-title { margin-bottom: 10px; font-size: 1.35rem; }
.card-title a { color: var(--ink); }
.card-body p { color: var(--muted); font-size: .9rem; line-height: 1.65; }
.entry-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; color: #8b7c81; font-size: .75rem; }
.meta-dot { color: var(--rose); }
.newsletter { padding-block: 60px; color: #f8e9ee; background: var(--wine); }
.newsletter-inner { display: flex; align-items: center; justify-content: space-between; gap: 36px; }
.newsletter h2 { color: #fff; margin-bottom: 8px; }
.newsletter p:last-child { margin: 0; }
.home-page-content > * { max-width: none; margin: 0; }
.seed-home-hero { position: relative; min-height: 650px; display: grid; align-items: center; overflow: hidden; color: #fff; background: #241219; }
.seed-home-hero::before { content: ''; position: absolute; inset: 0; z-index: 1; background: rgba(31,16,23,.6); }
.seed-home-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }
.seed-hero-copy { position: relative; z-index: 2; padding-block: 96px; }
.seed-hero-copy h1 { max-width: 760px; color: #fff; font-style: italic; font-weight: 600; }
.seed-hero-copy > p:not(.eyebrow) { max-width: 620px; color: #f7edf0; font-size: 1.08rem; }
.seed-hero-copy .text-link { color: #fff; }
.seed-section { padding-block: 74px; }
.seed-section-soft { background: #f8eee9; }
.seed-section .home-intro { max-width: 900px; text-align: center; }
.seed-category-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; grid-template-rows: repeat(2, 210px); gap: 18px; }
.seed-category-grid a { position: relative; display: flex; align-items: flex-end; overflow: hidden; color: #fff; background: #2d1820; }
.seed-category-grid a:first-child { grid-row: 1 / 3; }
.seed-category-grid a::before { content: ''; position: absolute; inset: 0; z-index: 1; background: rgba(25,10,16,.42); }
.seed-category-grid img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.seed-category-grid a:hover img { transform: scale(1.035); }
.seed-category-grid span { position: relative; z-index: 2; padding: 26px; font-family: var(--serif); font-size: 1.45rem; font-weight: 600; }
.seed-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.seed-feature-grid article { background: #fff; border: 1px solid var(--line); box-shadow: 0 12px 36px rgba(57,29,37,.06); }
.seed-feature-grid article > img { width: 100%; aspect-ratio: 1.5 / 1; object-fit: cover; }
.seed-feature-grid article > div { padding: 25px; }
.seed-feature-grid h3 { margin-bottom: 10px; }
.seed-feature-grid article > div > p:not(.eyebrow) { color: var(--muted); font-size: .9rem; }
.seed-process { padding-block: 72px; color: #eadde1; background: var(--wine-dark); }
.seed-process h2, .seed-process h3 { color: #fff; }
.seed-process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-bottom: 34px; }
.seed-process-grid > div { padding: 24px; border: 1px solid rgba(255,255,255,.18); }
.seed-process-grid strong { color: #e8adbd; font-family: var(--serif); font-size: 1.8rem; }
.seed-process-grid p { margin-bottom: 0; color: #d8c7cc; font-size: .88rem; }

.page-hero, .category-hero { position: relative; min-height: 360px; display: grid; align-items: center; color: #fff; background-color: var(--wine-dark); background-position: center; background-size: cover; }
.page-hero.has-image::before, .category-hero::before { content: ''; position: absolute; inset: 0; background: rgba(31,16,23,.66); }
.page-hero .site-container, .category-hero .site-container { position: relative; z-index: 1; }
.page-hero h1, .category-hero h1 { color: #fff; font-size: clamp(2.5rem, 5vw, 4rem); }
.page-hero p:last-child, .category-hero .archive-description { max-width: 710px; color: #f5e5e9; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; color: var(--muted); font-size: .78rem; }
.breadcrumbs a { color: var(--wine); }
.entry-content { color: #3f3337; }
.entry-content > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.entry-content .alignwide { max-width: 1040px; }
.entry-content h2 { margin-top: 1.8em; }
.entry-content h3 { margin-top: 1.6em; }
.entry-content blockquote { position: relative; margin-block: 36px; padding: 26px 34px; color: var(--wine-dark); background: var(--cream); border-left: 3px solid var(--wine); font-family: var(--serif); font-size: 1.16rem; font-style: italic; }
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content .poem { margin-block: 30px; padding: 32px clamp(24px, 7vw, 64px); color: #433339; background: #fbf5f1; border: 1px solid var(--line); font-family: var(--serif); font-size: 1.08rem; line-height: 2; white-space: normal; }
.entry-content .info-grid { max-width: 960px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-block: 34px; }
.entry-content .info-card { padding: 26px; background: var(--cream); border: 1px solid var(--line); }
.entry-content .info-card h3 { margin-top: 0; }
.entry-content .cta-panel { max-width: 960px; margin-block: 42px; padding: 34px; color: #fff; background: var(--wine); }
.entry-content .cta-panel h2 { color: #fff; margin-top: 0; }
.entry-content .cta-panel a { color: #fff; text-decoration: underline; }
.content-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 52px; align-items: start; }
.archive-header { max-width: 820px; margin-bottom: 42px; }
.archive-header h1 { font-size: clamp(2.2rem, 4vw, 3.5rem); }
.archive-description { color: var(--muted); }
.site-sidebar { position: sticky; top: 26px; }
.widget { margin-bottom: 24px; padding: 26px; background: #fff; border: 1px solid var(--line); }
.widget-title { padding-bottom: 13px; border-bottom: 1px solid var(--line); font-size: 1.15rem; }
.widget ul { margin: 0; padding: 0; list-style: none; }
.widget li { padding: 9px 0; border-bottom: 1px dotted var(--line); font-size: .88rem; }
.widget li:last-child { border-bottom: 0; }
.widget li time { display: block; color: var(--muted); font-size: .72rem; }
.widget-search form, .search-form { display: flex; }
.search-field { min-width: 0; width: 100%; padding: 11px 13px; border: 1px solid var(--line); background: #fff; }
.search-submit { padding: 10px 15px; border: 1px solid var(--wine); color: #fff; background: var(--wine); }
.sidebar-quote { color: var(--wine-dark); background: var(--cream); font-family: var(--serif); font-style: italic; }
.sidebar-quote p { margin: 0; }

.single-article { min-width: 0; }
.single-header h1 { margin-bottom: 18px; font-size: clamp(2.25rem, 4vw, 3.55rem); }
.single-featured { margin: 30px 0 38px; }
.single-featured img { width: 100%; max-height: 620px; object-fit: cover; }
.single-content > * { margin-left: 0; margin-right: 0; }
.entry-footer { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); }
.post-navigation { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-block: 42px; padding-block: 24px; border-block: 1px solid var(--line); }
.post-navigation > div:last-child { text-align: right; }
.post-navigation small { display: block; color: var(--muted); }
.related-posts { margin-top: 46px; }
.pagination, .nav-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-numbers { display: grid; place-items: center; min-width: 40px; height: 40px; border: 1px solid var(--line); }
.page-numbers.current { color: #fff; background: var(--wine); border-color: var(--wine); }
.no-results { grid-column: 1 / -1; max-width: 680px; padding: 40px; background: var(--cream); }
.no-results form { max-width: 480px; margin-bottom: 20px; }

.error-page { min-height: 620px; display: grid; place-items: center; text-align: center; background: var(--cream); }
.error-page .site-container { max-width: 700px; }
.error-code { margin: 0; color: #e8d4d9; font-family: var(--serif); font-size: clamp(6rem, 20vw, 12rem); font-weight: 700; line-height: .8; }
.error-page .search-form { max-width: 520px; margin: 26px auto; }

.site-footer { color: #d8c7cc; background: #28161c; }
.footer-grid { display: grid; grid-template-columns: 1.35fr .8fr .8fr 1.1fr; gap: 52px; padding-block: 64px; }
.footer-brand img { width: 210px; margin-bottom: 20px; filter: brightness(0) invert(1); opacity: .9; }
.site-footer h2 { color: #fff; font-family: var(--sans); font-size: .9rem; letter-spacing: .08em; text-transform: uppercase; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #eadde1; font-size: .86rem; }
.site-footer p { font-size: .86rem; }
.footer-bottom { padding: 17px 0; color: #bca8ae; background: #1d0e13; font-size: .78rem; text-align: center; }

@media (max-width: 980px) {
  .header-search { display: none; }
  .menu-toggle { display: block; margin-left: auto; }
  .primary-menu-wrap { position: absolute; top: 100%; left: 0; right: 0; display: none; padding: 14px 20px 22px; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .primary-menu-wrap.is-open { display: block; }
  .primary-menu-wrap ul { display: block; }
  .primary-menu-wrap li { border-bottom: 1px solid var(--line); }
  .primary-menu-wrap a { display: block; padding: 12px 2px; }
  .primary-menu-wrap a::after { display: none; }
  .content-sidebar { grid-template-columns: minmax(0, 1fr) 270px; gap: 30px; }
  .posts-grid-three { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .site-container { width: min(100% - 28px, 1180px); }
  .section-space { padding-block: 52px; }
  .branding-row { min-height: 74px; }
  .custom-logo, .fallback-logo img { width: 175px; }
  .home-hero { min-height: 570px; background-position: 58% center; }
  .hero-inner { padding-block: 72px; }
  .hero-actions, .newsletter-inner { align-items: flex-start; flex-direction: column; }
  .values-grid, .posts-grid, .posts-grid-three, .content-sidebar, .entry-content .info-grid { grid-template-columns: 1fr; }
  .seed-feature-grid, .seed-process-grid { grid-template-columns: repeat(2, 1fr); }
  .seed-category-grid { grid-template-columns: 1fr 1fr; grid-template-rows: 300px 180px 180px; }
  .seed-category-grid a:first-child { grid-column: 1 / -1; grid-row: auto; }
  .category-showcase { grid-template-columns: 1fr 1fr; grid-template-rows: 300px 180px 180px; }
  .category-tile:first-child { grid-column: 1 / -1; grid-row: auto; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .site-sidebar { position: static; margin-top: 20px; }
  .page-hero, .category-hero { min-height: 310px; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 480px) {
  body { font-size: 15px; }
  .top-note { font-size: .68rem; }
  .category-showcase { display: block; }
  .category-tile { min-height: 220px; margin-bottom: 14px; }
  .seed-category-grid, .seed-feature-grid, .seed-process-grid { display: grid; grid-template-columns: 1fr; grid-template-rows: auto; }
  .seed-category-grid a { min-height: 220px; }
  .seed-category-grid a:first-child { grid-column: auto; }
  .hero-actions { width: 100%; }
  .hero-actions .button { width: 100%; }
  .post-navigation { grid-template-columns: 1fr; }
  .post-navigation > div:last-child { text-align: left; }
}
