/*
Theme Name: AltLipi
Theme URI: https://altlipi.com/
Author: PlanckRED
Description: Clean, fast, secure news theme for AltLipi — The Alternate Opinion. Reads content from the former Newspaper-theme database without tagDiv Composer or WPBakery. Breaking ticker, video & gallery posts, ad slots, language switcher.
Version: 1.0.0
Requires at least: 6.2
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: altlipi
Tags: news, blog, two-columns, custom-logo, custom-menu, featured-images, post-formats, translation-ready
*/

/* ---------- Tokens ---------- */
:root {
	--accent: #e05560;
	--ink: #14161a;
	--ink-2: #3b3f46;
	--muted: #6b7079;
	--line: #e7e7ea;
	--soft: #f6f6f4;
	--bg: #fff;
	--max: 1240px;
	--narrow: 760px;
	--radius: 6px;
	--sans: "Inter", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif;
	--serif: "Merriweather", "Noto Sans Devanagari", Georgia, serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--bg); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img, video, iframe { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; }
button { font: inherit; cursor: pointer; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.wrap--narrow { max-width: calc(var(--narrow) + 40px); }
.wrap--media { max-width: 1040px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Top bar ---------- */
.topbar { font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.topbar__inner { display: flex; align-items: center; gap: 20px; min-height: 38px; }
.topbar__menu { list-style: none; display: flex; gap: 16px; margin: 0; padding: 0; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.lang { display: flex; gap: 4px; }
.lang button, .lang a { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 2px 10px; font-size: 12px; color: var(--ink-2); }
.lang .on, .lang button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.socials { list-style: none; display: flex; gap: 12px; margin: 0; padding: 0; font-size: 13px; font-weight: 600; }

/* ---------- Masthead ---------- */
.masthead__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 20px; }
.site-logo img, .custom-logo { max-height: 72px; width: auto; }
.site-logo__text { font-family: var(--serif); font-weight: 900; font-size: 40px; letter-spacing: -.5px; }
.site-logo__text::first-letter { color: var(--accent); }
.brand__tagline { margin: 4px 0 0; font-size: 13px; color: var(--muted); letter-spacing: .3px; text-transform: uppercase; }
.ad--leader { flex: 0 1 728px; }

/* ---------- Nav ---------- */
.mainnav { position: sticky; top: 0; z-index: 50; background: #fff; border-top: 3px solid var(--ink); border-bottom: 1px solid var(--line); }
.admin-bar .mainnav { top: 32px; }
.mainnav__inner { display: flex; align-items: center; gap: 16px; }
.mainnav .menu { list-style: none; display: flex; gap: 26px; margin: 0; padding: 0; flex: 1; }
.mainnav .menu > li { position: static; }
.mainnav .menu > li > a { display: block; padding: 14px 0; font-weight: 700; font-size: 15px; }
.mainnav .current-menu-item > a, .mainnav .current-category-ancestor > a { box-shadow: inset 0 -3px var(--accent); }
.mainnav .sub-menu { display: none; position: absolute; list-style: none; margin: 0; padding: 8px 0; background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.08); min-width: 200px; }
.mainnav .menu > li:hover > .sub-menu, .mainnav .menu > li:focus-within > .sub-menu { display: block; }
.mainnav .sub-menu a { display: block; padding: 8px 16px; font-size: 14px; }
.mega { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 14px 30px rgba(0,0,0,.08); padding: 22px 0; }
.mega__grid { max-width: var(--max); margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.mega .card__title { font-size: 15px; }
.has-mega:hover > .mega, .has-mega:focus-within > .mega { display: block; }
.navsearch input { border: 1px solid var(--line); border-radius: 20px; padding: 7px 14px; width: 180px; font: inherit; font-size: 14px; }
.nav-toggle { display: none; background: none; border: 0; width: 40px; height: 40px; position: relative; }
.nav-toggle span:first-child, .nav-toggle span:first-child::before, .nav-toggle span:first-child::after { content: ""; position: absolute; left: 9px; width: 22px; height: 2px; background: var(--ink); }
.nav-toggle span:first-child { top: 19px; }
.nav-toggle span:first-child::before { top: -7px; left: 0; }
.nav-toggle span:first-child::after { top: 7px; left: 0; }

/* ---------- Ticker ---------- */
.ticker { background: var(--ink); color: #fff; font-size: 14px; }
.ticker__inner { display: flex; align-items: center; gap: 14px; height: 42px; }
.ticker__label { flex: none; background: var(--accent); padding: 4px 10px; border-radius: 3px; font-size: 12px; letter-spacing: .6px; text-transform: uppercase; }
.ticker__track { overflow: hidden; flex: 1; -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.ticker__items { display: inline-flex; white-space: nowrap; animation: al-ticker 60s linear infinite; }
.ticker__items a, .ticker__dup a { margin-right: 48px; }
.ticker__items a::before { content: "●"; color: var(--accent); font-size: 9px; margin-right: 10px; vertical-align: 2px; }
.ticker__items:hover { animation-play-state: paused; }
@keyframes al-ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker__items { animation: none; } .ticker__dup { display: none; } }

/* ---------- Shared bits ---------- */
.kicker { display: inline-block; color: var(--accent); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 6px; }
.meta { font-size: 13px; color: var(--muted); margin-top: 6px; }
.meta a { color: var(--ink-2); font-weight: 600; }
.dot { margin: 0 6px; }
.label { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin: 0 0 12px; }
.thumb { display: block; position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: linear-gradient(135deg, #e9ebee, #f6f7f8); }
.thumb::after { content: ""; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24' fill='none' stroke='%23c4c8ce' stroke-width='1.5'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='9' cy='10' r='2'/%3E%3Cpath d='M21 17l-5-5-9 7'/%3E%3C/svg%3E") center no-repeat; z-index: 0; }
.thumb img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .thumb img { transform: scale(1.03); }
.play { position: absolute; z-index: 2; left: 12px; bottom: 12px; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); }
.play::after { content: ""; position: absolute; left: 17px; top: 13px; border-left: 14px solid #fff; border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
.gal-badge { position: absolute; z-index: 2; right: 10px; top: 10px; background: rgba(0,0,0,.7); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 3px; text-transform: uppercase; }
.numbered { list-style: none; margin: 0; padding: 0; counter-reset: n; }
.numbered li { counter-increment: n; display: grid; grid-template-columns: 30px 1fr; padding: 11px 0; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 15px; line-height: 1.35; }
.numbered li::before { content: counter(n); color: var(--accent); font-size: 22px; font-weight: 800; line-height: 1; }
.numbered time { grid-column: 2; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ---------- Cards ---------- */
.card__title { font-size: 18px; font-weight: 800; margin: 10px 0 0; letter-spacing: -.2px; }
.card--card .card__body { padding-top: 10px; }
.card--card .kicker { margin-top: 2px; }
.card__excerpt { color: var(--muted); font-size: 15px; margin: 8px 0 0; }
.card--row { display: grid; grid-template-columns: 240px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.card--row:first-child { padding-top: 0; }
.card--row .card__title { margin-top: 0; font-size: 20px; }
.card--mini { padding: 14px 0; border-top: 1px solid var(--line); }
.card--mini .card__title { font-size: 16px; margin-top: 0; }

/* ---------- Homepage ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 32px; padding: 30px 0; border-bottom: 1px solid var(--line); }
.hero__lead .thumb { margin-bottom: 14px; }
.hero__title { font-family: var(--serif); font-size: 34px; line-height: 1.18; letter-spacing: -.4px; margin: 6px 0 10px; }
.hero__dek { color: var(--ink-2); font-size: 17px; margin: 0; }
.section { padding: 36px 0; border-bottom: 1px solid var(--line); }
.section__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; }
.section__head h2 { font-size: 24px; font-weight: 800; padding-left: 14px; position: relative; margin: 0; }
.section__head h2::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 5px; border-radius: 2px; background: var(--accent); }
.more { font-size: 14px; color: var(--muted); font-weight: 600; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; align-content: start; }
.with-side { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; }
.side .widget { margin-bottom: 28px; }
.widget-title { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; margin-bottom: 6px; }
.band--video { background: #0f1013; color: #fff; padding: 40px 0; margin: 0; }
.band--video .section__head h2, .band--video .card__title a { color: #fff; }
.band--video .meta, .band--video .more { color: #a3a7ae; }
.band--video .meta a { color: #d8dade; }
.band--video .thumb { background: linear-gradient(135deg, #24262c, #3a3e46); }
.vgrid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 22px; }
.vgrid .card:first-child .card__title { font-size: 24px; }
.mosaic { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 130px; gap: 8px; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; background: var(--soft); }
.mosaic img:nth-child(1) { grid-column: span 3; grid-row: span 2; }
.mosaic img:nth-child(n+2) { grid-column: span 3; }
.mosaic img:nth-child(n+4) { display: none; }
.mosaic__title { margin-top: 12px; font-size: 18px; }

/* ---------- Ads ---------- */
.ad { text-align: center; margin: 24px auto; }
.ad__label { display: block; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: #a0a4ab; margin-bottom: 4px; }
.ad--empty { background: var(--soft); border: 1px dashed #cfd2d6; color: #9aa0a6; font-size: 12px; padding: 30px; }
.masthead .ad { margin: 0; }
.ad--wide { padding: 10px 0; }

/* ---------- Article ---------- */
.article__head { padding-top: 34px; }
.article__title { font-family: var(--serif); font-size: 40px; line-height: 1.16; letter-spacing: -.5px; margin: 6px 0 14px; }
.article__dek { font-size: 20px; color: var(--ink-2); margin: 0 0 20px; }
.article__byline { display: flex; align-items: center; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.article__byline img { border-radius: 50%; }
.article__byline .author { font-weight: 700; }
.article__byline .meta { margin: 0; }
.article__tools { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.share { display: flex; gap: 6px; }
.share a, .share button, .listen { font-size: 12px; font-weight: 700; border: 1px solid var(--line); border-radius: 20px; padding: 5px 11px; background: #fff; color: var(--ink-2); }
.listen { background: var(--ink); color: #fff; border-color: var(--ink); }
.listen[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.article__media { margin-top: 26px; }
.feature { margin: 0; }
.feature img { width: 100%; border-radius: var(--radius); }
.feature figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
.video-embed iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border-radius: var(--radius); }
.article__layout { display: grid; grid-template-columns: minmax(0, var(--narrow)) 300px; gap: 60px; justify-content: center; padding-top: 30px; }
.entry-content { font-family: var(--serif); font-size: 19px; line-height: 1.75; color: #1d2025; }
.entry-content p { margin: 0 0 1.25em; }
.entry-content h2, .entry-content h3 { font-family: var(--sans); margin-top: 1.6em; }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.entry-content img { border-radius: 4px; }
.entry-content blockquote, .pullquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--accent); font-size: 22px; font-style: italic; color: var(--ink); }
.entry-content blockquote p { margin: 0; }
.entry-content figure { margin: 1.6em 0; }
.entry-content figcaption, .wp-caption-text { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.entry-content .ad { font-family: var(--sans); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 30px 0; font-family: var(--sans); }
.tags a { font-size: 13px; background: var(--soft); padding: 4px 12px; border-radius: 20px; text-decoration: none; color: var(--ink-2); }
.authorbox { display: flex; gap: 16px; padding: 20px; background: var(--soft); border-radius: var(--radius); font-family: var(--sans); font-size: 15px; }
.authorbox img { border-radius: 50%; }
.authorbox p { margin: 6px 0 0; color: var(--ink-2); }
.side .sticky { position: sticky; top: 80px; }
.related { border-bottom: 0; }

/* ---------- Gallery + lightbox ---------- */
.al-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.al-gallery__item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; background: var(--soft); }
.lightbox { position: fixed; inset: 0; background: rgba(10,10,12,.94); z-index: 200; display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 90vw; text-align: center; color: #ddd; }
.lightbox img { max-height: 82vh; width: auto; margin: 0 auto; }
.lightbox figcaption { margin-top: 10px; font-size: 14px; }
.lightbox button { position: absolute; background: none; border: 0; color: #fff; font-size: 44px; padding: 10px 18px; }
.lightbox__close { top: 10px; right: 10px; }
.lightbox__prev { left: 10px; }
.lightbox__next { right: 10px; }

/* ---------- Archives, pages, misc ---------- */
.archive-head { padding: 34px 0 20px; border-bottom: 1px solid var(--line); margin-bottom: 28px; display: grid; gap: 8px; }
.archive-head img { border-radius: 50%; }
.archive-title { font-size: 36px; font-weight: 800; letter-spacing: -.4px; margin: 0; }
.archive-title span { color: var(--muted); font-weight: 400; }
.archive-desc { color: var(--ink-2); max-width: 680px; }
.subcats { display: flex; flex-wrap: wrap; gap: 8px; }
.subcats a { font-size: 13px; border: 1px solid var(--line); padding: 4px 12px; border-radius: 20px; }
.archive-lead { margin-bottom: 30px; }
.archive-lead .card--row { grid-template-columns: 1.3fr 1fr; border: 0; }
.archive-lead .card__title { font-family: var(--serif); font-size: 30px; }
.page-article { padding-top: 34px; padding-bottom: 40px; }
.nav-links { display: flex; gap: 6px; justify-content: center; padding: 36px 0; }
.page-numbers { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 20px; padding: 0 12px; font-weight: 600; }
.page-numbers.current { background: var(--ink); color: #fff; border-color: var(--ink); }
.searchform { display: flex; gap: 8px; max-width: 520px; }
.searchform input { flex: 1; border: 1px solid var(--line); border-radius: 24px; padding: 10px 16px; font: inherit; }
.searchform button { border: 0; background: var(--accent); color: #fff; border-radius: 24px; padding: 10px 20px; font-weight: 700; }
.notfound { text-align: center; padding: 60px 20px; }
.notfound .searchform { margin: 20px auto 40px; }
.notfound__code { font-size: 96px; font-weight: 900; color: var(--accent); margin: 0; line-height: 1; }
.empty { padding: 40px 0; color: var(--muted); }
.comments { padding: 30px 0 50px; }
.comment-list { list-style: none; padding: 0; }
.comment-form input, .comment-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 10px; font: inherit; }
.comment-form .submit { width: auto; background: var(--ink); color: #fff; border: 0; padding: 10px 20px; border-radius: 20px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--soft); margin-top: 40px; padding: 48px 0 22px; font-size: 14px; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer__about p { color: var(--ink-2); max-width: 380px; }
.site-footer h5 { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; margin: 0 0 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; line-height: 2.1; color: var(--ink-2); }
.site-footer .socials { flex-wrap: wrap; line-height: 1.4; }
.footer__copy { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 32px; padding-top: 16px; color: var(--muted); font-size: 12px; }

/* ---------- Google Translate tidy-up (language switcher) ---------- */
.skiptranslate iframe, .goog-te-banner-frame { display: none !important; }
body { top: 0 !important; }
#google_translate_element { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
	.hero { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
	.hero__latest { grid-column: 1 / -1; }
	.grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.article__layout { grid-template-columns: minmax(0, 1fr); }
	.article__layout .side { display: none; }
	.ad--leader { display: none; }
}
@media (max-width: 860px) {
	.nav-toggle { display: block; }
	.mainnav .menu { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 20px; }
	.mainnav.is-open .menu { display: flex; }
	.mainnav .menu > li > a { padding: 12px 0; border-bottom: 1px solid var(--line); }
	.mega, .has-mega:hover > .mega { display: none; }
	.mainnav .sub-menu { position: static; display: block; border: 0; box-shadow: none; padding-left: 12px; }
	.navsearch { margin-left: auto; }
	.navsearch input { width: 150px; }
	.with-side { grid-template-columns: minmax(0, 1fr); }
	.grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.vgrid { grid-template-columns: 1fr; }
	.footer__grid { grid-template-columns: 1fr 1fr; }
	.topbar__menu, .socials--top { display: none; }
}
@media (max-width: 600px) {
	.hero { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.hero__title { font-size: 26px; }
	.grid4, .grid3 { grid-template-columns: minmax(0, 1fr); }
	.card--row { grid-template-columns: 120px 1fr; gap: 14px; }
	.card--row .card__title { font-size: 16px; }
	.card--row .card__excerpt { display: none; }
	.archive-lead .card--row { grid-template-columns: 1fr; }
	.article__title { font-size: 28px; }
	.article__dek { font-size: 17px; }
	.entry-content { font-size: 18px; }
	.article__tools { margin-left: 0; }
	.site-logo__text { font-size: 30px; }
	.site-logo img, .custom-logo { max-height: 52px; }
	.footer__grid { grid-template-columns: 1fr; }
	.mosaic { grid-auto-rows: 90px; }
}
