/*
Theme Name: Khabar Tez
Theme URI: https://example.com/khabar-tez
Author: Custom Build
Author URI: https://example.com
Description: Ek tez-raftaar Hindi/English news portal theme — NDTV jaisi layout (breaking ticker, category grid, big hero story) ke saath, Google Discover ke liye optimized (large featured images, NewsArticle schema, OG/Twitter cards).
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: khabar-tez
Tags: news, blog, grid-layout, custom-logo, custom-menu, featured-images, translation-ready
*/

/* =========================================================
   TOKENS
   ========================================================= */
:root{
  --ink:        #17181c;   /* headlines */
  --body-text:  #3a3d44;   /* paragraph text */
  --paper:      #faf9f6;   /* page background */
  --card:       #ffffff;   /* card background */
  --line:       #e7e5df;   /* hairline borders */
  --red:        #d1262c;   /* breaking / brand accent */
  --red-dark:   #a11a1f;
  --navy:       #101826;   /* header / footer dark */
  --navy-2:     #1b2740;
  --amber:      #e8960c;   /* live / category accent */
  --muted:      #868990;

  --font-display: 'Hind', 'Noto Sans Devanagari', system-ui, sans-serif;
  --font-body:    'Noto Sans Devanagari', 'Hind', system-ui, sans-serif;
  --font-utility: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; /* no extra font request = faster */

  --radius: 3px;
  --wrap: 1180px;
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;width:100%;overflow-x:hidden;}
body{
  margin:0;
  width:100%;
  background:var(--paper);
  color:var(--body-text);
  font-family:var(--font-body);
  font-size:16px;
  line-height:1.65;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
img{max-width:100%;height:auto;display:block;}
a{color:inherit;text-decoration:none;}
header,nav,main{margin:0;padding:0;}
a:hover{color:var(--red);}
ul{list-style:none;margin:0;padding:0;}
h1,h2,h3,h4{font-family:var(--font-display);color:var(--ink);line-height:1.25;margin:0 0 .4em;}
:focus-visible{outline:3px solid var(--amber);outline-offset:2px;}
.container{max-width:var(--wrap);margin:0 auto;padding:0 20px;}
.screen-reader-text{position:absolute;left:-9999px;}

/* =========================================================
   MASTHEAD — single colored bar: hamburger | logo | search
   ========================================================= */
.masthead{background:var(--navy);box-shadow:0 2px 8px rgba(0,0,0,.15);position:relative;z-index:60;}
.masthead-bar{display:flex;align-items:center;justify-content:space-between;padding:14px 20px;gap:12px;}
.site-branding{flex:1;text-align:center;}
.site-branding .custom-logo{max-height:44px;width:auto;margin:0 auto;}
.site-branding .site-title{font-family:var(--font-display);font-size:24px;font-weight:800;letter-spacing:-.5px;color:#fff;margin:0;}
.site-branding .site-title a{color:#fff;}
.menu-toggle,.search-toggle{
  flex:0 0 auto;background:none;border:0;color:#fff;font-size:22px;
  padding:6px 8px;cursor:pointer;line-height:1;
}
.menu-toggle:hover,.search-toggle:hover{color:var(--amber);}

/* =========================================================
   SEARCH PANEL — toggled open by the search icon
   ========================================================= */
.search-panel{background:var(--navy-2);}
.search-panel[hidden]{display:none;}
.search-panel .container{padding:14px 20px;}
.header-search{display:flex;align-items:center;background:#fff;border-radius:20px;padding:8px 16px;max-width:420px;margin:0 auto;}
.header-search input{border:0;background:transparent;font-family:var(--font-utility);font-size:14px;width:100%;outline:0;color:var(--ink);}
.header-search button{background:none;border:0;cursor:pointer;color:var(--muted);flex:0 0 auto;}

/* =========================================================
   PRIMARY NAV — opens as a dropdown below the header bar
   ========================================================= */
.primary-nav{background:var(--navy-2);position:relative;}
.primary-nav .container{display:flex;padding:0;}
.primary-menu{display:none;flex-direction:column;width:100%;position:absolute;top:0;left:0;z-index:50;box-shadow:0 8px 16px rgba(0,0,0,.18);}
.primary-menu.open{display:flex;background:var(--navy-2);}
.primary-menu li a{
  display:block;padding:12px 16px;color:#e7e9f0;font-family:var(--font-utility);
  font-size:13.5px;font-weight:600;letter-spacing:.02em;border-top:1px solid rgba(255,255,255,.08);
}
.primary-menu li a:hover,.primary-menu li.current-menu-item a{background:var(--red);color:#fff;}
/* =========================================================
   HERO GRID (front page top)
   ========================================================= */
.hero-grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:20px;padding:24px 0;}
.hero-lead{border-radius:var(--radius);overflow:hidden;background:var(--card);}
.hero-lead img{width:100%;height:380px;object-fit:cover;border-radius:var(--radius);}
.hero-lead-body{padding:16px 0 0;}
.hero-lead h2{color:var(--ink);font-size:clamp(20px,3.2vw,28px);margin-bottom:8px;}
.hero-lead h2 a{color:var(--ink);}
.hero-lead .excerpt{font-size:15px;line-height:1.6;color:var(--body-text);margin:0 0 10px;}
.hero-lead .meta{color:var(--muted);font-family:var(--font-utility);font-size:13px;}

.hero-side{display:flex;flex-direction:column;gap:14px;}
.hero-side .side-story{display:flex;gap:12px;padding-bottom:14px;border-bottom:1px solid var(--line);}
.hero-side .side-story:last-child{border-bottom:0;padding-bottom:0;}
.hero-side .side-story img{width:110px;height:78px;object-fit:cover;border-radius:var(--radius);flex:0 0 auto;}
.hero-side .side-story h3{font-size:15px;margin-bottom:4px;}
.hero-side .side-story .meta{font-family:var(--font-utility);font-size:11px;color:var(--muted);}

/* shared "Month Day, Year — Category" meta style used across hero/cards/rows */
.cat-text{color:var(--red);font-weight:700;}
a.cat-text:hover{color:var(--red-dark);}

/* =========================================================
   SECTION HEADERS
   ========================================================= */
.section-head{display:flex;align-items:center;justify-content:space-between;border-bottom:3px solid var(--ink);margin:34px 0 16px;padding-bottom:8px;}
.section-head h2{font-size:20px;margin:0;position:relative;padding-left:12px;border-left:5px solid var(--red);}
.section-head a.more{font-family:var(--font-utility);font-size:12.5px;font-weight:700;color:var(--red);}

/* =========================================================
   CONTENT LAYOUT (page/archive with sidebar)
   ========================================================= */
.content-layout{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:34px;align-items:start;padding-top:24px;padding-bottom:40px;}
.content-layout > *{min-width:0;}
.single .content-layout,.page .content-layout{padding-top:32px;}

/* card grid */
.post-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;}
.post-grid > *{min-width:0;}
.post-card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;}
.post-card .thumb{aspect-ratio:16/10;overflow:hidden;background:var(--line);}
.post-card .thumb img{width:100%;height:100%;object-fit:cover;transition:transform .35s ease;}
.post-card:hover .thumb img{transform:scale(1.05);}
.post-card .body{padding:14px;}
.post-card h3{font-size:16.5px;margin:0 0 6px;}
.post-card .meta{font-family:var(--font-utility);font-size:11.5px;color:var(--muted);}

/* list row style (used in archive/index main col + home "नई खबरें") */
.post-row{display:flex;gap:16px;padding:18px 0;border-bottom:1px solid var(--line);}
.post-row .thumb{flex:0 0 220px;aspect-ratio:16/10;overflow:hidden;border-radius:var(--radius);background:var(--line);}
.post-row .thumb img{width:100%;height:100%;object-fit:cover;}
.post-row h2{font-size:20px;}
.post-row .excerpt{font-size:14.5px;color:var(--body-text);}
.post-row .meta{font-family:var(--font-utility);font-size:11.5px;color:var(--muted);margin-top:8px;}

.sidebar .widget{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:18px;margin-bottom:22px;box-shadow:0 2px 10px rgba(0,0,0,.04);}
.sidebar .widget-title{font-family:var(--font-utility);font-size:13px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;border-bottom:2px solid var(--red);padding-bottom:10px;margin:0 0 14px;color:var(--ink);}
.trending-list li{display:flex;gap:12px;align-items:center;padding:11px 6px;border-bottom:1px solid var(--line);border-radius:var(--radius);transition:background .15s ease;}
.trending-list li:hover{background:var(--paper);}
.trending-list li:last-child{border-bottom:0;}
.trending-list .rank{
  font-family:var(--font-display);font-size:13px;font-weight:800;color:var(--muted);
  flex:0 0 auto;line-height:1;width:26px;height:26px;border-radius:50%;
  background:var(--paper);border:1px solid var(--line);
  display:flex;align-items:center;justify-content:center;
}
.trending-list li:nth-child(-n+3) .rank{color:#fff;background:var(--red);border-color:var(--red);}
.trending-list a{font-size:14px;font-weight:600;color:var(--ink);line-height:1.4;}
.trending-list a:hover{color:var(--red);}
.tag-cloud a{display:inline-block;margin:0 6px 8px 0;padding:5px 12px;background:var(--paper);border:1px solid var(--line);border-radius:16px;font-family:var(--font-utility);font-size:12px;transition:background .15s ease,color .15s ease,border-color .15s ease;}
.tag-cloud a:hover{background:var(--red);color:#fff;border-color:var(--red);}

/* =========================================================
   SINGLE POST
   ========================================================= */
.single-post{width:100%;max-width:100%;}
.single-post .cat-pill{display:inline-block;background:var(--red);color:#fff;font-family:var(--font-utility);font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;padding:3px 10px;border-radius:2px;margin-bottom:12px;}
.single-post h1{font-size:clamp(22px,4vw,34px);margin-bottom:12px;}
.single-post .standfirst{font-family:var(--font-body);font-size:17px;line-height:1.6;color:var(--muted);margin:0 0 16px;font-weight:500;}
.single-post .byline{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 14px;}
.single-post .byline-text{min-width:0;}
.single-post .byline-line{margin:0 0 3px;font-family:var(--font-utility);font-size:13px;color:var(--body-text);}
.single-post .byline-line:last-child{margin-bottom:0;}
.single-post .byline-line strong{color:var(--ink);}
.single-post .byline-date{color:var(--muted);font-size:12.5px;}
.single-post .featured-media{margin-bottom:18px;}
.single-post .featured-media img{width:100%;border-radius:var(--radius);}
.single-post .featured-media figcaption{font-family:var(--font-utility);font-size:12px;color:var(--muted);padding-top:6px;}
.single-post .entry-content{font-size:17.5px;line-height:1.85;color:var(--body-text);}
.single-post .entry-content p{margin:0 0 1.3em;}
.single-post .entry-content h2{font-size:24px;margin-top:1.4em;}
.single-post .entry-content h3{font-size:19px;margin-top:1.2em;}
.single-post .entry-content blockquote{border-left:4px solid var(--red);margin:1.5em 0;padding:.4em 0 .4em 1.2em;font-style:italic;color:var(--ink);}
.single-post .entry-content img{border-radius:var(--radius);margin:1em 0;}
.tags-row{display:flex;flex-wrap:wrap;gap:8px;margin:20px 0;}
.tags-row a{font-family:var(--font-utility);font-size:12px;background:var(--paper);border:1px solid var(--line);border-radius:16px;padding:5px 12px;}
.share-bar{display:flex;gap:10px;margin:22px 0;padding:14px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);}
.share-bar a{width:34px;height:34px;border-radius:50%;background:var(--paper);border:1px solid var(--line);display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;}
.share-bar a:hover{background:var(--red);color:#fff;border-color:var(--red);}
.author-box{
  display:flex;gap:16px;align-items:center;
  background:var(--card);border:1px solid var(--line);border-left:4px solid var(--red);
  border-radius:var(--radius);padding:20px;margin:0 0 26px;
  box-shadow:0 2px 10px rgba(0,0,0,.04);
}
.author-box img{width:60px;height:60px;border-radius:50%;object-fit:cover;border:2px solid var(--paper);box-shadow:0 0 0 2px var(--line);flex:0 0 auto;}
.author-box h4{margin:0 0 4px;font-size:16px;color:var(--ink);}
.author-box h4::before{content:"✍ ";}
.author-box p{margin:0;font-size:13.5px;color:var(--muted);line-height:1.5;}
.related-posts{margin-top:36px;}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer{background:var(--navy);color:#c9cedb;margin-top:50px;}
.footer-grid{display:grid;grid-template-columns:1.4fr repeat(3,1fr);gap:30px;padding:44px 0 26px;}
.footer-grid h4{color:#fff;font-family:var(--font-utility);font-size:13px;text-transform:uppercase;letter-spacing:.08em;margin-bottom:16px;}
.footer-grid p{font-size:13.5px;line-height:1.7;color:#a7acba;}
.footer-grid ul li{padding:5px 0;}
.footer-grid ul li a{font-size:13.5px;color:#c9cedb;}
.footer-grid ul li a:hover{color:var(--amber);}
.footer-bottom{border-top:1px solid #263148;padding:16px 0;font-family:var(--font-utility);font-size:12px;color:#8b90a0;display:flex;justify-content:space-between;flex-wrap:wrap;gap:10px;}

/* =========================================================
   AD SLOTS
   Reserved min-height so ads never cause layout shift, and
   they load lazily (see js/lazy-ads.js) so they never block
   content or slow the initial render.
   ========================================================= */
.ad-slot{
  min-height:100px;background:var(--paper);border:1px dashed var(--line);
  border-radius:var(--radius);display:flex;flex-direction:column;
  align-items:center;justify-content:center;text-align:center;margin:20px 0;
  contain:layout paint;
}
.ad-slot .ad-label{font-family:var(--font-utility);font-size:10px;color:var(--muted);
  text-transform:uppercase;letter-spacing:.08em;margin-bottom:6px;}
.in-content-ad .ad-slot{margin:26px 0;}

/* =========================================================
   RESPONSIVE IMAGES / CONTENT MEDIA
   Every image in post content and cards scales to its box —
   correct sizes on both mobile and desktop, no overflow.
   ========================================================= */
.entry-content img,.entry-content iframe,.entry-content video{
  max-width:100%;height:auto;
}
.entry-content iframe{aspect-ratio:16/9;width:100%;height:auto;}

/* =========================================================
   BUTTONS / MISC
   ========================================================= */
.btn{display:inline-block;background:var(--red);color:#fff;font-family:var(--font-utility);font-weight:700;font-size:13px;padding:10px 20px;border-radius:var(--radius);}
.btn:hover{background:var(--red-dark);color:#fff;}
.pagination{display:flex;gap:8px;justify-content:center;margin:30px 0;font-family:var(--font-utility);font-size:13px;}
.pagination a,.pagination span{padding:8px 14px;border:1px solid var(--line);border-radius:var(--radius);}
.pagination .current{background:var(--red);color:#fff;border-color:var(--red);}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 960px){
  .content-layout{grid-template-columns:1fr;}
  .hero-grid{grid-template-columns:1fr;}
  .post-grid{grid-template-columns:repeat(2,1fr);}
  .footer-grid{grid-template-columns:1fr 1fr;}
}
@media (max-width: 680px){
  .site-branding .site-title{font-size:20px;}
  .post-grid{grid-template-columns:1fr;}
  .post-row{flex-direction:column;}
  .post-row .thumb{flex-basis:auto;}
  .footer-grid{grid-template-columns:1fr;padding:30px 0;}
  .hero-lead img{height:240px;}
  .single-post .byline-line{font-size:12px;}
  .single-post .byline-date{font-size:11.5px;}
}
@media (max-width: 420px){
  .container{padding:0 14px;}
  .site-branding .site-title{font-size:22px;}
  .hero-lead-body{padding:14px 16px 18px;}
  .post-row{padding:14px 0;}
  .ad-slot{min-height:80px;}
}
