/*
Theme Name: Tea Tales
Theme URI: https://example.com/
Author: Mayank
Description: Custom blog theme for Tea Tales with Mayank. Built-in on-page SEO (meta fields, Open Graph, schema, breadcrumbs), contact form and popup.
Version: 1.0.0
Requires at least: 6.3
Requires PHP: 7.4
Text Domain: tea-tales
*/

:root {
  --paper: #edf0e8;
  --paper-2: #e1e7d8;
  --steep: #23422f;
  --steep-d: #182e21;
  --hib: #9c2f52;
  --hib-d: #7d2141;
  --amber: #d9a441;
  --ink: #1d2620;
  --muted: #52605a;
  --line: #c9d2c1;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--hib); text-underline-offset: 3px; }
a:hover { color: var(--hib-d); }
:focus-visible { outline: 3px solid var(--hib); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; color: var(--steep-d); margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1.1em; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 22px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: #fff; padding: 8px 14px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* Buttons */
.btn { display: inline-block; background: var(--hib); color: #fff; border: 2px solid var(--hib); padding: .65rem 1.4rem; border-radius: 4px; font: 600 1rem var(--sans); text-decoration: none; cursor: pointer; transition: background .15s; }
.btn:hover { background: var(--hib-d); border-color: var(--hib-d); color: #fff; }
.btn-outline { background: transparent; color: var(--steep); border-color: var(--steep); }
.btn-outline:hover { background: var(--steep); border-color: var(--steep); color: var(--paper); }
.btn-amber { background: var(--amber); border-color: var(--amber); color: var(--steep-d); }
.btn-amber:hover { background: #e6b556; border-color: #e6b556; color: var(--steep-d); }

/* Header */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.custom-logo { max-height: 48px; width: auto; }
.site-title { margin: 0; font: 700 1.55rem/1 var(--serif); }
.site-title a { color: var(--steep-d); text-decoration: none; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 26px; }
.main-nav a { color: var(--ink); text-decoration: none; font-weight: 600; padding: 6px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current_page_item > a { border-bottom-color: var(--hib); color: var(--ink); }
.nav-toggle { display: none; background: none; border: 2px solid var(--steep); color: var(--steep); padding: 6px 14px; border-radius: 4px; font: 600 .95rem var(--sans); cursor: pointer; }

/* Notices */
.tt-notice { padding: 12px 22px; text-align: center; font-weight: 600; }
.tt-notice.ok { background: #d5e8cc; color: #1c4a1c; }
.tt-notice.err { background: #f3d6d6; color: #7a1c1c; }

/* Hero (home) */
.hero { position: relative; overflow: hidden; background: var(--steep); color: var(--paper); padding: clamp(3.5rem, 9vw, 6.5rem) 0; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.hero::before { width: 420px; height: 420px; right: -90px; top: 50%; transform: translateY(-50%); border: 16px solid rgba(217, 164, 65, .28); }
.hero::after { width: 300px; height: 300px; right: -30px; top: 50%; transform: translateY(-50%); border: 5px solid rgba(217, 164, 65, .18); }
.hero .container { position: relative; z-index: 1; }
.hero h1 { color: var(--paper); font-size: clamp(2.6rem, 8vw, 5.4rem); line-height: 1.02; max-width: 12ch; letter-spacing: -.01em; }
.hero-sub { font: 1.25rem/1.5 var(--serif); max-width: 34ch; color: #d6dfcf; margin-bottom: 1.8rem; }
.hero :focus-visible { outline-color: var(--amber); }

/* Sections */
.section { padding: 3.5rem 0 1rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 1.6rem; }
.section-head h2 { margin: 0; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 2.6rem 2rem; margin-bottom: 2rem; }

/* Post card */
.card-img { display: block; overflow: hidden; border-radius: 3px; background: var(--paper-2); aspect-ratio: 16 / 10; margin-bottom: 14px; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-cat { display: inline-block; color: var(--hib); font-weight: 700; font-size: .9rem; text-decoration: none; margin-bottom: 4px; }
.card-title { font-size: 1.4rem; margin-bottom: .4em; }
.card-title a { color: var(--steep-d); text-decoration: none; }
.card-title a:hover { color: var(--hib); text-decoration: underline; }
.card-excerpt { color: var(--muted); margin-bottom: .7em; }
.card-meta, .entry-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--muted); font-size: .9rem; margin: 0; }

/* Topics */
.topic-list { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0 0 2rem; }
.topic-list a { display: inline-block; border: 1.5px solid var(--steep); color: var(--steep); padding: .3rem 1rem; border-radius: 999px; text-decoration: none; font-weight: 600; }
.topic-list a:hover { background: var(--steep); color: var(--paper); }

/* CTA band */
.cta { background: var(--paper-2); margin-top: 3rem; padding: 3.5rem 0; }
.cta .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.cta h2 { margin: 0; }

/* Archive header */
.archive-header { padding: 2.6rem 0 1.4rem; }
.archive-label { color: var(--hib); font-weight: 700; margin: 0 0 4px; }
.archive-desc { color: var(--muted); max-width: 60ch; font-size: 1.1rem; }
.archive-wrap { padding-bottom: 3rem; }

/* Breadcrumbs */
.breadcrumbs { font-size: .9rem; color: var(--muted); padding-top: 22px; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.breadcrumbs li + li::before { content: "/"; margin: 0 .55rem; color: var(--line); }
.breadcrumbs a { color: var(--muted); }

/* Single */
.single { max-width: 720px; margin: 0 auto; padding-bottom: 2rem; }
.entry-header { padding: 1.4rem 0 1.2rem; }
.entry-cats a { color: var(--hib); font-weight: 700; text-decoration: none; margin-right: 12px; font-size: .95rem; }
.entry-title { margin-bottom: .35em; }
.entry-thumb { margin: 0 0 2rem; }
.entry-thumb img { width: 100%; border-radius: 3px; }
.entry-content { font: 1.15rem/1.8 var(--serif); }
.entry-content h2 { margin-top: 2em; }
.entry-content h3 { margin-top: 1.6em; }
.entry-content blockquote { margin: 1.6em 0; padding: .2em 0 .2em 1.3em; border-left: 4px solid var(--amber); font-style: italic; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content img { border-radius: 3px; }
.entry-content pre { overflow-x: auto; background: var(--steep-d); color: var(--paper); padding: 16px; border-radius: 4px; font-size: .9rem; }
.tag-list { margin: 2rem 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag-list a { background: var(--paper-2); color: var(--steep); padding: .15rem .8rem; border-radius: 999px; text-decoration: none; font-size: .9rem; }
.tag-list a:hover { background: var(--steep); color: var(--paper); }
.post-nav { max-width: 720px; margin: 2rem auto; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px 0; }
.post-nav a { font-weight: 600; text-decoration: none; }
.related { border-top: 1px solid var(--line); margin-top: 2.5rem; padding: 2.5rem 0 3rem; }

/* Pagination */
.pagination { margin: 1rem 0 3rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers { padding: .4rem .9rem; border: 1.5px solid var(--line); border-radius: 4px; text-decoration: none; color: var(--ink); font-weight: 600; }
.pagination .page-numbers.current, .pagination a.page-numbers:hover { background: var(--steep); border-color: var(--steep); color: var(--paper); }

/* Pages */
.page-wrap { max-width: 760px; padding-bottom: 3rem; }
.page-wrap .entry-content { font-size: 1.1rem; }

/* Forms */
.tt-form label { display: block; font-weight: 600; margin-bottom: 4px; }
.tt-form input[type="text"], .tt-form input[type="email"], .tt-form textarea, .search-form input[type="search"] { width: 100%; padding: .7rem .8rem; border: 1.5px solid #93a292; border-radius: 4px; background: #fff; font: inherit; color: var(--ink); }
.tt-form textarea { min-height: 160px; resize: vertical; }
.tt-form p { margin-bottom: 1.1rem; }
.tt-hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.search-form { display: flex; gap: 10px; max-width: 480px; }

/* Comments */
.comments { max-width: 720px; margin: 2rem auto 3rem; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 1.5rem; }
.comment-body { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; padding: .6rem; border: 1.5px solid #93a292; border-radius: 4px; font: inherit; }

/* Footer */
.site-footer { background: var(--steep-d); color: #cdd8c6; margin-top: 0; padding: 3rem 0 2rem; }
.site-footer a { color: var(--paper); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px; margin-bottom: 2rem; }
.footer-brand { max-width: 34ch; }
.footer-title { font: 700 1.4rem var(--serif); color: var(--paper); margin: 0 0 6px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer .copy { border-top: 1px solid rgba(255,255,255,.14); padding-top: 1.2rem; margin: 0; font-size: .9rem; }
.site-footer :focus-visible { outline-color: var(--amber); }

@media (max-width: 720px) {
  body { font-size: 16.5px; }
  .nav-toggle { display: inline-block; }
  .main-nav { display: none; width: 100%; }
  .main-nav.is-open { display: block; }
  .header-inner { flex-wrap: wrap; }
  .main-nav ul { flex-direction: column; gap: 4px; padding: 8px 0; }
  .hero::before { right: -220px; }
  .hero::after { right: -160px; }
  .post-nav { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
