/*
Theme Name: Jana Vartha
Theme URI: https://janavartha.com
Author: Jana Vartha
Author URI: https://janavartha.com
Description: Custom Malayalam news theme for Jana Vartha — a faithful WordPress rebuild of the live news design (navy + red), fully managed from the standard dashboard. Posts, Categories (sections), featured images, live marquee, social sharing and view counts. Fully responsive (rem-based).
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: janavartha
*/

/* ============================================================
   Design tokens (ported 1:1 from the live site)
   ============================================================ */
:root{
  --background:0 0% 100%;
  --foreground:222 47% 11%;
  --card:0 0% 100%;
  --card-foreground:222 47% 11%;
  --primary:222 60% 16%;
  --primary-foreground:0 0% 100%;
  --secondary:0 78% 48%;
  --muted:220 14% 96%;
  --muted-foreground:220 9% 40%;
  --accent:0 78% 48%;
  --border:220 13% 88%;
  --input:220 13% 88%;
  --ring:0 78% 48%;
  --radius:.5rem;

  --navy:222 60% 16%;
  --navy-deep:222 65% 10%;
  --navy-foreground:0 0% 100%;
  --news-red:0 78% 48%;
  --news-red-dark:0 78% 38%;
  --news-red-light:0 85% 63%; /* AA-contrast red for dark (navy) backgrounds */
  --gold:42 95% 55%;
  --live:0 85% 50%;

  --gradient-navy:linear-gradient(135deg,hsl(222 65% 10%),hsl(222 55% 20%));
  --gradient-red:linear-gradient(135deg,hsl(0 78% 48%),hsl(0 78% 38%));
  --gradient-hero:linear-gradient(180deg,hsl(222 65% 10%) 0%,hsl(222 55% 18%) 100%);

  --shadow-card:0 4px 20px -4px hsl(222 60% 16% / .12);
  --shadow-elevated:0 10px 40px -10px hsl(222 60% 16% / .25);
  --shadow-red:0 8px 24px -8px hsl(0 78% 48% / .4);

  --sidebar-background:222 65% 10%;
  --sidebar-accent:222 55% 18%;
  --sidebar-border:222 50% 22%;

  --container:87.5rem; /* 1400px */
  --wa:#25D366;
  --fb:#1877F2;
  --tw:#1d1d1f;
}

/* ============================================================
   Base / reset — rem-based responsive root
   The html font-size scales down on smaller viewports, so every
   rem-based size (fonts, spacing, boxes) adapts automatically.
   ============================================================ */
*,*::before,*::after{box-sizing:border-box}
html{font-size:100%;-webkit-text-size-adjust:100%;scroll-behavior:smooth} /* 1rem = 16px */
@media (max-width:1024px){html{font-size:96%}}
@media (max-width:768px){html{font-size:92%}}
@media (max-width:480px){html{font-size:88%}}
@media (max-width:360px){html{font-size:85%}}

body{
  margin:0;
  background:hsl(var(--background));
  color:hsl(var(--foreground));
  font-family:Inter,"Anek Malayalam",system-ui,sans-serif;
  font-feature-settings:"ss01","cv11";
  line-height:1.6;
  font-size:1rem;
  overflow-x:hidden;
}
img{max-width:100%;height:auto;display:block}
a{color:inherit;text-decoration:none;transition:color .15s ease}
button{font-family:inherit;cursor:pointer}
ul{margin:0;padding:0;list-style:none}
h1,h2,h3,h4,h5{margin:0;line-height:1.2;font-weight:800}
p{margin:0 0 1rem}
.font-display{font-family:"Playfair Display","Anek Malayalam",serif}
.screen-reader-text{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}
.container{max-width:var(--container);margin:0 auto;padding-left:1.25rem;padding-right:1.25rem;width:100%}
.text-red{color:hsl(var(--news-red))}

/* Pulsing LIVE dot (used in the marquee label) */
.live-dot{width:.5625rem;height:.5625rem;border-radius:50%;background:hsl(var(--live));box-shadow:0 0 0 0 hsl(var(--live) / .7);animation:jv-pulse 1.8s infinite;flex:0 0 auto}
@keyframes jv-pulse{0%{box-shadow:0 0 0 0 hsl(var(--live) / .7)}70%{box-shadow:0 0 0 .5rem hsl(var(--live) / 0)}100%{box-shadow:0 0 0 0 hsl(var(--live) / 0)}}

/* ============================================================
   Header
   ============================================================ */
.site-header{position:relative;z-index:50}
.site-header__top{background:#fff;color:hsl(var(--foreground))}

/* Masthead: centered logo on desktop; logo-left + hamburger-right on mobile */
.masthead__inner{display:flex;align-items:center;justify-content:center;padding:.5rem 0;gap:1rem}
.custom-logo-link{display:inline-flex;line-height:0}
.custom-logo{max-height:5.625rem;width:auto;height:auto;object-fit:contain}
.site-logo-fallback{display:inline-flex;align-items:center;gap:.65rem;color:hsl(var(--foreground))}
.site-logo-fallback img{width:3.5rem;height:3.5rem;border-radius:50%;flex:0 0 auto}

/* Hamburger toggle (hidden on desktop, shown on mobile inside the masthead) */
.navtoggle{display:none;background:transparent;border:0;color:hsl(var(--foreground));padding:.4rem;align-items:center;justify-content:center;cursor:pointer;flex:0 0 auto}
.navtoggle svg{width:1.75rem;height:1.75rem}

/* Main nav */
.mainnav{background:#fff;border-top:1px solid hsl(var(--border));border-bottom:1px solid hsl(var(--border))}
.mainnav__inner{display:flex;align-items:center;justify-content:center;gap:1rem}
.menu{display:flex;flex-wrap:wrap;align-items:stretch}
.menu li{position:relative}
.menu a{display:block;padding:.95rem 1.05rem;color:hsl(var(--foreground));font-size:.82rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;border-bottom:3px solid transparent}
.menu a:hover,.menu li.current-menu-item>a,.menu li.current-cat>a,.menu li.current-menu-parent>a{color:hsl(var(--news-red));border-bottom-color:hsl(var(--news-red))}
.menu a:hover{background:hsl(var(--muted))}

/* ============================================================
   LIVE marquee
   ============================================================ */
.livebar{background:hsl(var(--news-red));color:#fff;border-top:2px solid hsl(var(--news-red-dark));border-bottom:2px solid hsl(var(--news-red-dark));overflow:hidden}
.livebar__inner{display:flex;align-items:stretch;padding:0 1rem}
.livebar__date{display:flex;align-items:center;padding:.55rem .9rem;font-weight:700;font-size:.82rem;color:#fff;white-space:nowrap;flex:0 0 auto}
.livebar__label{display:flex;align-items:center;gap:.4rem;background:hsl(var(--news-red-dark));font-weight:800;text-transform:uppercase;letter-spacing:.12em;font-size:.8rem;padding:.55rem 1rem;flex:0 0 auto;white-space:nowrap}
.livebar__label .live-dot{background:#fff;box-shadow:0 0 0 0 hsl(0 0% 100% / .7);animation:jv-pulse-white 1.8s infinite}
@keyframes jv-pulse-white{0%{box-shadow:0 0 0 0 hsl(0 0% 100% / .6)}70%{box-shadow:0 0 0 .45rem hsl(0 0% 100% / 0)}100%{box-shadow:0 0 0 0 hsl(0 0% 100% / 0)}}
.livebar__track{flex:1 1 auto;overflow:hidden;position:relative;display:flex;align-items:center}
.livebar__marquee{display:inline-flex;align-items:center;white-space:nowrap;will-change:transform;animation:jv-marquee 32s linear infinite}
.livebar__track:hover .livebar__marquee{animation-play-state:paused}
.livebar__marquee a{display:inline-flex;align-items:center;padding:.55rem 0;font-weight:600;font-size:.9rem}
.livebar__marquee a:hover{text-decoration:underline}
.livebar__marquee .diamond{margin:0 1.4rem;color:hsl(0 0% 100% / .8);font-size:.7rem}
@keyframes jv-marquee{from{transform:translateX(0)}to{transform:translateX(-50%)}}

/* ============================================================
   Layout helpers
   ============================================================ */
.site-main{padding:0 0 3rem}
.site-main>.container:first-child{padding-top:2.25rem}
.section-gap{margin-bottom:2.75rem}

/* Category tag pill */
.tag{display:inline-block;background:hsl(var(--news-red));color:#fff;font-size:.68rem;font-weight:800;text-transform:uppercase;letter-spacing:.07em;padding:.28rem .6rem;border-radius:.25rem;line-height:1.1}
.tag--sm{font-size:.62rem;padding:.22rem .5rem}

/* Eyebrow (LATEST, category labels) */
.eyebrow{font-size:.72rem;font-weight:800;text-transform:uppercase;letter-spacing:.14em;color:hsl(var(--news-red))}

/* Section heading */
.section-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1.25rem;border-bottom:2px solid hsl(var(--foreground));padding-bottom:.5rem}
.section-head__title{font-family:"Playfair Display","Anek Malayalam",serif;font-size:1.7rem;font-weight:800;color:hsl(var(--foreground))}
.section-head__more{display:inline-flex;align-items:center;gap:.3rem;color:hsl(var(--news-red));font-weight:800;font-size:.78rem;text-transform:uppercase;letter-spacing:.06em;white-space:nowrap}
.section-head__more svg{width:.875rem;height:.875rem}

/* Meta row (clock / views / date) */
.meta-row{display:flex;align-items:center;gap:1rem;color:hsl(var(--muted-foreground));font-size:.82rem}
.meta-row .meta-item{display:inline-flex;align-items:center;gap:.35rem}
.meta-row svg{width:.9375rem;height:.9375rem;opacity:.85}

/* ============================================================
   Share buttons
   ============================================================ */
.share{display:inline-flex;align-items:center;gap:.5rem}
.share__label{font-size:.82rem;font-weight:700;color:hsl(var(--muted-foreground));margin-right:.15rem}
.share-btn{width:2.375rem;height:2.375rem;border-radius:9999px;display:inline-grid;place-items:center;transition:all .15s ease;flex:0 0 auto}
.share-btn svg{width:1.0625rem;height:1.0625rem}
.share-btn--light{background:#fff;border:1px solid hsl(var(--border));color:hsl(var(--muted-foreground))}
.share-btn--light.is-wa:hover{background:var(--wa);border-color:var(--wa);color:#fff}
.share-btn--light.is-fb:hover{background:var(--fb);border-color:var(--fb);color:#fff}
.share-btn--light.is-tw:hover{background:var(--tw);border-color:var(--tw);color:#fff}
.share-btn--light.is-share:hover{background:hsl(var(--navy));border-color:hsl(var(--navy));color:#fff}
.share-btn--glass{background:hsl(0 0% 100% / .15);color:#fff;backdrop-filter:blur(4px)}
.share-btn--glass.is-wa:hover{background:var(--wa)}
.share-btn--glass.is-fb:hover{background:var(--fb)}
.share-btn--glass.is-tw:hover{background:#000}
.share-btn--glass.is-share:hover{background:hsl(0 0% 100% / .3)}

/* ============================================================
   Article card
   ============================================================ */
.card{display:flex;flex-direction:column;background:hsl(var(--card));border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow-card);transition:transform .18s ease,box-shadow .18s ease}
.card:hover{transform:translateY(-.1875rem);box-shadow:var(--shadow-elevated)}
.card__media{position:relative;display:block;aspect-ratio:16/10;background:var(--gradient-hero);overflow:hidden}
.card__media img{width:100%;height:100%;object-fit:cover}
.card__media .tag{position:absolute;left:.75rem;bottom:.75rem}
.card__body{padding:.9rem 1rem 1.1rem;display:flex;flex-direction:column;gap:.5rem;flex:1}
.card__title{font-size:1rem;font-weight:700;line-height:1.3;color:hsl(var(--foreground))}
.card:hover .card__title{color:hsl(var(--news-red))}
.card__meta{margin-top:auto}
.cards-row{display:grid;grid-template-columns:repeat(4,1fr);gap:1.5rem}

/* ============================================================
   Homepage — hero + latest
   ============================================================ */
.home-top{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:2rem;margin-bottom:2.75rem}
.hero{position:relative;border-radius:var(--radius);overflow:hidden;min-height:32.5rem;display:flex;flex-direction:column;justify-content:flex-end;color:#fff;background:var(--gradient-hero);box-shadow:var(--shadow-elevated)}
.hero__img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.hero__overlay{position:absolute;inset:0;background:linear-gradient(180deg,hsl(222 65% 10% / .25) 0%,hsl(222 65% 10% / .55) 55%,hsl(222 65% 10% / .92) 100%)}
.hero__share{position:absolute;top:1.25rem;right:1.25rem;z-index:2}
.hero__body{position:relative;z-index:2;padding:2.5rem}
.hero__tag{margin-bottom:1rem}
.hero__title{font-size:2.6rem;font-weight:800;line-height:1.12;margin-bottom:.85rem;max-width:90%}
.hero__excerpt{font-size:1.02rem;color:hsl(0 0% 100% / .85);margin-bottom:1rem;max-width:80%}
.hero__meta{color:hsl(0 0% 100% / .8)}
.hero__meta svg{opacity:.9}

.latest__head{display:flex;align-items:center;border-bottom:2px solid hsl(var(--news-red));padding-bottom:.5rem;margin-bottom:1rem}
.latest__head h2{font-size:1.05rem;font-weight:800;text-transform:uppercase;letter-spacing:.12em;color:hsl(var(--foreground))}
.latest__list{display:flex;flex-direction:column}
.latest__item{display:flex;gap:.85rem;padding:1rem 0;border-bottom:1px solid hsl(var(--border))}
.latest__item:last-child{border-bottom:0}
.latest__main{flex:1;min-width:0}
.latest__cat{margin-bottom:.3rem}
.latest__title{font-size:.98rem;font-weight:700;line-height:1.3;color:hsl(var(--foreground))}
.latest__item:hover .latest__title{color:hsl(var(--news-red))}
.latest__share{display:flex;flex-direction:row;flex-wrap:wrap;gap:.4rem;flex:0 0 auto;align-self:flex-start;max-width:8.75rem;justify-content:flex-end}
.latest__share .share-btn{width:1.875rem;height:1.875rem}
.latest__share .share-btn svg{width:.8125rem;height:.8125rem}

/* ============================================================
   Single article
   ============================================================ */
.article{max-width:51.25rem;margin:0 auto}
.article__tag{margin-bottom:1.1rem}
.article__title{font-size:2.5rem;font-weight:800;line-height:1.15;color:hsl(var(--foreground));margin-bottom:1.1rem}
.article__head-meta{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;padding-bottom:1.1rem;border-bottom:1px solid hsl(var(--border));margin-bottom:1.6rem}
.article__featured{margin:0 0 1.6rem;border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow-card)}
.article__featured img{width:100%;height:auto;display:block}
.article__content{font-size:1.12rem;line-height:1.85;color:hsl(222 30% 22%)}
.article__content p{margin:0 0 1.3rem}
.article__content h2{font-family:"Playfair Display","Anek Malayalam",serif;font-size:1.6rem;margin:2rem 0 1rem}
.article__content h3{font-size:1.3rem;margin:1.6rem 0 .8rem}
.article__content a{color:hsl(var(--news-red));text-decoration:underline}
.article__content img{border-radius:var(--radius);margin:1.5rem 0}
.article__content blockquote{border-left:4px solid hsl(var(--news-red));margin:1.5rem 0;padding:.5rem 0 .5rem 1.25rem;color:hsl(var(--muted-foreground));font-style:italic}
.article__content ul,.article__content ol{margin:0 0 1.3rem;padding-left:1.4rem}
.article__content li{margin-bottom:.5rem}
.related{margin-top:3rem}
.related__title{font-family:"Playfair Display","Anek Malayalam",serif;font-size:1.7rem;font-weight:800;color:hsl(var(--foreground));border-bottom:2px solid hsl(var(--foreground));padding-bottom:.5rem;margin-bottom:1.25rem}

/* ============================================================
   Archive / search header
   ============================================================ */
.page-head{background:var(--gradient-hero);color:#fff;padding:2.5rem 0;margin-bottom:2rem}
.page-head__eyebrow{font-size:.75rem;font-weight:800;text-transform:uppercase;letter-spacing:.16em;color:hsl(var(--news-red));margin-bottom:.5rem}
.page-head__title{font-family:"Playfair Display","Anek Malayalam",serif;font-size:2.4rem;font-weight:800}
.page-head__desc{color:hsl(0 0% 100% / .8);margin-top:.5rem;max-width:60ch}
.archive-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:1.5rem}

/* Pagination */
.pagination{display:flex;justify-content:center;gap:.4rem;margin-top:2.5rem;flex-wrap:wrap}
.pagination .page-numbers{display:inline-grid;place-items:center;min-width:2.5rem;height:2.5rem;padding:0 .6rem;border:1px solid hsl(var(--border));border-radius:var(--radius);font-weight:700;color:hsl(var(--foreground))}
.pagination .page-numbers.current,.pagination .page-numbers:hover{background:hsl(var(--news-red));border-color:hsl(var(--news-red));color:#fff}

/* Empty state */
.empty{text-align:center;padding:4rem 1rem;color:hsl(var(--muted-foreground))}
.empty h1{font-family:"Playfair Display","Anek Malayalam",serif;font-size:3rem;color:hsl(var(--foreground));margin-bottom:.5rem}

/* ============================================================
   Footer
   ============================================================ */
.site-footer{background:hsl(var(--navy-deep));color:hsl(0 0% 100% / .72);margin-top:3rem}
.footer-top{display:grid;grid-template-columns:1.5fr 1.7fr 1.1fr;gap:2.5rem;padding:3.5rem 0}
.footer-logo{display:inline-block;background:#fff;padding:.55rem .85rem;border-radius:.625rem;line-height:0;margin-bottom:1.1rem}
.footer-logo img{max-height:3.25rem;width:auto;display:block}
.footer-brand__desc{font-size:.92rem;line-height:1.7;max-width:40ch;color:hsl(0 0% 100% / .6)}
.footer-col h4{color:hsl(var(--news-red-light));font-size:1rem;font-weight:800;margin-bottom:1.15rem;letter-spacing:.01em}
.footer-col li{margin-bottom:.7rem}
.footer-col a{font-size:.95rem;color:hsl(0 0% 100% / .78)}
.footer-col a:hover{color:hsl(var(--news-red-light))}
.footer-sections-list{display:grid;grid-template-columns:1fr 1fr;gap:.7rem 1.75rem}
.footer-sections-list li{margin-bottom:0}
.footer-copyright{margin-top:1.5rem;font-size:.85rem;color:hsl(0 0% 100% / .5)}

/* ============================================================
   Responsive layout
   ============================================================ */
@media (max-width:1024px){
  .home-top{grid-template-columns:1fr;gap:2.5rem}
  .hero{min-height:26rem}
  .cards-row,.archive-grid{grid-template-columns:repeat(2,1fr)}
  .footer-top{grid-template-columns:1fr 1fr;gap:2rem}
  .footer-brand{grid-column:1 / -1}
}

/* Mobile navbar: logo left, hamburger right; menu becomes a dropdown */
@media (max-width:860px){
  .masthead__inner{justify-content:space-between;padding:.4rem 0}
  .custom-logo{max-height:2.75rem}
  .navtoggle{display:inline-flex}
  .mainnav{display:none;border-top:0}
  .mainnav.is-open{display:block}
  .mainnav__inner{flex-direction:column;align-items:stretch;padding-top:.25rem;padding-bottom:.25rem}
  .menu{flex-direction:column;width:100%}
  .menu a{padding:.85rem .25rem;border-bottom:1px solid hsl(var(--border));border-bottom-width:1px}
  .menu li:last-child a{border-bottom:0}
  .menu a:hover,.menu li.current-menu-item>a{background:transparent;border-bottom-color:hsl(var(--border))}
}

@media (max-width:600px){
  /* Marquee: drop the date so headlines have room to scroll */
  .livebar__date{display:none}
  .livebar__label{padding:.5rem .75rem;letter-spacing:.06em}
  .hero{min-height:20rem}
  .hero__body{padding:1.5rem}
  .hero__title{font-size:1.9rem;max-width:100%}
  .hero__excerpt{max-width:100%}
  .cards-row,.archive-grid{grid-template-columns:1fr}
  .article__title{font-size:1.9rem}
  .page-head__title{font-size:1.9rem}
  .footer-top{grid-template-columns:1fr;gap:1.75rem}
  .footer-sections-list{grid-template-columns:1fr 1fr}
}
