/*
Theme Name: Madhyama
Theme URI: https://madhyama.in/
Author: Ishta Digitals
Author URI: https://ishtadigitals.com/
Description: Premium Kannada news theme for Madhyama — breaking ticker, featured grid, trending, district/category blocks, YouTube video section (tag: video), photo galleries, ad slots, author pages, social sharing and built-in SEO.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: madhyama
*/
:root{--red:#EB311E;--yellow:#FFCC33;--ink:#2C2E35;--ink-2:#1F2126;--mute:#6A6D74;--line:#ECEAE6;--soft:#F6F5F2;--ph:#EEEDEA;--pad:32px}
*{box-sizing:border-box}
body{margin:0;background:#fff;color:var(--ink);font-family:'Anek Kannada',system-ui,sans-serif;font-size:19px;line-height:1.5;-webkit-font-smoothing:antialiased}
a{color:var(--ink);text-decoration:none}a:hover{color:var(--red)}
img{max-width:100%;height:auto;display:block}
h1,h2,h3,h4{margin:0;font-weight:800;line-height:1.25;text-wrap:pretty}
button{font-family:inherit}
.screen-reader-text{position:absolute!important;clip:rect(1px,1px,1px,1px);width:1px;height:1px;overflow:hidden}
::-webkit-scrollbar{display:none}
.m-wrap{padding-left:var(--pad);padding-right:var(--pad)}
.m-thumb{display:block;position:relative;background:var(--ph);border-radius:6px;overflow:hidden}
.m-thumb img{width:100%;height:100%;object-fit:cover}
.r-16-10{aspect-ratio:16/10}.r-16-9{aspect-ratio:16/9}.r-3-2{aspect-ratio:3/2}
.m-badge{display:inline-block;background:var(--red);color:#fff!important;font-weight:700;font-size:14px;padding:3px 9px 1px;border-radius:3px}
.m-meta{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:15px;color:var(--mute)}
.m-meta a{color:var(--mute)}
.m-dot{display:inline-block;width:12px;height:12px;border-radius:50%;background:var(--red)}
.m-dot.y{background:var(--yellow)}
.m-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;border-bottom:2px solid var(--ink);margin-bottom:20px}
.m-head h2{font-size:30px;padding-bottom:8px;display:flex;align-items:center;gap:12px}
.m-head a{font-size:17px;font-weight:700;color:var(--red);padding-bottom:10px}
.m-ad{border:1px dashed #D6D3CD;border-radius:4px;background:var(--soft);display:flex;align-items:center;justify-content:center;color:#8A8C92;font-size:14px;overflow:hidden}
.m-ad img,.m-ad iframe{width:100%;height:auto}

/* Ticker */
.m-ticker{border-bottom:1px solid var(--line)}
.m-ticker .m-wrap{display:flex;align-items:center;gap:14px;padding-top:8px;padding-bottom:8px}
.m-ticker__label{background:var(--red);color:#fff;font-weight:700;font-size:16px;padding:4px 10px 2px;border-radius:3px;display:flex;align-items:center;gap:6px;flex-shrink:0}
.m-ticker__label:before{content:"";width:7px;height:7px;border-radius:50%;background:var(--yellow)}
.m-ticker__track{flex:1;min-width:0;overflow:hidden;position:relative;height:28px}
.m-ticker__track a{position:absolute;inset:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:18px;font-weight:500;opacity:0;transform:translateY(8px);transition:.35s}
.m-ticker__track a.on{opacity:1;transform:none}
.m-ticker__nav{display:flex;gap:4px}
.m-ticker__nav button{width:30px;height:30px;border:1px solid #E2E0DB;background:#fff;border-radius:4px;cursor:pointer;color:var(--ink)}
.m-ticker__date{font-size:16px;color:var(--mute);padding-left:12px;border-left:1px solid #E2E0DB;flex-shrink:0}

/* Header + nav */
.m-header .m-wrap{display:flex;align-items:center;justify-content:space-between;gap:24px;flex-wrap:wrap;padding-top:22px;padding-bottom:22px}
.m-logo img{height:78px;width:auto}
.m-header .m-ad{flex:0 1 728px;min-height:90px}
.m-nav{position:sticky;top:0;z-index:40;background:var(--ink)}
.admin-bar .m-nav{top:32px}
.m-nav .m-wrap{display:flex;align-items:stretch;height:60px}
.m-nav__home{display:flex;align-items:center;padding:0 18px;background:var(--red);color:#fff!important;font-weight:700;font-size:20px;flex-shrink:0}
.m-nav__menu{display:flex;flex:1;min-width:0;overflow-x:auto;scrollbar-width:none;margin:0;padding:0;list-style:none}
.m-nav__menu li{display:flex}
.m-nav__menu a{display:flex;align-items:center;padding:0 16px;color:#fff;font-weight:600;font-size:20px;white-space:nowrap}
.m-nav__menu a:hover,.m-nav__menu .current-menu-item>a,.m-nav__menu .current-category-ancestor>a{color:var(--yellow);box-shadow:inset 0 -3px 0 var(--yellow)}
.m-nav__search{width:60px;border:0;background:transparent;color:#fff;cursor:pointer;font-size:22px}
.m-nav__search:hover{background:#3A3D45}
.m-lang{display:flex;align-items:center;gap:2px;padding-left:10px;border-left:1px solid #43464E}
.m-lang a{font-size:16px;font-weight:700;padding:5px 10px 3px;border-radius:3px;color:#fff}
.m-lang a.on{background:var(--yellow);color:var(--ink)}

/* Search overlay */
.m-search{position:fixed;inset:0;z-index:60;background:rgba(28,29,34,.72);display:none;justify-content:center;padding:80px 20px}
.m-search.open{display:flex}
.m-search form{width:100%;max-width:720px;background:#fff;border-radius:8px;display:flex;align-self:flex-start;overflow:hidden}
.m-search input{flex:1;border:0;outline:0;font-family:inherit;font-size:26px;padding:22px 24px 18px}
.m-search button{border:0;background:var(--red);color:#fff;font-size:18px;font-weight:700;padding:0 24px;cursor:pointer}

/* Home: featured */
.m-featured{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,440px),1fr));gap:28px;padding-top:28px}
.m-lead{display:flex;flex-direction:column;gap:14px}
.m-lead h1{font-size:clamp(34px,3.4vw,54px);letter-spacing:-.01em;line-height:1.18}
.m-lead p{margin:0;font-size:21px;line-height:1.6;color:#53565D}
.m-side4{display:grid;grid-template-columns:repeat(auto-fit,minmax(max(210px,40%),1fr));gap:24px 22px}
.m-card{display:flex;flex-direction:column;gap:10px}
.m-card h3{font-size:23px;line-height:1.3;font-weight:700}

/* Trending (text-only) */
.m-trending{padding-top:44px}
.m-trend__row{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(230px,calc((100% - 108px)/7));gap:18px;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none}
.m-trend__item{display:flex;flex-direction:column;gap:10px;padding:18px 18px 20px;border:1px solid #E6E4DF;border-top:3px solid var(--red);border-radius:6px;scroll-snap-align:start}
.m-trend__item b{font-size:38px;color:var(--red);line-height:1}
.m-trend__item small{font-size:15px;font-weight:700;color:var(--mute)}
.m-trend__item span{font-size:21px;font-weight:700;line-height:1.32}
.m-arrows{display:flex;gap:6px;padding-bottom:10px}
.m-arrows button{width:36px;height:36px;border:1px solid #E2E0DB;background:#fff;border-radius:50%;cursor:pointer;font-size:18px}

/* Layout with sidebar */
.m-cols{display:flex;flex-wrap:wrap;gap:40px;align-items:flex-start;padding-top:52px}
.m-main{flex:999 1 620px;min-width:0;display:flex;flex-direction:column;gap:48px}
.m-sidebar{flex:1 1 360px;min-width:0;display:flex;flex-direction:column;gap:32px;position:sticky;top:80px}
.m-district{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:24px}
.m-overlay{position:relative;min-height:400px;border-radius:6px;overflow:hidden;background:#3A3D45;display:flex;flex-direction:column;justify-content:flex-end;padding:22px;color:#fff!important}
.m-overlay img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.m-overlay:after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(20,21,25,0) 30%,rgba(20,21,25,.9))}
.m-overlay>*{position:relative;z-index:1}
.m-overlay .m-badge{position:absolute;top:16px;left:18px}
.m-overlay h3{font-size:30px}
.m-list-item{display:flex;gap:14px;padding:12px 0;border-bottom:1px solid var(--line)}
.m-list-item .m-thumb{width:120px;height:80px;flex-shrink:0;border-radius:4px}
.m-list-item h3{font-size:20px;line-height:1.32;font-weight:700}
.m-list-item small{font-size:14px;color:var(--mute)}
.m-list-item small b{color:var(--red)}
.m-blocks{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:36px}
.m-block .m-thumb{margin-bottom:10px}
.m-block>h3{font-size:25px;margin:6px 0 4px}
.m-block h4{padding:12px 0;border-bottom:1px solid var(--line);font-size:20px;font-weight:600;line-height:1.35}
.m-block h4 a:before{content:"› ";color:var(--red)}
.m-mostread{background:var(--ink);color:#fff;border-radius:6px;padding:22px}
.m-mostread h2{font-size:28px;margin-bottom:4px}
.m-mostread ol{list-style:none;margin:0;padding:0;counter-reset:mr}
.m-mostread li{counter-increment:mr;display:flex;gap:14px;padding:12px 0;border-bottom:1px solid #43464E}
.m-mostread li:before{content:counter(mr);font-size:34px;font-weight:800;color:var(--yellow);line-height:1;width:26px;flex-shrink:0}
.m-mostread a{color:#fff;font-size:20px;font-weight:600;line-height:1.35}
.m-mostread a:hover{color:var(--yellow)}
.m-widget h2{font-size:28px;border-bottom:2px solid var(--ink);padding-bottom:6px;margin-bottom:6px}

/* Video */
.m-video{background:var(--ink);color:#fff;margin-top:56px;padding-top:48px;padding-bottom:48px}
.m-video .m-head{border-color:#43464E}.m-video .m-head h2{color:#fff}
.m-video__grid{display:flex;flex-wrap:wrap;gap:28px;align-items:flex-start}
.m-video__main{flex:2 1 560px;min-width:0;display:flex;flex-direction:column;gap:10px}
.m-video__player{position:relative;aspect-ratio:16/9;border:0;padding:0;border-radius:6px;overflow:hidden;background:#3A3D45;cursor:pointer;width:100%}
.m-video__player img{width:100%;height:100%;object-fit:cover}
.m-video__player iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
.m-play{position:absolute;left:50%;top:50%;width:84px;height:84px;margin:-42px 0 0 -42px;border-radius:50%;background:var(--red);box-shadow:0 10px 40px rgba(235,49,30,.45)}
.m-play:after{content:"";position:absolute;left:33px;top:26px;border-left:26px solid #fff;border-top:16px solid transparent;border-bottom:16px solid transparent}
.m-video__meta{font-size:15px;color:var(--yellow);font-weight:700}
.m-video__main h3{font-size:30px}.m-video__main h3 a{color:#fff}
.m-video__list{flex:1 1 340px;min-width:0;list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}
.m-video__list button{display:flex;gap:14px;align-items:center;text-align:left;width:100%;border:0;cursor:pointer;padding:10px;border-radius:6px;background:transparent;color:#fff}
.m-video__list button:hover,.m-video__list button.is-active{background:#43464E}
.m-video__list img{width:160px;aspect-ratio:16/9;object-fit:cover;border-radius:4px;flex-shrink:0;background:#43464E}
.m-video__list span{font-size:18px;font-weight:700;line-height:1.3;display:flex;flex-direction:column;gap:4px}
.m-video__list small{font-size:13px;color:var(--yellow)}

/* Gallery */
.m-gallery{padding-top:52px}
.m-gallery__grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr));grid-auto-rows:240px;gap:14px}
.m-gallery__grid a{position:relative;border-radius:6px;overflow:hidden;background:var(--ph);cursor:zoom-in}
.m-gallery__grid img{width:100%;height:100%;object-fit:cover}
.m-gallery__grid span{position:absolute;left:0;right:0;bottom:0;padding:40px 16px 14px;color:#fff;font-size:20px;font-weight:700;background:linear-gradient(180deg,transparent,rgba(20,21,25,.8))}
.m-lightbox{position:fixed;inset:0;z-index:70;background:rgba(18,19,22,.94);display:none;align-items:center;justify-content:center;flex-direction:column;gap:16px;padding:40px}
.m-lightbox.open{display:flex}
.m-lightbox img{max-height:78vh;width:auto;border-radius:6px}
.m-lightbox p{color:#fff;font-size:22px;font-weight:700;margin:0}
.m-lightbox button{position:absolute;border:1px solid #55585F;background:transparent;color:#fff;font-size:28px;width:56px;height:56px;border-radius:50%;cursor:pointer}
.m-lb-x{top:18px;right:24px;border:0!important;font-size:40px!important}.m-lb-p{left:24px;top:50%}.m-lb-n{right:24px;top:50%}

.m-catcols{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:32px;padding-top:52px;padding-bottom:56px}

/* Single */
.m-crumbs{display:flex;gap:8px;flex-wrap:wrap;font-size:16px;color:var(--mute);margin-bottom:18px}
.m-crumbs a{color:var(--mute)}.m-crumbs a.cat{color:var(--red);font-weight:700}
.m-single h1{font-size:clamp(36px,3.6vw,58px);line-height:1.16;letter-spacing:-.01em;margin-bottom:18px}
.m-single .m-excerpt{font-size:23px;line-height:1.55;color:#53565D;margin:0 0 24px}
.m-byline{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;padding:16px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin-bottom:26px}
.m-byline__a{display:flex;align-items:center;gap:12px}
.m-byline__a img{width:48px;height:48px;border-radius:50%}
.m-byline__a b{font-size:18px;display:block}.m-byline__a span{font-size:15px;color:var(--mute)}
.m-share{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.m-share b{font-size:16px;margin-right:4px}
.m-share a,.m-share button{padding:8px 14px 6px;border-radius:4px;color:#fff!important;font-size:15px;font-weight:700;border:0;cursor:pointer}
.s-wa{background:#1F9D55}.s-fb{background:#2D5BBA}.s-x{background:var(--ink)}
.m-share button{background:#fff;color:var(--ink)!important;border:1px solid #D6D3CD}
.m-figure{margin:0 0 28px}.m-figure figcaption{font-size:15px;color:var(--mute);padding-top:8px}
.m-content{max-width:780px;font-size:21px;line-height:1.75;color:#33363D}
.m-content p{margin:0 0 22px}
.m-content h2{font-size:30px;margin:34px 0 12px}
.m-content blockquote{margin:30px 0;padding:6px 0 6px 24px;border-left:4px solid var(--red);font-size:27px;line-height:1.45;font-weight:700;color:var(--ink)}
.m-content iframe,.m-content .wp-block-embed{max-width:100%;width:100%;aspect-ratio:16/9;height:auto}
.m-content figure{margin:28px 0}
.m-tags{display:flex;gap:8px;flex-wrap:wrap;margin:28px 0}
.m-tags a{border:1px solid #E2E0DB;border-radius:999px;padding:6px 14px 4px;font-size:16px}
.m-authorbox{display:flex;gap:18px;align-items:center;padding:24px;background:var(--soft);border-radius:6px;margin:36px 0;max-width:780px}
.m-authorbox img{width:72px;height:72px;border-radius:50%;flex-shrink:0}
.m-authorbox b{font-size:22px;display:block}.m-authorbox p{margin:4px 0 0;font-size:17px;color:#53565D;line-height:1.5}
.m-related{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:24px}

/* Archive */
.m-archive-head{background:var(--soft);border-bottom:1px solid var(--line);padding-top:36px;padding-bottom:28px}
.m-archive-head h1{font-size:clamp(44px,4.5vw,68px);display:flex;align-items:center;gap:16px;line-height:1.05}
.m-archive-head p{margin:8px 0 0;font-size:19px;color:var(--mute)}
.m-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,320px),1fr));gap:32px 26px}
.m-grid h2{font-size:24px;line-height:1.28}
.m-grid p{margin:0;font-size:17px;line-height:1.55;color:#53565D}
.m-pager{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin-top:44px}
.m-pager .page-numbers{border:1px solid #E2E0DB;font-size:17px;font-weight:700;min-width:44px;padding:8px 14px 6px;border-radius:4px;text-align:center}
.m-pager .current{background:var(--red);color:#fff;border-color:var(--red)}
.m-author-hero{background:var(--ink);color:#fff;padding-top:48px;padding-bottom:48px;display:flex;gap:28px;align-items:center;flex-wrap:wrap}
.m-author-hero img{width:128px;height:128px;border-radius:50%}
.m-author-hero h1{font-size:clamp(40px,4vw,60px)}
.m-author-hero p{font-size:21px;color:#D9D8D4;margin:8px 0 0;max-width:820px}

/* Footer */
.m-footer{background:var(--ink-2);color:#D9D8D4;margin-top:24px}
.m-footer__brand{background:var(--red);display:flex;align-items:center;justify-content:space-between;gap:24px;flex-wrap:wrap}
.m-footer__brand img{height:150px;width:auto}
.m-footer__brand p{color:#fff;font-size:24px;font-weight:600;max-width:560px;margin:0}
.m-footer__cols{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:36px;padding-top:44px;padding-bottom:44px}
.m-footer h3{color:#fff;font-size:22px;margin-bottom:14px}
.m-footer ul{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:8px 16px}
.m-footer a{color:#D9D8D4;font-size:18px}.m-footer a:hover{color:var(--yellow)}
.m-social{display:flex;gap:8px;flex-wrap:wrap}
.m-social a{padding:8px 14px 6px;border:1px solid #43464E;border-radius:4px;color:#fff;font-size:16px}
.m-footer__bar{border-top:1px solid #33363D;padding-top:22px;padding-bottom:22px;display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap}
.m-footer__bar small{font-size:16px;color:#9A9CA2}
.m-credit{display:flex;align-items:center;gap:12px;padding:14px 26px 12px;border-radius:999px;border:1px solid #4A6672;background:#1C3A47;color:#E6EEF1!important;font-size:17px;font-weight:500}
.m-credit b{color:#F2A65A;font-weight:800;letter-spacing:.04em}
.m-credit:hover{border-color:#F2A65A}

@media (max-width:700px){
:root{--pad:16px}
.m-ticker__date{display:none}
.m-header .m-wrap{padding-top:14px;padding-bottom:14px;gap:12px}
.m-logo img{height:52px}
.m-header .m-ad{flex:1 1 100%;min-height:60px}
.m-nav .m-wrap{flex-wrap:wrap;height:auto;padding:0}
.m-nav__home{height:52px}
.m-nav__menu{order:3;flex:1 1 100%;height:48px;border-top:1px solid #43464E}
.m-nav__search{margin-left:auto}
.m-head h2{font-size:24px}
.m-footer__brand img{height:96px}
.m-credit{flex-wrap:wrap;justify-content:center;text-align:center;font-size:15px;border-radius:18px}
.m-sidebar{position:static}
.m-lb-p,.m-lb-n{top:auto!important;bottom:24px}
}
