/*
Theme Name: Thichthucung WikiAnswerly
Theme URI: https://thichthucung.com/
Author: Thichthucung
Description: Editorial knowledge-base theme for pet care content. Built as an independent, SEO-friendly theme.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: thichthucung-wikianswerly
*/

:root {
  --ink: #15221d;
  --muted: #68756e;
  --line: #e6ebe7;
  --paper: #ffffff;
  --wash: #f4f8f4;
  --accent: #2f7653;
  --accent-dark: #1f573d;
  --accent-soft: #dcecdf;
  --max: 1180px;
  --serif: "Noto Serif", "DejaVu Serif", Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); line-height: 1.65; }
h1, h2, h3, h4, h5, h6 { font-family: var(--sans); font-variant-ligatures: none; }
img { max-width: 100%; height: auto; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { color: var(--accent); }
.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; }
.site-shell { min-height: 100vh; display: flex; flex-direction: column; }
.container { width: min(var(--max), calc(100% - 40px)); margin-inline: auto; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; }
.skip-link:focus { top: 12px; }

.site-header { border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px); }
.header-inner { min-height: 76px; display: flex; align-items: center; gap: 28px; }
.site-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; letter-spacing: -.03em; font-size: 20px; white-space: nowrap; }
.site-brand .custom-logo-link { display: inline-flex; align-items: center; }
.site-brand .custom-logo { display: block; width: auto; max-width: 220px; max-height: 48px; object-fit: contain; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 17px; }
.primary-nav { margin-left: auto; }
.primary-nav > ul, .primary-nav > .menu-main-menu-container > ul { display: flex; align-items: center; gap: 22px; list-style: none; margin: 0; padding: 0; }
.primary-nav li { position: relative; list-style: none; }
.primary-nav .sub-menu { display: none; position: absolute; top: calc(100% + 18px); left: -16px; min-width: 210px; margin: 0; padding: 8px; list-style: none; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 12px 28px rgba(24, 50, 31, .12); }
.primary-nav .sub-menu::before { content: ""; position: absolute; left: 22px; top: -7px; width: 12px; height: 12px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); background: #fff; transform: rotate(45deg); }
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { display: block; }
.primary-nav .sub-menu li { display: block; }
.primary-nav .sub-menu a { display: block; padding: 8px 10px; border-radius: 6px; white-space: nowrap; }
.primary-nav .sub-menu a:hover, .primary-nav .sub-menu a:focus { background: var(--wash); }
.primary-nav ul ul { display: none; position: absolute; top: calc(100% + 18px); left: -16px; min-width: 210px; margin: 0; padding: 8px; list-style: none; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 12px 28px rgba(24, 50, 31, .12); }
.primary-nav li:hover > ul, .primary-nav li:focus-within > ul { display: block; }
.primary-nav ul ul li { display: block; }
.primary-nav ul ul a { display: block; padding: 8px 10px; border-radius: 6px; white-space: nowrap; }
.primary-nav ul ul a:hover, .primary-nav ul ul a:focus { background: var(--wash); }
.menu-toggle { display: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--ink); background: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.primary-nav a { color: var(--muted); font-size: 14px; font-weight: 650; }
.primary-nav a:hover { color: var(--accent-dark); }
.header-search { display: flex; width: 220px; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--wash); }
.header-search input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 8px 12px; background: transparent; font: inherit; font-size: 13px; }
.header-search button { border: 0; padding: 0 12px; color: var(--accent-dark); background: transparent; cursor: pointer; }

.hero { padding: 76px 0 68px; background: radial-gradient(circle at 80% 0%, #e8f3e8 0, transparent 38%), var(--wash); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); gap: 60px; align-items: center; }
.eyebrow { color: var(--accent); font-weight: 800; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.hero h1 { max-width: 700px; margin: 12px 0 16px; font-family: var(--sans); font-size: clamp(40px, 5vw, 70px); letter-spacing: -.055em; line-height: 1.02; font-weight: 800; font-variant-ligatures: none; }
.hero p { max-width: 590px; color: var(--muted); font-size: 17px; }
.hero-search { display: flex; max-width: 620px; margin-top: 28px; border: 1px solid #cbd9cc; border-radius: 12px; background: #fff; box-shadow: 0 12px 35px rgba(39, 80, 52, .08); overflow: hidden; }
.hero .header-search { display: flex; width: 100%; max-width: 620px; margin-top: 28px; border: 1px solid #cbd9cc; border-radius: 12px; background: #fff; box-shadow: 0 12px 35px rgba(39, 80, 52, .08); overflow: hidden; }
.hero .header-search input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 16px 18px; background: transparent; font: inherit; font-size: 16px; }
.hero .header-search button { border: 0; border-radius: 0; padding: 0 22px; color: #fff; background: var(--accent); cursor: pointer; }
.hero-search input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 16px 18px; font: inherit; }
.button, .hero-search button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; padding: 12px 18px; font-weight: 750; cursor: pointer; }
.hero-search button { border-radius: 0; padding-inline: 22px; }
.hero-card { background: #fff; border: 1px solid #dce8dd; border-radius: 18px; padding: 26px; box-shadow: 0 18px 50px rgba(40, 75, 48, .08); }
.hero-card h2 { margin: 0 0 14px; font-family: var(--sans); font-size: 25px; font-weight: 750; }
.hero-card ul { list-style: none; padding: 0; margin: 0; }
.hero-card li { border-top: 1px solid var(--line); padding: 11px 0; }
.hero-card li a { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.hero-card li a::after { content: "↗"; color: var(--accent); }

.section { padding: 58px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.section h2 { margin: 0; font-family: var(--sans); font-size: 34px; line-height: 1.15; letter-spacing: -.035em; font-weight: 800; font-variant-ligatures: none; }
.section-head p { margin: 0; color: var(--muted); }
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.category-card { min-height: 135px; padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: #fff; transition: transform .18s ease, box-shadow .18s ease; }
.category-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(29, 63, 40, .08); }
.category-card h3 { margin: 10px 0 3px; font-size: 17px; }
.category-card p { color: var(--muted); margin: 0; font-size: 13px; }
.category-icon { font-size: 21px; }
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 52px; align-items: start; }
.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 22px; }
.post-card { display: flex; flex-direction: column; min-width: 0; }
.post-card-image { aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--accent-soft); margin-bottom: 15px; }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; }
.post-card h3 { margin: 7px 0 8px; font-family: var(--sans); font-size: 23px; line-height: 1.2; font-weight: 750; letter-spacing: -.02em; font-variant-ligatures: none; }
.post-card p { margin: 0; color: var(--muted); font-size: 14px; }
.post-meta, .entry-meta { color: var(--muted); font-size: 12px; }
.post-meta a { color: var(--accent); font-weight: 700; }
.sidebar-box { border-top: 3px solid var(--accent); padding-top: 15px; margin-bottom: 34px; }
.sidebar-box h2 { font-family: var(--sans); font-size: 24px; line-height: 1.2; margin: 0 0 12px; font-weight: 750; }
.sidebar-box ul { list-style: none; padding: 0; margin: 0; }
.sidebar-box li { border-bottom: 1px solid var(--line); padding: 9px 0; font-size: 14px; }

.archive-header { padding: 58px 0 38px; background: var(--wash); border-bottom: 1px solid var(--line); }
.archive-header h1 { max-width: 800px; margin: 7px 0 8px; font-family: var(--sans); font-size: clamp(38px, 5vw, 58px); line-height: 1.05; letter-spacing: -.05em; font-weight: 800; font-variant-ligatures: none; }
.archive-header p { margin: 0; color: var(--muted); }
.breadcrumbs { margin-bottom: 16px; color: var(--muted); font-size: 13px; }
.breadcrumbs a { color: var(--accent); }
.entry-wrap { padding: 56px 0; }
.entry-layout { display: grid; grid-template-columns: minmax(0, 760px) 260px; gap: 62px; align-items: start; }
.entry-header h1 { margin: 8px 0 15px; font-family: var(--sans); font-size: clamp(38px, 5vw, 62px); line-height: 1.04; letter-spacing: -.05em; font-weight: 800; font-variant-ligatures: none; }
.entry-summary { color: var(--muted); font-size: 18px; }
.entry-featured { margin: 27px 0; border-radius: 14px; overflow: hidden; }
.entry-content { font-size: 17px; }
.entry-content h2, .entry-content h3 { font-family: var(--sans); line-height: 1.2; margin-top: 2em; font-weight: 750; }
.entry-content h2 { font-size: 32px; }
.entry-content h3 { font-size: 24px; }
.entry-content a { text-decoration: underline; text-decoration-color: #a9cdb1; text-underline-offset: 3px; }
.entry-content blockquote { margin: 26px 0; padding: 4px 24px; border-left: 3px solid var(--accent); color: var(--muted); }
.entry-toc { position: sticky; top: 105px; border-top: 3px solid var(--accent); padding-top: 14px; }
.entry-toc strong { display: block; margin-bottom: 10px; font-family: var(--sans); font-size: 21px; font-weight: 750; }
.entry-toc ol { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.entry-toc .toc-level-3 { margin-left: 12px; }
.pagination { display: flex; gap: 8px; margin-top: 38px; }
.pagination .page-numbers { display: inline-grid; place-items: center; min-width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 7px; }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }
.no-results { padding: 40px 0; }
.no-results > .header-search { display: flex; width: min(620px, 100%); margin-top: 24px; border: 1px solid #cbd9cc; border-radius: 10px; overflow: hidden; }
.no-results > .header-search input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 13px 15px; font: inherit; }
.no-results > .header-search button { border: 0; padding: 0 18px; color: #fff; background: var(--accent); cursor: pointer; }

.site-footer { margin-top: auto; padding: 42px 0 25px; background: #16271e; color: #d9e6dc; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; padding-bottom: 30px; }
.site-footer h2 { color: #fff; font-family: var(--sans); font-size: 25px; font-weight: 750; margin: 0 0 10px; }
.site-footer p, .site-footer li { color: #afc1b4; font-size: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 5px 0; }
.site-footer a { color: #d9e6dc; }
.footer-bottom { padding-top: 19px; border-top: 1px solid rgba(255,255,255,.13); color: #94aa9b; font-size: 12px; }

@media (max-width: 900px) {
  .hero-grid, .entry-layout { grid-template-columns: 1fr; gap: 30px; }
  .entry-toc { position: static; order: -1; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .menu-toggle { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; }
  .primary-nav { display: none; position: absolute; left: 14px; right: 14px; top: calc(100% + 1px); padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 12px 28px rgba(24, 50, 31, .12); }
  .primary-nav.is-open { display: block; }
  .primary-nav > ul, .primary-nav > .menu-main-menu-container > ul { display: block; }
  .primary-nav > ul > li, .primary-nav > .menu-main-menu-container > ul > li { border-bottom: 1px solid var(--line); }
  .primary-nav > ul > li:last-child, .primary-nav > .menu-main-menu-container > ul > li:last-child { border-bottom: 0; }
  .primary-nav > ul > li > a, .primary-nav > .menu-main-menu-container > ul > li > a { display: block; padding: 10px 8px; }
  .primary-nav .sub-menu, .primary-nav ul ul { position: static; display: block; min-width: 0; padding: 0 0 7px 14px; border: 0; border-radius: 0; box-shadow: none; }
  .primary-nav .sub-menu::before { display: none; }
  .primary-nav .sub-menu a { padding: 7px 8px; white-space: normal; }
  .header-search { margin-left: auto; width: min(220px, 42vw); }
  .content-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .container { width: min(var(--max), calc(100% - 28px)); }
  .header-inner { min-height: 64px; gap: 10px; }
  .site-brand { font-size: 17px; }
  .brand-mark { width: 30px; height: 30px; }
  .header-search { width: 42px; background: transparent; border: 0; }
  .header-search input { display: none; }
  .header-search button { width: 42px; height: 42px; padding: 0; }
  .hero { padding: 48px 0; }
  .hero h1 { font-size: 43px; }
  .hero-search { display: block; border: 0; background: transparent; box-shadow: none; overflow: visible; }
  .hero-search input, .hero-search button { width: 100%; border: 1px solid #cbd9cc; border-radius: 8px; }
  .hero-search button { margin-top: 8px; }
  .hero .header-search { display: block; border: 0; background: transparent; box-shadow: none; overflow: visible; }
  .hero .header-search input, .hero .header-search button { width: 100%; border: 1px solid #cbd9cc; border-radius: 8px; }
  .hero .header-search button { margin-top: 8px; padding: 13px 18px; }
  .section { padding: 40px 0; }
  .section-head { display: block; }
  .section-head p { margin-top: 8px; }
  .post-grid { grid-template-columns: 1fr; }
  .category-grid, .footer-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}
