/*
Theme Name: HootMD Editorial
Theme URI: https://hootmd.com
Author: HootMD
Description: A clean, credible editorial news theme built for HootMD. Medical news, curated daily. Serif headlines, clear hierarchy, dark mode, trending ticker.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hootmd-editorial
Tags: news, blog, two-columns, custom-menu, featured-images
*/

:root {
  --ink: #16324f;
  --ink-soft: #3d4f63;
  --teal: #0f8b8d;
  --teal-dark: #0b6f71;
  --paper: #ffffff;
  --wash: #f7f6f2;
  --rule: #e4e1d8;
  --rule-dark: #16324f;
  --meta: #7c8593;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --max: 1180px;
  --footer-bg: #16324f;
}

/* ---------- Dark mode ---------- */
html[data-theme="dark"] {
  --ink: #e4ebf4;
  --ink-soft: #b6c2d1;
  --teal: #35b5b7;
  --teal-dark: #5fc4c6;
  --paper: #0f1722;
  --wash: #161f2c;
  --rule: #263243;
  --rule-dark: #e4ebf4;
  --meta: #8fa0b3;
  --footer-bg: #0b111a;
}
html[data-theme="dark"] .kicker { filter: brightness(1.55); }
html[data-theme="dark"] {
  --owl-body: #e4ebf4;
  --owl-eye: #0f1722;
  --owl-beak: #35b5b7;
}
.site-footer { --owl-body: #5fc4c6; --owl-eye: #16324f; --owl-beak: #16324f; }
html[data-theme="dark"] .entry-content { color: #c7d2df; }
html[data-theme="dark"] img { opacity: .92; }
body, .site-nav, .band, .source-note { transition: background-color .25s ease, color .25s ease, border-color .25s ease; }

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--teal-dark); }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.15; margin: 0 0 .4em; font-weight: 700; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.screen-reader-text {
  clip: rect(1px,1px,1px,1px); position: absolute !important;
  height: 1px; width: 1px; overflow: hidden; word-wrap: normal !important;
}

/* ---------- Top bar ---------- */
.topbar { border-bottom: 1px solid var(--rule); font-size: 12.5px; color: var(--meta); }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 8px; padding-bottom: 8px; }
.topbar .tagline { letter-spacing: .04em; margin-left: auto; }
.mode-toggle {
  background: none; border: 1px solid var(--rule); border-radius: 999px;
  padding: 3px 10px; cursor: pointer; font-size: 13px; line-height: 1.4;
  color: var(--ink); display: inline-flex; align-items: center; gap: 6px;
}
.mode-toggle:hover { border-color: var(--teal); color: var(--teal-dark); }
.mode-toggle .sun { display: none; }
html[data-theme="dark"] .mode-toggle .sun { display: inline; }
html[data-theme="dark"] .mode-toggle .moon { display: none; }

/* ---------- Trending ticker ---------- */
.ticker { display: flex; align-items: stretch; border-bottom: 1px solid var(--rule); overflow: hidden; background: var(--paper); }
.ticker-label {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  background: var(--teal); color: #fff; font-size: 11.5px; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase; padding: 9px 18px;
}
.ticker-label .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: #fff;
  animation: hootmd-pulse 1.6s ease-in-out infinite;
}
@keyframes hootmd-pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.ticker-track { flex: 1; overflow: hidden; display: flex; align-items: center; }
.ticker-track ul {
  list-style: none; margin: 0; padding: 0; display: flex; flex: 0 0 auto;
  min-width: 100%; animation: hootmd-ticker 60s linear infinite;
}
.ticker-track:hover ul { animation-play-state: paused; }
.ticker-track li { flex: 0 0 auto; padding: 9px 0; font-size: 13.5px; white-space: nowrap; }
.ticker-track li a { font-weight: 600; }
.ticker-track li::after { content: "\2022"; color: var(--teal); margin: 0 18px; }
@keyframes hootmd-ticker { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker-track ul { animation: none; }
  .ticker-track { overflow-x: auto; }
}

/* ---------- Masthead ---------- */
.masthead { text-align: center; padding: 30px 0 22px; }
.masthead .brand { display: inline-flex; align-items: center; gap: 14px; }
.masthead .brand-lockup { display: block; height: 58px; width: auto; overflow: visible; }
.masthead .brand img.custom-logo { max-height: 56px; width: auto; }
.site-title {
  font-family: var(--serif); font-size: 44px; font-weight: 800;
  letter-spacing: -0.5px; margin: 0; line-height: 1;
}
.site-title .md { color: var(--teal); }
.site-desc { margin: 6px 0 0; font-size: 13px; color: var(--meta); letter-spacing: .12em; text-transform: uppercase; }

/* ---------- Navigation ---------- */
.site-nav { border-top: 1px solid var(--rule-dark); border-bottom: 1px solid var(--rule); position: sticky; top: 0; background: var(--paper); z-index: 50; }
.site-nav .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; grid-column: 2; }
.site-nav li a {
  display: block; padding: 12px 16px; font-size: 13px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
}
.site-nav li a:hover { color: var(--teal-dark); box-shadow: inset 0 -3px 0 var(--teal); }
.nav-search { grid-column: 3; justify-self: end; }
.site-nav .nav-toggle { grid-column: 1; justify-self: start; }
.nav-search form { display: flex; align-items: center; gap: 6px; }
.nav-search input[type="search"] {
  border: 1px solid var(--rule); border-radius: 3px; padding: 6px 10px;
  font-family: var(--sans); font-size: 13px; width: 160px; color: var(--ink);
}
.nav-search input[type="search"] { background: var(--paper); }
.nav-search button {
  background: var(--ink); color: var(--paper); border: 0; border-radius: 3px;
  padding: 7px 12px; font-size: 12px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; cursor: pointer;
}
.nav-search button:hover { background: var(--teal-dark); }
.nav-toggle { display: none; background: none; border: 1px solid var(--rule); border-radius: 3px; padding: 8px 12px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink); }

/* ---------- Section headers ---------- */
.section-head {
  display: flex; align-items: baseline; gap: 16px;
  border-top: 3px solid var(--ink); padding-top: 10px; margin: 44px 0 22px;
}
.section-head h2 {
  font-family: var(--sans); font-size: 15px; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase; margin: 0;
}
.section-head a.more { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--teal-dark); letter-spacing: .04em; }

/* ---------- Kicker / meta ---------- */
.kicker {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--cat, var(--teal-dark)); margin-bottom: 8px;
  border-left: 3px solid var(--cat, var(--teal-dark)); padding-left: 7px;
}
.kicker a { color: inherit; }
.meta { font-size: 12.5px; color: var(--meta); }
.meta .dot { margin: 0 6px; }

/* ---------- Lead section ---------- */
.lead-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 36px; margin-top: 28px; }
.lead-story .thumb { margin-bottom: 16px; }
.lead-story .thumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.lead-story h3 { font-size: 38px; letter-spacing: -0.4px; }
.lead-story h3 a:hover { color: var(--teal-dark); }
.lead-story .excerpt { font-family: var(--serif); font-size: 18px; color: var(--ink-soft); margin: 8px 0 10px; line-height: 1.5; }
.latest-rail { border-left: 1px solid var(--rule); padding-left: 28px; }
.latest-rail .rail-title { font-family: var(--sans); font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 14px; }
.rail-item { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.rail-item:first-of-type { padding-top: 0; }
.rail-item h4 { font-size: 18px; margin: 0 0 6px; }
.rail-item:last-child { border-bottom: 0; }

/* ---------- Card grids ---------- */
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card .thumb img { width: 100%; aspect-ratio: 3/2; object-fit: cover; margin-bottom: 12px; }
.card h3 { font-size: 20px; margin-bottom: 8px; }
.card .excerpt { font-size: 14px; color: var(--ink-soft); margin: 0 0 8px; }

/* ---------- Band (We Are Reading) ---------- */
.band { background: var(--wash); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 8px 0 40px; margin-top: 44px; }
.band .section-head { border-top-color: var(--teal); }
.band-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 48px; }
.band-item { display: flex; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--rule); align-items: flex-start; }
.band-item .thumb { flex: 0 0 130px; }
.band-item .thumb img { aspect-ratio: 4/3; object-fit: cover; }
.band-item h3 { font-size: 19px; margin-bottom: 6px; }

/* ---------- River (latest list) ---------- */
.river-item { display: flex; gap: 28px; padding: 26px 0; border-bottom: 1px solid var(--rule); }
.river-item .thumb { flex: 0 0 280px; }
.river-item .thumb img { aspect-ratio: 16/10; object-fit: cover; }
.river-item h3 { font-size: 24px; }
.river-item .excerpt { font-family: var(--serif); font-size: 16px; color: var(--ink-soft); margin: 6px 0 10px; }

/* ---------- Single post ---------- */
.single-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; padding-top: 40px; }
.article-main { max-width: 820px; }
.single-rail { border-left: 1px solid var(--rule); padding-left: 28px; }
.article-wrap { max-width: 740px; margin: 0 auto; padding: 40px 24px 0; }
.article-title { font-size: 42px; letter-spacing: -0.5px; margin-bottom: 14px; }
.article-meta { padding-bottom: 18px; border-bottom: 1px solid var(--rule); margin-bottom: 26px; }
.article-hero { margin: 0 0 28px; }
.article-hero img { width: 100%; }
.article-hero figcaption { font-size: 12.5px; color: var(--meta); margin-top: 8px; }
.entry-content { font-family: var(--serif); font-size: 18.5px; line-height: 1.72; color: #24344a; }
.entry-content p { margin: 0 0 1.3em; }
.entry-content a { color: var(--teal-dark); text-decoration: underline; text-underline-offset: 3px; }
.entry-content h2, .entry-content h3 { margin-top: 1.6em; }
.entry-content blockquote { border-left: 3px solid var(--teal); margin: 1.5em 0; padding: .2em 0 .2em 1.2em; color: var(--ink-soft); font-style: italic; }
.entry-content img { margin: 1.5em auto; }
.source-note { background: var(--wash); border: 1px solid var(--rule); border-radius: 4px; padding: 14px 18px; font-family: var(--sans); font-size: 13.5px; color: var(--ink-soft); margin: 32px 0; }
.tags-row { margin: 24px 0; font-size: 13px; }
.tags-row a { display: inline-block; background: var(--wash); border: 1px solid var(--rule); border-radius: 999px; padding: 4px 12px; margin: 0 6px 6px 0; color: var(--ink-soft); }
.tags-row a:hover { border-color: var(--teal); color: var(--teal-dark); }

/* ---------- Related ---------- */
.related { max-width: var(--max); margin: 20px auto 0; padding: 0 24px; }

/* ---------- Archive ---------- */
.archive-head { padding: 40px 0 6px; }
.archive-head .kicker { font-size: 12.5px; }
.archive-head h1 { font-size: 40px; margin: 0; }
.archive-head p.desc { color: var(--ink-soft); font-family: var(--serif); font-size: 17px; margin: 10px 0 0; max-width: 640px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 6px; padding: 40px 0; font-size: 14px; }
.pagination .page-numbers {
  display: inline-block; padding: 8px 14px; border: 1px solid var(--rule);
  border-radius: 3px; color: var(--ink-soft); font-weight: 600;
}
.pagination .page-numbers.current { background: var(--ink); border-color: var(--ink); color: #fff; }
.pagination .page-numbers:hover { border-color: var(--teal); color: var(--teal-dark); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 64px; background: var(--footer-bg); color: #c9d4e0; }
.site-footer .wrap { padding-top: 44px; padding-bottom: 36px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer-brand .site-title { color: #fff; font-size: 30px; }
.footer-brand .site-title .md { color: #5fc4c6; }
.footer-brand p { font-size: 14px; max-width: 340px; line-height: 1.6; }
.footer-brand svg.owl { width: 40px; height: 44px; margin-bottom: 10px; }
.footer-col h4 { font-family: var(--sans); color: #fff; font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 9px; font-size: 14px; }
.footer-col a:hover { color: #5fc4c6; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 34px; padding-top: 18px; font-size: 12.5px; color: #8fa0b3; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---------- 404 / no results ---------- */
.big-empty { text-align: center; padding: 90px 24px; }
.big-empty h1 { font-size: 44px; }
.big-empty p { color: var(--ink-soft); font-family: var(--serif); font-size: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .lead-grid { grid-template-columns: 1fr; }
  .latest-rail { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 20px; }
  .card-grid, .card-grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .band-list { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .site-title { font-size: 34px; }
  .masthead .brand-lockup { height: 46px; }
  .lead-story h3 { font-size: 29px; }
  .article-title { font-size: 31px; }
  .single-layout { grid-template-columns: 1fr; }
  .single-rail { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 20px; }
}
@media (max-width: 640px) {
  .card-grid, .card-grid.cols-3 { grid-template-columns: 1fr; }
  .river-item { flex-direction: column; gap: 14px; }
  .river-item .thumb { flex: none; }
  .site-nav .wrap { display: flex; flex-wrap: wrap; justify-content: flex-start; }
  .nav-toggle { display: block; margin: 8px 0; }
  .site-nav ul { display: none; width: 100%; flex-direction: column; border-top: 1px solid var(--rule); }
  .site-nav.open ul { display: flex; }
  .nav-search { display: none; }
  .topbar .tagline { display: none; }
}
