/* ============================================================
 * Haridwar News — UI library  (assets/css/hn-lib.css)
 * Linked in <head> by app/views/{desktop,mobile}/layout_head.php, after
 * desktop|mobile.min.css and v2.css. Nothing on the site prints <style> or
 * style="" in <body>; what used to be inline lives here instead.
 *   1. Base
 *   2. Utilities (u-*)          — one declaration each, !important like the
 *                                  inline styles they replaced
 *   3. Avatars, social grid
 *   4. Ad slots (app/ads.php, assets/js/pt-ads.js)
 *   5. Home page skeleton (app/views/{desktop,mobile}/home_shell.php)
 * Category colours (.acb-* / .acf-*) are generated per site into
 * uploads/cache/accents-*.css by hn_accent_css_url().
 * ============================================================ */

/* ── 1. Base ─────────────────────────────────────────────── */
:root{color-scheme:light only}

/* ── 2. Utilities ────────────────────────────────────────── */
.u-bg-e7f2f3{background:#e7f2f3 !important}
.u-c-a8a29e{color:#a8a29e !important}
.u-clip-tab{clip-path:polygon(0 0,100% 0,90% 100%,0 100%) !important}
.u-fs-13px{font-size:13px !important}
.u-fw-500{font-weight:500 !important}
.u-gc-all{grid-column:1/-1 !important}
.u-m-10px-0-6px{margin:10px 0 6px !important}
.u-m-8px-0{margin:8px 0 !important}
.u-mt-10px{margin-top:10px !important}
.u-mt-14px{margin-top:14px !important}
.u-ov-hidden{overflow:hidden !important}
.u-p-0{padding:0 !important}
.u-pb-10px{padding-bottom:10px !important}
.u-pr-22px{padding-right:22px !important}
.u-pt-10px{padding-top:10px !important}
.u-wm-vertical-rl{writing-mode:vertical-rl !important}

/* ── 3. Avatars, social grid ─────────────────────────────── */
.hn-av-img{display:block;width:100%;height:100%;border-radius:9999px;object-fit:cover}
.u-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.u-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.u-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.u-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.u-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.u-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.u-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.u-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}

/* ── 4. Ad slots ─────────────────────────────────────────── */
/* Reserved size of an empty slot (app/ads.php → pt_ad). min-height stays a normal
   declaration so .pt-ad:empty / .is-filled can still release it, as before. */
.pt-ad.ad-mi{margin-inline:auto}
.pt-ad.ad-mw-160{max-width:160px}.pt-ad.ad-mw-300{max-width:300px}.pt-ad.ad-mw-320{max-width:320px}.pt-ad.ad-mw-360{max-width:360px}.pt-ad.ad-mw-468{max-width:468px}.pt-ad.ad-mw-640{max-width:640px}.pt-ad.ad-mw-728{max-width:728px}.pt-ad.ad-mw-970{max-width:970px}
.ad-mh-30{min-height:30px}.ad-mh-50{min-height:50px}.ad-mh-60{min-height:60px}.ad-mh-90{min-height:90px}.ad-mh-100{min-height:100px}.ad-mh-120{min-height:120px}.ad-mh-150{min-height:150px}.ad-mh-180{min-height:180px}.ad-mh-203{min-height:203px}.ad-mh-225{min-height:225px}.ad-mh-240{min-height:240px}.ad-mh-250{min-height:250px}
.pt-ad.is-filled{min-height:0}
/* Creative markup written by pt-ads.js:
     a.pt-ad-link > span.pt-ad-media (img + optional tag pill)
                  > span.pt-ad-foot  (span.pt-ad-txt [head, body] + span.pt-ad-cta)
   Inside .ad the slot is already a bordered, rounded, overflow-hidden card, so the
   image runs edge to edge and the footer carries the padding. Native slots
   (.ad-native frame, no .ad) get a rounded image and a lighter footer. */
.pt-ad-link{display:flex;flex-direction:column;text-decoration:none;color:inherit;-webkit-tap-highlight-color:transparent}
.pt-ad-media{position:relative;display:block;line-height:0;background:#f4efe6}
.pt-ad-img{display:block;width:100%;height:auto;transition:transform .35s ease}
.pt-ad-link:hover .pt-ad-img{transform:scale(1.015)}
.pt-ad:not(.ad) .pt-ad-media{border-radius:10px;overflow:hidden}
/* "विज्ञापन / Advertisement" — only on slots the page did not already label */
.pt-ad-tag{display:inline-block;align-self:flex-start;font-size:11px;line-height:1;font-weight:700;letter-spacing:.04em;
  color:#57534e;background:#f1ebe0;border-radius:999px;padding:4px 9px}
.pt-ad-media .pt-ad-tag{position:absolute;top:8px;left:8px;color:#fff;background:rgba(17,24,39,.62);
  -webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}
html[lang="hi"] .pt-ad-tag{letter-spacing:0}

.pt-ad-foot{display:flex;flex-direction:column;gap:12px;padding:14px 16px 16px;border-top:1px solid #efe8dc}
.pt-ad:not(.ad) .pt-ad-foot{padding:12px 2px 2px;border-top:0}
.pt-ad-txt{display:flex;flex-direction:column;gap:4px;min-width:0}
.pt-ad-head{font-weight:700;font-size:16px;line-height:1.4;color:#1c1917;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.pt-ad-body{font-size:13.5px;line-height:1.5;color:#6b7280;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* The button */
.pt-ad-cta{display:inline-flex;align-items:center;justify-content:center;gap:8px;align-self:flex-start;
  min-height:42px;padding:10px 20px;border-radius:999px;background:#0b5563;color:#fff;
  font-size:14px;font-weight:700;line-height:1.2;letter-spacing:.01em;white-space:nowrap;
  box-shadow:0 1px 2px rgba(11,85,99,.25);transition:background-color .2s ease,box-shadow .2s ease,transform .2s ease}
.pt-ad-cta.is-wa{background:#1fa855;box-shadow:0 1px 2px rgba(31,168,85,.3)}
.pt-ad-cta .fa-whatsapp{font-size:17px}
.pt-ad-arrow{font-size:12px;transition:transform .2s ease}
.pt-ad-link:hover .pt-ad-cta{background:#083f49;box-shadow:0 4px 12px rgba(11,85,99,.28)}
.pt-ad-link:hover .pt-ad-cta.is-wa{background:#178a45;box-shadow:0 4px 12px rgba(31,168,85,.3)}
.pt-ad-link:hover .pt-ad-arrow{transform:translateX(3px)}
.pt-ad-link:active .pt-ad-cta{transform:scale(.98)}
.pt-ad-link:focus-visible{outline:2px solid #d2690a;outline-offset:3px;border-radius:12px}

/* Narrow formats (sidebar tile, in-feed, skyscraper) and all phones: full-width button */
.pt-ad-link.is-narrow .pt-ad-cta{align-self:stretch}
.pt-ad-link.is-narrow .pt-ad-head{font-size:15.5px}
@media (max-width:640px){
  .pt-ad-foot{padding:12px 14px 14px;gap:10px}
  .pt-ad-cta{align-self:stretch;min-height:44px;font-size:14.5px}
  .pt-ad-head{font-size:15.5px}
}

/* Wide banners (billboard, leaderboard, pre-footer, anchor): one compact row */
.pt-ad-link.is-banner .pt-ad-foot{flex-direction:row;align-items:center;justify-content:space-between;gap:14px;padding:10px 14px}
.pt-ad-link.is-banner .pt-ad-head{font-size:14.5px;-webkit-line-clamp:1}
.pt-ad-link.is-banner .pt-ad-cta{align-self:center;flex-shrink:0;min-height:36px;padding:8px 16px;font-size:13px}
[data-anchor] .pt-ad-link.is-banner .pt-ad-foot{border-top:0;padding:6px 4px}
[data-anchor] .pt-ad-link.is-banner .pt-ad-head{color:#fff}
[data-anchor] .pt-ad-media{background:transparent}

/* Dark mode */
.dark .pt-ad-media{background:#111}
.dark .pt-ad-foot{border-top-color:#262626}
.dark .pt-ad-head{color:#f5f5f4}
.dark .pt-ad-body{color:#a8a29e}
.dark .pt-ad-tag{color:#d6d3d1;background:#262626}
.dark .pt-ad-media .pt-ad-tag{color:#fff;background:rgba(0,0,0,.6)}
@media (prefers-reduced-motion:reduce){.pt-ad-img,.pt-ad-cta,.pt-ad-arrow{transition:none}.pt-ad-link:hover .pt-ad-img{transform:none}}

/* ── 5. Home page skeleton ───────────────────────────────── */
/* Placeholders shown by home_shell.php until /api/home arrives (assets/js/home.js).
   Sizes follow the real sections, so swapping the stories in barely moves the page. */
.sk{display:block;border-radius:4px;background-color:#ece5d9;
  background-image:linear-gradient(90deg,rgba(255,253,248,0) 0,rgba(255,253,248,.75) 50%,rgba(255,253,248,0) 100%);
  background-size:220% 100%;background-repeat:no-repeat;animation:hs-shine 1.4s ease-in-out infinite}
@keyframes hs-shine{from{background-position:130% 0}to{background-position:-30% 0}}
@media (prefers-reduced-motion:reduce){.sk{animation:none}}
.hs-flex{display:flex;align-items:center;gap:16px}
.hs-ticker{background:#e7f2f3;padding:12px 0;border-bottom:1px solid rgb(231 224 211)}
.hs-tag{width:64px;height:22px;flex-shrink:0;border-radius:2px}
.hs-tag-w{width:120px;height:26px}
.hs-title{width:220px;height:28px}
.hs-title-m{width:150px;height:22px}
.hs-img{width:100%;aspect-ratio:16/10;border-radius:0}
.hs-r43{aspect-ratio:4/3}
.hs-r0{border-radius:0}
.hs-line{height:12px;margin-top:10px}
.hs-h2{height:30px;margin-top:14px}
.hs-h3{height:17px;margin-top:10px}
.hs-m0{margin-top:0}
.hs-mt16{margin-top:16px}
.hs-w30{width:30%}.hs-w40{width:40%}.hs-w60{width:60%}.hs-w70{width:70%}.hs-w80{width:80%}.hs-w90{width:90%}
.hs-hero{display:grid;gap:28px;padding:28px 0;align-items:start}
.hs-hero-side{display:grid;gap:24px 20px}
@media (min-width:640px){.hs-hero-side{grid-template-columns:1fr 1fr}}
@media (min-width:1024px){.hs-hero{grid-template-columns:1fr 1fr}}
.hs-sec{padding:24px 0}
.hs-head{display:flex;align-items:flex-end;gap:12px;padding-bottom:10px;margin-bottom:4px;border-bottom:2px solid #102026}
.hs-tabs{display:flex;gap:28px;padding:14px 0;border-bottom:1px solid rgb(231 224 211);overflow:hidden}
.hs-tab{width:72px;height:16px;flex-shrink:0}
.hs-list{display:grid;column-gap:24px}
@media (min-width:768px){.hs-list{grid-template-columns:1fr 1fr}}
.hs-rowc{display:flex;gap:16px;padding:16px 0;border-bottom:1px solid rgb(231 224 211)}
.hs-rowc>div{flex:1;min-width:0}
.hs-thumb{width:150px;aspect-ratio:4/3;flex-shrink:0;border-radius:8px}
.hs-nojs{padding:40px 0;text-align:center;font-weight:700}
.hs-nojs a{color:#0b5563;text-decoration:underline}
/* mobile */
.hs-pad{padding-left:16px;padding-right:16px}
.hs-msec{padding-top:20px}
.hs-mhead{margin-bottom:12px;padding-bottom:8px}
.hs-rail{display:flex;gap:12px;overflow:hidden;padding:0 16px}
.hs-card{width:236px;flex-shrink:0}
.hs-chip{width:92px;height:36px;flex-shrink:0;border-radius:9999px}
.hs-rowc-m{gap:12px;padding:14px 0}
.hs-rowc-m .hs-thumb{width:96px;border-radius:0}
/* sections fade in when they arrive */
[data-home-root].is-loaded>*{animation:hs-in .25s ease-out}
@keyframes hs-in{from{opacity:.4}to{opacity:1}}
@media (prefers-reduced-motion:reduce){[data-home-root].is-loaded>*{animation:none}}

/* ── 6. In-article embeds (YouTube / X / Instagram / Facebook) ─────────────
   Ported from The Credible News. The container is rendered by app/embeds.php
   and upgraded by assets/js/pt-embeds.js. These rules make it behave on
   mobile even before the JS/SDK arrives. */
.pt-article .pt-embed{margin:1.6rem 0;max-width:100%;overflow:hidden}
.pt-article .pt-embed iframe{max-width:100%;border:0}

/* YouTube: hold a 16:9 box so the page never reflows as Plyr initialises */
.pt-article .pt-embed-youtube{border-radius:12px;background:#000}
.pt-article .pt-embed-youtube .plyr__video-embed,
.pt-article .pt-embed-youtube .plyr{border-radius:12px;overflow:hidden}
.pt-article .pt-embed-youtube .pt-embed-frame{position:relative;width:100%;aspect-ratio:16/9;background:#000}
.pt-article .pt-embed-youtube .pt-embed-frame > iframe{position:absolute;inset:0;width:100%;height:100%}
/* Once Plyr takes over it manages its own ratio box — drop ours so the
   controls are not clipped by the absolutely-positioned iframe. */
.pt-article .pt-embed-youtube .plyr .pt-embed-frame,
.pt-article .pt-embed-youtube .plyr__video-wrapper .pt-embed-frame{position:static;aspect-ratio:auto}
.pt-article .pt-embed-youtube .plyr__video-wrapper > iframe{position:absolute}
.pt-article .pt-embed-youtube noscript a{display:block;padding:10px;text-align:center;color:#fff;font-size:13px}

/* Social embeds: centre them and cap the width on desktop */
.pt-article .pt-embed-twitter,
.pt-article .pt-embed-instagram,
.pt-article .pt-embed-facebook{display:flex;justify-content:center}
.pt-article .pt-fb-frame{max-width:100%;overflow:hidden;border-radius:8px}
.pt-article .pt-fb-frame iframe{display:block;max-width:100%}
.pt-article .pt-embed-twitter .twitter-tweet,
.pt-article .pt-embed-instagram .instagram-media{margin:0 auto!important;max-width:100%!important}
.pt-article .pt-embed-facebook .fb-post,
.pt-article .pt-embed-facebook .fb-video{max-width:100%}
.pt-article .pt-embed-facebook span,
.pt-article .pt-embed-facebook iframe{max-width:100%!important}

/* Un-upgraded fallback: a bare blockquote should still read as a link card
   (not the article's orange pull-quote style) */
.pt-article .pt-embed-twitter .twitter-tweet:not(.twitter-tweet-rendered),
.pt-article .pt-embed-instagram .instagram-media:not([data-instgrm-rendered]){
  border:1px solid #e6e2dc;border-radius:12px;padding:14px 16px;font-size:14px;word-break:break-all;
  background:#fff;font-style:normal;font-family:inherit;color:inherit
}
.pt-article .pt-embed > a{word-break:break-all}
/* Instagram would not embed the post: a plain card linking to it (pt-embeds.js) */
.pt-article .pt-embed-instagram.is-failed{display:block}
.pt-article .pt-embed-card{display:flex;align-items:center;gap:12px;max-width:540px;margin:0 auto;padding:14px 16px;
  border:1px solid #e6e2dc;border-radius:12px;background:#fff;color:#102026;font-weight:600;text-decoration:none}
.pt-article .pt-embed-card:hover{border-color:#d6cfc6;text-decoration:underline}
.pt-article .pt-embed-card-ico{flex:none;width:34px;height:34px;border-radius:9px;
  background:radial-gradient(circle at 30% 107%,#fdf497 0%,#fd5949 45%,#d6249f 60%,#285aeb 90%)}

/* ---- Bottom tabs: "new" dot on the Card tab until it is opened once (site.js) ---- */
.pt-tab-new{position:absolute;top:2px;right:-7px;width:8px;height:8px;border-radius:9999px;background:#d2690a;
  box-shadow:0 0 0 2px #fffdf8;animation:hnTabPulse 1.8s ease-out infinite}
.pt-tab-new[hidden]{display:none}
@keyframes hnTabPulse{0%{box-shadow:0 0 0 2px #fffdf8,0 0 0 2px rgba(210,105,10,.55)}100%{box-shadow:0 0 0 2px #fffdf8,0 0 0 9px rgba(210,105,10,0)}}
@media (prefers-reduced-motion:reduce){.pt-tab-new{animation:none}}
