/*
Theme Name: Sahana News
Author: Sahana
Description: Fast, mobile-friendly news theme with breaking news ticker, top stories, category blocks, Google structured data and AdSense support. Kannada and English labels.
Version: 1.0.2
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sahana-news
*/

:root {
  --brand: #0A1F44;
  --black: #0D0D0D;
  --white: #FFFFFF;
  --bg: #FFFFFF;
  --soft: #F3F5F9;
  --line: #DDE2EA;
  --muted: #4A5261;
  --display: 'Baloo Tamma 2', 'Noto Sans Kannada', system-ui, sans-serif;
  --body: 'Noto Sans Kannada', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--body); background: var(--bg); color: var(--black); font-size: 17px; line-height: 1.7; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--black); text-decoration: none; }
a:hover { color: var(--brand); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #5B8DEF; outline-offset: 2px; }
h1, h2, h3 { line-height: 1.35; margin: 0; }

.screen-reader-text, .skip-link { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { left: 16px; top: 16px; width: auto; height: auto; padding: 10px 16px; background: #fff; z-index: 1000; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* Top bar */
.topbar { background: var(--black); color: #E6E6E6; font-size: 14px; }
.topbar-in { display: flex; justify-content: space-between; align-items: center; min-height: 36px; gap: 12px; }
.social { display: flex; gap: 14px; flex-wrap: wrap; }
.social a { color: inherit; font-size: 14px; }
.social a:hover { color: #fff; text-decoration: underline; }

/* Brand row */
.site-header { background: var(--white); }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 18px; padding-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--brand); }
.brand-block { width: 12px; height: 38px; background: var(--brand); }
.brand-name { font-family: var(--display); font-size: 40px; font-weight: 800; line-height: 1; }
.brand-logo img { max-height: 64px; width: auto; }
.tagline { margin: 0; font-size: 15px; color: var(--muted); text-align: right; max-width: 420px; }

/* Nav bar */
.navbar { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 40; }
.admin-bar .navbar { top: 32px; }
.nav-in { display: flex; align-items: center; gap: 8px; min-height: 52px; }
.main-nav { flex-grow: 1; min-width: 0; }
.main-nav .nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.main-nav a { display: block; color: #fff; font-weight: 600; font-size: 16px; padding: 13px 14px; }
.main-nav a:hover, .main-nav .current > a, .main-nav .current-menu-item > a, .main-nav .current-cat > a { background: rgba(0,0,0,.25); color: #fff; }
.menu-toggle, .search-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; height: 44px; background: transparent; border: 0; color: #fff; cursor: pointer; font: inherit; font-weight: 600; }
.menu-toggle { display: none; }
.search-toggle:hover, .menu-toggle:hover { background: rgba(0,0,0,.25); }
.header-search { display: none; background: var(--soft); border-bottom: 1px solid var(--line); }
.header-search.is-open { display: block; }
.hs-form { display: flex; padding: 12px 0; max-width: 640px; }
.hs-form input { flex-grow: 1; min-width: 0; height: 48px; border: 1px solid var(--line); padding: 0 14px; font: inherit; }
.hs-form button { height: 48px; padding: 0 22px; border: 0; background: var(--black); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }

/* Breaking ticker */
.ticker-bar { background: var(--white); border-bottom: 1px solid var(--line); }
.ticker-in { display: flex; align-items: center; gap: 12px; min-height: 46px; }
.ticker-label { background: #C8102E; color: #fff; font-weight: 700; font-size: 14px; padding: 5px 12px; flex-shrink: 0; letter-spacing: .3px; }
.ticker { flex-grow: 1; overflow: hidden; min-width: 0; mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.ticker-track { display: flex; width: max-content; animation: sn-marquee var(--dur, 40s) linear infinite; }
.ticker-ltr .ticker-track { animation-direction: reverse; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track, .ticker.is-paused .ticker-track { animation-play-state: paused; }
.ticker ul { list-style: none; margin: 0; padding: 0; display: flex; }
.ticker li { white-space: nowrap; padding: 0 28px 0 0; font-size: 15px; font-weight: 600; }
.ticker li::before { content: "●"; color: #C8102E; font-size: 9px; vertical-align: middle; margin-right: 10px; }
.ticker-toggle { flex-shrink: 0; width: 36px; height: 36px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 12px; color: var(--black); }
@keyframes sn-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker { overflow-x: auto; }
  .ticker-track { animation: none; }
  .ticker ul[aria-hidden] { display: none; }
  .ticker-toggle { display: none; }
}

/* Common bits */
.cat-tag { display: inline-block; align-self: flex-start; background: var(--brand); color: #fff; font-size: 13px; font-weight: 700; padding: 2px 10px; line-height: 1.7; }
.cat-tag:hover { color: #fff; background: var(--black); }
.meta { font-size: 13px; color: var(--muted); }
.empty { background: var(--soft); border: 1px dashed var(--line); padding: 20px; color: var(--muted); margin: 0; }

.thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--brand); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
a.thumb:hover img { transform: scale(1.04); }
.thumb-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.85); font-family: var(--display); font-size: 24px; font-weight: 800; text-align: center; padding: 8px; }

/* Home: top stories */
.home-main { padding-top: 24px; }
.top-stories { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.lead { display: flex; flex-direction: column; gap: 14px; }
.lead-body { display: flex; flex-direction: column; gap: 8px; }
.lead-title { font-family: var(--display); font-size: 34px; font-weight: 800; line-height: 1.3; }
.lead-title a:hover { color: var(--brand); }
.lead-excerpt { margin: 0; color: var(--muted); font-size: 17px; }
.top-side { display: flex; flex-direction: column; gap: 0; }
.top-side .list-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.top-side .list-item:first-child { padding-top: 0; }
.top-side .list-item:last-child { border-bottom: 0; }

.list-item { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; align-items: start; }
.list-thumb { aspect-ratio: 3 / 2; }
.list-thumb .thumb-empty { font-size: 14px; }
.list-title { font-size: 16px; font-weight: 700; line-height: 1.5; margin-bottom: 2px; }

/* Layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; padding-top: 28px; padding-bottom: 48px; }
.stack { display: flex; flex-direction: column; gap: 40px; min-width: 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 3px solid var(--brand); margin-bottom: 18px; gap: 12px; }
.section-head h2 { font-family: var(--display); font-size: 24px; font-weight: 800; background: var(--brand); color: #fff; padding: 6px 16px 2px; }
.section-head h2 a { color: #fff; }
.more-link { font-size: 15px; font-weight: 600; padding-bottom: 6px; color: var(--brand); white-space: nowrap; }

.cat-block { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.cat-list { display: flex; flex-direction: column; gap: 14px; }

.card { display: flex; flex-direction: column; gap: 10px; }
.card-body { display: flex; flex-direction: column; gap: 6px; }
.card-title { font-size: 19px; font-weight: 700; line-height: 1.5; }
.cat-lead .card-title { font-size: 22px; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.box { border: 1px solid var(--line); padding: 20px; }
.box h2, .box .widget-title { font-family: var(--display); font-size: 20px; font-weight: 800; color: var(--brand); border-bottom: 2px solid var(--brand); padding-bottom: 6px; margin-bottom: 10px; }
.numbered { list-style: none; margin: 0; padding: 0; }
.numbered li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 600; line-height: 1.5; }
.numbered li:last-child { border-bottom: 0; }
.num { font-family: var(--display); font-size: 24px; font-weight: 800; color: var(--brand); line-height: 1.1; }
.plain, .box ul { list-style: none; margin: 0; padding: 0; }
.box li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.box li:last-child { border-bottom: 0; }
.box-dark { background: var(--black); color: #fff; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.box-dark h2 { font-family: var(--display); font-size: 22px; font-weight: 800; }
.box-dark p { margin: 0; font-size: 15px; color: #E2E2E2; }
.btn-white { background: #fff; color: var(--black); font-weight: 700; padding: 11px 14px; text-align: center; }
.btn-white:hover { background: #E8ECF3; color: var(--black); }

/* Breadcrumbs */
.crumbs { font-size: 14px; color: var(--muted); padding-top: 18px; }
.crumbs a { color: var(--brand); }

/* Article */
.single-layout { padding-top: 12px; }
.article { min-width: 0; }
.article-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.article-title { font-family: var(--display); font-size: 38px; font-weight: 800; line-height: 1.3; }
.byline { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 0; }
.byline a { color: var(--brand); font-weight: 600; }
.article-image { margin: 0 0 22px; }
.article-image img { width: 100%; }
.article-image figcaption, .entry figcaption { font-size: 14px; color: var(--muted); padding-top: 6px; }
.entry { font-size: 18px; line-height: 1.9; }
.entry > * { margin-top: 0; margin-bottom: 1.1em; }
.entry h2 { font-family: var(--display); font-size: 26px; font-weight: 800; color: var(--brand); margin-top: 1.6em; }
.entry h3 { font-size: 21px; margin-top: 1.4em; }
.entry a { color: var(--brand); text-decoration: underline; }
.entry img { height: auto; }
.entry table { width: 100%; border-collapse: collapse; font-size: 16px; display: block; overflow-x: auto; }
.entry th, .entry td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.entry th { background: var(--brand); color: #fff; }
.entry tr:nth-child(even) td { background: var(--soft); }
.entry blockquote { margin-left: 0; padding: 12px 18px; background: var(--soft); border-left: 4px solid var(--brand); }
.entry .wp-block-button__link { background: var(--brand); color: #fff; text-decoration: none; border-radius: 0; }
.page-article { max-width: 820px; margin: 12px auto 56px; }
.page-article .article-title { margin-bottom: 20px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.tags a { background: var(--soft); padding: 4px 12px; font-size: 14px; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 22px 0; }
.share-label { font-weight: 700; margin-right: 4px; }
.share a { background: var(--black); color: #fff; padding: 8px 14px; font-size: 14px; font-weight: 700; }
.share a.share-wa { background: #0F7A3D; }
.share a:hover { opacity: .88; color: #fff; }
.author-box { display: flex; gap: 14px; align-items: center; background: var(--soft); padding: 18px; margin: 26px 0; }
.author-box img { border-radius: 50%; }
.author-name { font-weight: 700; }
.author-box p { margin: 2px 0 0; font-size: 15px; color: var(--muted); }
.related { margin-top: 32px; }
.related h2, .comments-area h2, .comment-reply-title { font-family: var(--display); font-size: 24px; font-weight: 800; color: var(--brand); border-bottom: 3px solid var(--brand); padding-bottom: 6px; margin-bottom: 18px; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 32px 0; font-weight: 600; }
.post-nav .next { text-align: right; grid-column: 2; }
.post-nav a { color: var(--brand); }

/* Archive */
.archive-head { display: flex; flex-direction: column; gap: 10px; border-bottom: 3px solid var(--brand); padding-bottom: 12px; }
.archive-head h1 { font-family: var(--display); font-size: 34px; font-weight: 800; }
.archive-desc { color: var(--muted); }
.archive-list { display: flex; flex-direction: column; gap: 22px; }
.row-card { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.row-card-body { display: flex; flex-direction: column; gap: 6px; }
.row-card-title { font-size: 21px; font-weight: 700; line-height: 1.5; }
.row-card-excerpt { margin: 0; color: var(--muted); font-size: 16px; }
.pagination { margin-top: 28px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers { border: 1px solid var(--line); padding: 8px 14px; font-weight: 600; }
.pagination .page-numbers.current { background: var(--brand); color: #fff; border-color: var(--brand); }
.search-form { display: flex; max-width: 560px; }
.search-form label { flex-grow: 1; }
.search-form .search-field { width: 100%; height: 48px; border: 1px solid var(--line); padding: 0 14px; font: inherit; }
.search-form .search-submit { height: 48px; padding: 0 20px; border: 0; background: var(--black); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }

/* Comments */
.comments-area { margin-top: 32px; font-size: 16px; }
.comments-area label { display: block; font-weight: 600; margin-bottom: 4px; }
.comments-area .comment-form-cookies-consent label { display: inline; font-weight: 400; }
.comments-area textarea, .comments-area input[type=text], .comments-area input[type=email], .comments-area input[type=url] { width: 100%; border: 1px solid var(--line); padding: 10px; font: inherit; }
.comments-area .submit { background: var(--brand); color: #fff; border: 0; padding: 12px 24px; font: inherit; font-weight: 700; cursor: pointer; }
.comment-list { list-style: none; padding: 0; }
.comment-list .comment-body { border: 1px solid var(--line); padding: 14px; margin-bottom: 12px; }

/* Footer */
.site-footer { background: var(--black); color: #fff; }
.footer-in { padding-top: 44px; padding-bottom: 24px; display: flex; flex-direction: column; gap: 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-brand { font-family: var(--display); font-size: 30px; font-weight: 800; }
.footer-col p { margin: 0; font-size: 15px; color: #CFCFCF; }
.footer-title { font-weight: 700; font-size: 17px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-col a { color: #E6E6E6; font-size: 15px; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.social-foot a { background: #262626; padding: 6px 12px; }
.footer-bottom { border-top: 1px solid #333; padding-top: 18px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 14px; color: #BDBDBD; }
.to-top { color: #fff; }

/* WordPress classes */
.alignleft { float: left; margin: 0 20px 12px 0; }
.alignright { float: right; margin: 0 0 12px 20px; }
.aligncenter { margin-left: auto; margin-right: auto; }
.sticky, .bypostauthor, .wp-caption, .gallery-caption { }

/* Tablet */
@media (max-width: 1024px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .top-stories { grid-template-columns: minmax(0, 1fr); }
}

/* Mobile */
@media (max-width: 782px) {
  .admin-bar .navbar { top: 0; }
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .topbar .social-top { display: none; }
  .brand-row { padding-top: 12px; padding-bottom: 12px; }
  .brand-name { font-size: 30px; }
  .brand-block { width: 9px; height: 28px; }
  .tagline { display: none; }
  .nav-in { justify-content: space-between; }
  .menu-toggle { display: inline-flex; padding: 0 10px; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--brand); border-top: 1px solid rgba(255,255,255,.15); max-height: 70vh; overflow-y: auto; }
  .main-nav.is-open { display: block; }
  .main-nav .nav-list { flex-direction: column; padding: 4px 16px 12px; }
  .main-nav a { border-bottom: 1px solid rgba(255,255,255,.12); padding: 12px 4px; }
  .ticker-label { font-size: 13px; padding: 4px 8px; }
  .ticker li { font-size: 14px; }
  .home-main { padding-top: 16px; }
  .lead-title { font-size: 25px; }
  .lead-excerpt { display: none; }
  .list-item { grid-template-columns: 104px minmax(0, 1fr); gap: 12px; }
  .list-title { font-size: 15px; }
  .cat-block { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .card-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .section-head h2 { font-size: 20px; }
  .stack { gap: 32px; }
  .article-title { font-size: 27px; }
  .entry { font-size: 17px; }
  .row-card { grid-template-columns: 120px minmax(0, 1fr); gap: 12px; }
  .row-card-title { font-size: 16px; }
  .row-card-excerpt { display: none; }
  .archive-head h1 { font-size: 26px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { grid-column: 1; text-align: left; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
