/* HealthTV — modern OTT/YouTube-style theme */
:root{
  --bg:#ffffff; --surface:#f6f7fb; --surface-2:#eef0f6;
  --text:#0b0f17; --muted:#5b6473; --border:#e6e8ef;
  --primary:#13a36f;  /* medical green */
  --primary-2:#2563eb; /* clinical blue */
  --danger:#e5484d; --live:#ff2d55;
  --radius:8px; --radius-lg:8px;
  --shadow:0 14px 40px rgba(15,23,42,.1);
  --header-h:64px;
  --maxw:1400px;
}
[data-theme="dark"]{
  --bg:#0b0f17; --surface:#121826; --surface-2:#1a2233;
  --text:#eef2f7; --muted:#9aa3b2; --border:#1f2a3d;
  --shadow:0 6px 24px rgba(0,0,0,.45);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,Helvetica,Arial,sans-serif;
  font-size:15px; line-height:1.5; -webkit-font-smoothing:antialiased;
  padding-bottom:60px;
}
a{color:inherit;text-decoration:none}
img{max-width:100%;height:auto;display:block}
.htv-skip{position:absolute;left:-9999px}.htv-skip:focus{left:1rem;top:1rem;background:var(--primary);color:#fff;padding:.5rem 1rem;border-radius:8px;z-index:100}

/* Header */
.htv-header{position:sticky;top:0;z-index:50;background:color-mix(in oklab,var(--bg) 90%,transparent);backdrop-filter:saturate(180%) blur(14px);border-bottom:1px solid var(--border)}
.htv-header__inner{max-width:var(--maxw);margin:0 auto;height:var(--header-h);display:flex;align-items:center;gap:14px;padding:0 16px}
.htv-iconbtn{background:transparent;border:0;color:var(--text);font-size:20px;width:40px;height:40px;border-radius:50%;cursor:pointer}
.htv-iconbtn:hover{background:var(--surface-2)}
.htv-brand{display:flex;align-items:center;gap:10px;font-weight:800;font-size:20px}
.htv-brand__mark{display:inline-grid;place-items:center;width:32px;height:32px;background:linear-gradient(135deg,var(--primary),var(--primary-2));color:#fff;border-radius:8px;font-size:14px}
.htv-brand__name strong{color:var(--primary)}
.htv-search{flex:1;max-width:560px;margin:0 auto;display:flex;background:var(--surface);border:1px solid var(--border);border-radius:999px;overflow:hidden;box-shadow:inset 0 1px 0 rgba(255,255,255,.04)}
.htv-search input{flex:1;background:transparent;border:0;padding:10px 16px;color:var(--text);outline:none}
.htv-search button{background:var(--surface-2);border:0;padding:0 18px;cursor:pointer;color:var(--text)}
.htv-nav ul{list-style:none;margin:0;padding:0;display:flex;gap:6px}
.htv-nav a{padding:8px 12px;border-radius:8px;font-weight:500}
.htv-nav a:hover{background:var(--surface-2)}
.htv-header__actions{display:flex;align-items:center;gap:6px}
.htv-livebtn{background:var(--live);color:#fff;padding:8px 14px;border-radius:999px;font-weight:700;font-size:13px;display:inline-flex;align-items:center;gap:6px}
@media (max-width:900px){ .htv-nav,.htv-menu-toggle{display:none} .htv-search{max-width:none} }
@media (max-width:640px){ .htv-livebtn span{display:none} }

/* Hero */
.htv-hero{background:#0b0f17 center/cover no-repeat;color:#fff;border-bottom:1px solid var(--border);min-height:440px;display:flex;align-items:flex-end}
.htv-hero__inner{width:100%;max-width:var(--maxw);margin:0 auto;padding:96px 20px 64px}
.htv-hero__eyebrow{display:inline-block;background:var(--primary);color:#fff;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}
.htv-hero__title{font-size:clamp(32px,4vw,56px);margin:14px 0 10px;line-height:1.04;font-weight:850;max-width:860px}
.htv-hero__sub{color:#cbd5e1;max-width:640px;margin:0 0 20px}
.htv-hero__cta{display:flex;gap:10px;flex-wrap:wrap}
.htv-btn{display:inline-flex;align-items:center;gap:8px;padding:12px 20px;border-radius:999px;font-weight:700;border:0;cursor:pointer;font-size:14px}
.htv-btn--primary{background:#fff;color:#0b0f17;box-shadow:0 10px 30px rgba(0,0,0,.18)}
.htv-btn--ghost{background:rgba(255,255,255,.12);color:#fff;backdrop-filter:blur(6px);border:1px solid rgba(255,255,255,.18)}

/* Container & layouts */
.htv-container{max-width:var(--maxw);margin:0 auto;padding:24px 16px}
.htv-grid-with-sidebar{display:grid;grid-template-columns:1fr 320px;gap:28px}
@media (max-width:1024px){ .htv-grid-with-sidebar{grid-template-columns:1fr} }

/* Categories chips */
.htv-cats{margin:0 0 18px}
.htv-cats__track{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding-bottom:4px}
.htv-cats__track::-webkit-scrollbar{display:none}
.htv-chip{flex:none;background:var(--surface);border:1px solid var(--border);padding:8px 14px;border-radius:999px;font-weight:600;font-size:13px;white-space:nowrap}
.htv-chip:hover{background:var(--surface-2)}
.htv-chip--active{background:var(--text);color:var(--bg);border-color:var(--text)}

/* Rows */
.htv-row{margin:34px 0}
.htv-row__head{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:12px}
.htv-row__title{font-size:21px;margin:0;font-weight:850}
.htv-row__more{color:var(--primary);font-weight:600;font-size:13px}
.htv-row__scroll{position:relative}
.htv-row__track{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(272px,1fr);gap:18px;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;padding-bottom:8px}
.htv-row__track::-webkit-scrollbar{display:none}
.htv-row__track > *{scroll-snap-align:start}
.htv-row__nav{position:absolute;top:50%;transform:translateY(-50%);width:40px;height:40px;border-radius:50%;border:0;background:rgba(0,0,0,.55);color:#fff;font-size:22px;cursor:pointer;z-index:2;display:none}
.htv-row__nav--prev{left:-6px} .htv-row__nav--next{right:-6px}
@media (hover:hover){ .htv-row:hover .htv-row__nav{display:block} }

/* Card grid */
.htv-cardgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:18px}

/* Card */
.htv-card{display:block;border-radius:var(--radius-lg);overflow:hidden;background:transparent;color:inherit;transition:transform .25s ease}
.htv-card:hover{transform:translateY(-3px)}
.htv-card__thumb{position:relative;aspect-ratio:16/9;background:var(--surface-2);border-radius:var(--radius-lg);overflow:hidden}
.htv-card__thumb::before{content:"";position:absolute;inset:0;background:linear-gradient(135deg,color-mix(in oklab,var(--primary) 18%,transparent),color-mix(in oklab,var(--primary-2) 18%,transparent));z-index:0}
.htv-card__thumb img{width:100%;height:100%;object-fit:cover;transition:transform .4s ease}
.htv-card__thumb img{position:relative;z-index:1}
.htv-card:hover .htv-card__thumb img{transform:scale(1.05)}
.htv-card__play{position:absolute;inset:auto auto 12px 12px;width:42px;height:42px;background:rgba(0,0,0,.65);color:#fff;border-radius:50%;display:grid;place-items:center;opacity:0;transition:opacity .2s;z-index:2}
.htv-card:hover .htv-card__play{opacity:1}
.htv-badge{position:absolute;bottom:8px;right:8px;background:rgba(0,0,0,.8);color:#fff;font-size:12px;font-weight:700;padding:3px 8px;border-radius:6px;z-index:2}
.htv-badge--live{background:var(--live);left:8px;right:auto}
.htv-badge--category{top:8px;bottom:auto;left:8px;right:auto;background:rgba(11,15,23,.74);backdrop-filter:blur(8px)}
.htv-card__body{padding:10px 4px}
.htv-card__title{font-size:15px;font-weight:760;margin:0 0 6px;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.htv-card__meta{color:var(--muted);font-size:13px;display:flex;gap:8px;flex-wrap:wrap}
.htv-card__excerpt{color:var(--muted);font-size:13px;margin:6px 0 0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

.htv-card--mini{display:grid;grid-template-columns:160px 1fr;gap:10px;margin-bottom:12px}
.htv-card--mini .htv-card__thumb{border-radius:10px}
.htv-card--mini .htv-card__title{font-size:14px}

.htv-card--short .htv-card__thumb{aspect-ratio:9/16}

/* Watch page */
.htv-watch__grid{display:grid;grid-template-columns:1fr 360px;gap:24px}
@media (max-width:1024px){ .htv-watch__grid{grid-template-columns:1fr} }
.htv-player{position:relative;background:#000;border-radius:var(--radius-lg);overflow:hidden;aspect-ratio:16/9}
.htv-player iframe,.htv-player video{position:absolute;inset:0;width:100%;height:100%;border:0}
.htv-watch__title{font-size:24px;margin:14px 0 6px;font-weight:800}
.htv-watch__meta{color:var(--muted);display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.htv-watch__chips{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0}
.htv-presenter{display:flex;align-items:center;gap:12px;background:var(--surface);padding:14px;border-radius:var(--radius);margin:14px 0;border:1px solid var(--border)}
.htv-presenter__avatar{width:48px;height:48px;border-radius:50%;background:var(--primary);color:#fff;display:grid;place-items:center;font-weight:800;font-size:18px}
.htv-presenter__name{font-weight:700}
.htv-presenter__sub{color:var(--muted);font-size:13px}
.htv-watch__desc{background:var(--surface);padding:16px;border-radius:var(--radius);border:1px solid var(--border);margin:14px 0}
.htv-watch__sidetitle{font-size:16px;margin:0 0 10px;font-weight:800}

/* Article / page */
.htv-article{max-width:780px}
.htv-article__title{font-size:32px;font-weight:800;margin:8px 0}
.htv-article__cover{margin:14px 0;border-radius:var(--radius-lg);overflow:hidden}
.htv-article__content{font-size:16px;line-height:1.7}
.htv-article__content p{margin:0 0 1em}

/* Sidebar widgets */
.htv-sidebar{display:flex;flex-direction:column;gap:18px}
.htv-widget{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:14px}
.htv-widget__title{margin:0 0 10px;font-size:14px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}

/* Breadcrumbs */
.htv-crumbs{font-size:13px;color:var(--muted);margin-bottom:14px}
.htv-crumbs ol{list-style:none;display:flex;flex-wrap:wrap;gap:6px;margin:0;padding:0}
.htv-crumbs li+li::before{content:"›";margin-right:6px;color:var(--muted)}
.htv-crumbs a:hover{color:var(--primary)}

/* Pagination */
.htv-pagination{margin:24px 0;display:flex;justify-content:center}
.htv-pagination .page-numbers{padding:8px 12px;border-radius:8px;background:var(--surface);margin:0 4px}
.htv-pagination .current{background:var(--primary);color:#fff}

/* Footer */
.htv-footer{background:var(--surface);border-top:1px solid var(--border);margin-top:60px;padding:40px 16px 28px}
.htv-footer__cols{max-width:var(--maxw);margin:0 auto;display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:30px}
@media (max-width:768px){ .htv-footer__cols{grid-template-columns:1fr} }
.htv-footer__brand strong{font-size:22px}
.htv-footer__brand strong span{color:var(--primary)}
.htv-social{display:flex;gap:10px;margin-top:10px;flex-wrap:wrap}
.htv-social a{background:var(--surface-2);padding:6px 12px;border-radius:999px;font-size:13px}
.htv-footer__menu ul{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px}
.htv-footer__bottom{max-width:var(--maxw);margin:24px auto 0;color:var(--muted);font-size:13px;text-align:center;border-top:1px solid var(--border);padding-top:18px}

/* Mobile bottom nav */
.htv-bottomnav{position:fixed;bottom:0;left:0;right:0;background:color-mix(in oklab,var(--bg) 92%,transparent);backdrop-filter:blur(12px);border-top:1px solid var(--border);display:none;justify-content:space-around;padding:8px 0;z-index:40}
.htv-bottomnav a{display:flex;flex-direction:column;align-items:center;gap:2px;font-size:11px;color:var(--muted);padding:4px 8px}
.htv-bottomnav a span{font-size:18px;color:var(--text)}
@media (max-width:768px){ .htv-bottomnav{display:flex} body{padding-bottom:70px} }

/* Ads */
.htv-ad{margin:14px 0;text-align:center}

/* Archive head */
.htv-archive__head{margin:8px 0 18px}
.htv-archive__head h1{font-size:28px;margin:0;font-weight:800}
.htv-archive__desc{color:var(--muted);margin:6px 0 0}

/* Posts (default) */
.htv-post h2{font-size:18px;margin:10px 0 4px}
.htv-post__meta{color:var(--muted);font-size:13px}
.htv-post img{border-radius:var(--radius)}

/* Page title */
.htv-page-title{font-size:28px;font-weight:800;margin:0 0 18px}

/* Reduced motion */
@media (prefers-reduced-motion:reduce){
  *{animation:none!important;transition:none!important}
}
