/*
Theme Name: TVS Sleek
Theme URI: https://voiceofsikkim.com
Author: AIDIGITECH
Author URI: https://aidt.in
Description: A fast, mobile-first news theme for The Voice Of Sikkim. One-column story feed, section strip, bottom tab bar on phones, Load more news button, WhatsApp sharing, ad slots, dark mode and clean NewsArticle markup.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tvs-sleek
Tags: news, blog, one-column, two-columns, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, accessibility-ready
*/

/* ==========================================================================
   1. Tokens
   ========================================================================== */
:root {
	--bg: #ffffff;
	--ink: #000000;
	--ink-2: #383838;
	--muted: #666666;
	--line: #d9d9d9;
	--chip: #f1f1f1;
	--accent: var(--ink);
	--on-accent: var(--bg);
	--serif: "Times New Roman", Times, "Liberation Serif", "Nimbus Roman", serif;
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--tabbar-h: 3.6rem;
	--read: 46rem;
	--wide: 70rem;
	color-scheme: light dark;
}

html[data-theme="dark"] {
	--bg: #000000;
	--ink: #ffffff;
	--ink-2: #d2d2d2;
	--muted: #9b9b9b;
	--line: #2b2b2b;
	--chip: #161616;
}

@media (prefers-color-scheme: dark) {
	html:not([data-theme="light"]) {
		--bg: #000000;
		--ink: #ffffff;
		--ink-2: #d2d2d2;
		--muted: #9b9b9b;
		--line: #2b2b2b;
		--chip: #161616;
	}
}

/* ==========================================================================
   2. Base
   ========================================================================== */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 1rem;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}

img,
video,
iframe {
	max-width: 100%;
}

img {
	height: auto;
}

a {
	color: inherit;
}

:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 2px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: 0.5rem;
	top: -4rem;
	z-index: 100;
	padding: 0.75rem 1rem;
	background: var(--ink);
	color: var(--bg);
	font-weight: 700;
	text-decoration: none;
}

.skip-link:focus {
	top: 0.5rem;
}

.wrap {
	width: 100%;
	max-width: var(--wide);
	margin-inline: auto;
	padding-left: max(1rem, env(safe-area-inset-left, 0px));
	padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

.wrap--read {
	max-width: var(--read);
}

/* ==========================================================================
   3. Masthead and section strip
   ========================================================================== */
.masthead {
	padding-top: env(safe-area-inset-top, 0px);
	background: var(--bg);
	border-bottom: 2px solid var(--ink);
}

.masthead__row {
	display: grid;
	grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
	align-items: center;
	padding-block: 0.75rem 0.65rem;
}

.masthead__row > :first-child {
	justify-self: start;
	margin-left: -0.6rem;
}

.masthead__row > :last-child {
	justify-self: end;
	margin-right: -0.6rem;
}

.brand {
	text-align: center;
	min-width: 0;
}

.brand__name {
	margin: 0;
	font-family: var(--serif);
	font-weight: 700;
	font-size: clamp(1.4rem, 6.4vw, 2.9rem);
	line-height: 1.05;
	letter-spacing: -0.01em;
	text-wrap: balance;
}

.brand__name a {
	color: inherit;
	text-decoration: none;
}

.brand__tag {
	margin: 0.25rem 0 0;
	font-family: var(--serif);
	font-size: clamp(0.85rem, 2.8vw, 1.1rem);
	line-height: 1.2;
	color: var(--ink-2);
}

.brand .custom-logo-link {
	display: inline-block;
}

.brand .custom-logo {
	display: block;
	width: auto;
	max-height: 3.5rem;
}

.iconbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--ink);
	cursor: pointer;
}

.icon {
	width: 1.45rem;
	height: 1.45rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.75;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.icon-sun {
	display: none;
}

html[data-theme="dark"] .icon-sun {
	display: block;
}

html[data-theme="dark"] .icon-moon {
	display: none;
}

@media (prefers-color-scheme: dark) {
	html:not([data-theme="light"]) .icon-sun {
		display: block;
	}

	html:not([data-theme="light"]) .icon-moon {
		display: none;
	}
}

.catnav {
	position: sticky;
	top: env(safe-area-inset-top, 0px);
	z-index: 20;
	background: var(--bg);
	border-bottom: 1px solid var(--line);
}

.catnav__list {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.catnav__list::-webkit-scrollbar {
	display: none;
}

.catnav__list a {
	display: block;
	padding: 0.85rem 0.95rem 0.7rem;
	border-bottom: 3px solid transparent;
	font-size: 0.92rem;
	font-weight: 600;
	color: var(--ink-2);
	text-decoration: none;
	white-space: nowrap;
}

.catnav__list a:hover {
	color: var(--ink);
}

.catnav__list .current-menu-item > a,
.catnav__list .current-menu-ancestor > a,
.catnav__list a[aria-current] {
	color: var(--ink);
	border-bottom-color: var(--accent);
}

/* ==========================================================================
   4. Headings for list pages
   ========================================================================== */
.section-head {
	max-width: var(--read);
	margin-inline: auto;
	padding-block: 1.4rem 0.35rem;
}

.section-head__title {
	margin: 0;
	font-family: var(--serif);
	font-size: clamp(1.7rem, 5.2vw, 2.4rem);
	font-weight: 700;
	line-height: 1.1;
}

.section-head__desc {
	margin-top: 0.4rem;
	color: var(--ink-2);
}

.block-title {
	margin: 1.75rem 0 0.5rem;
	font-family: var(--serif);
	font-size: 1.35rem;
	font-weight: 700;
}

.empty {
	max-width: var(--read);
	margin: 1.5rem auto;
	color: var(--ink-2);
}

/* ==========================================================================
   5. Feed and story cards
   ========================================================================== */
.feed {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	max-width: var(--read);
	margin-inline: auto;
}

.card {
	display: block;
	padding-block: 1.25rem;
	border-bottom: 1px solid var(--line);
}

.card__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	margin-bottom: 0.85rem;
	overflow: hidden;
	background: var(--chip);
}

.card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.card__play {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
}

.card__play span {
	display: grid;
	place-items: center;
	width: 3.5rem;
	height: 3.5rem;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.75);
	color: #ffffff;
}

.card__play svg {
	width: 1.5rem;
	height: 1.5rem;
	margin-left: 0.12rem;
	fill: currentColor;
}

.card__cat {
	display: inline-block;
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--ink);
	text-decoration: none;
}

.card__cat:hover {
	text-decoration: underline;
}

.card__title {
	margin: 0.25rem 0 0.5rem;
	font-family: var(--serif);
	font-size: 1.4rem;
	font-weight: 700;
	line-height: 1.2;
	text-wrap: balance;
}

.card__title a {
	color: inherit;
	text-decoration: none;
}

.card__title a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.card__excerpt {
	display: -webkit-box;
	margin: 0 0 0.75rem;
	overflow: hidden;
	font-size: 0.95rem;
	color: var(--ink-2);
	-webkit-line-clamp: 4;
	line-clamp: 4;
	-webkit-box-orient: vertical;
}

.card__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.25rem 0.75rem;
}

.card__time {
	font-size: 0.8rem;
	color: var(--muted);
}

.card__actions {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

.link {
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.pill {
	display: inline-flex;
	align-items: center;
	min-height: 2.5rem;
	padding: 0 0.95rem;
	border: 1px solid var(--ink);
	border-radius: 999px;
	background: transparent;
	color: var(--ink);
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.pill:hover {
	background: var(--ink);
	color: var(--bg);
}

/* Advertisement slots */
.ad {
	grid-column: 1 / -1;
	margin: 0;
	padding-block: 1rem 1.25rem;
	border-bottom: 1px solid var(--line);
	text-align: center;
}

.ad__label {
	display: block;
	margin-bottom: 0.4rem;
	font-size: 0.72rem;
	color: var(--muted);
}

.ad__body {
	max-width: 100%;
	overflow: hidden;
}

.ad__body img,
.ad__body iframe {
	max-width: 100%;
}

.ad--article_top,
.ad--article_end {
	margin-block: 1.25rem;
	border-block: 1px solid var(--line);
}

/* Load more */
.feed-more {
	max-width: var(--read);
	margin-inline: auto;
	padding-block: 1.5rem 2rem;
	text-align: center;
}

.btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 3rem;
	padding: 0 1.25rem;
	border: 1px solid var(--ink);
	border-radius: 0;
	background: transparent;
	color: var(--ink);
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}

.btn:hover {
	background: var(--accent);
	color: var(--on-accent);
}

.btn[aria-disabled="true"] {
	opacity: 0.6;
	cursor: progress;
}

.feed-status {
	margin: 0.75rem 0 0;
	min-height: 1.2em;
	font-size: 0.88rem;
	color: var(--muted);
}

.pagination {
	max-width: var(--read);
	margin: 1.5rem auto 2rem;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
	padding: 0 0.9rem;
	border: 1px solid var(--line);
	font-weight: 600;
	text-decoration: none;
}

.pagination .current {
	border-color: var(--ink);
	background: var(--ink);
	color: var(--bg);
}

/* ==========================================================================
   6. Single story
   ========================================================================== */
.article {
	padding-block: 1.25rem 2rem;
}

.article__cat {
	display: inline-block;
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--ink);
	text-decoration: none;
}

.article__cat:hover {
	text-decoration: underline;
}

.article__title {
	margin: 0.3rem 0 0.9rem;
	font-family: var(--serif);
	font-size: clamp(1.75rem, 5.2vw, 2.75rem);
	font-weight: 700;
	line-height: 1.12;
	letter-spacing: -0.01em;
	text-wrap: balance;
}

.byline {
	display: grid;
	gap: 0.1rem;
	padding-block: 0.75rem;
	border-block: 1px solid var(--line);
	font-size: 0.875rem;
	color: var(--ink-2);
}

.byline p {
	margin: 0;
}

.byline a {
	font-weight: 700;
	color: var(--ink);
	text-decoration: none;
}

.byline a:hover {
	text-decoration: underline;
}

.byline__by strong {
	color: var(--ink);
}

.byline__time {
	color: var(--muted);
}

.article__media {
	margin: 1rem 0 0;
}

.article__media img {
	display: block;
	width: 100%;
	height: auto;
}

.article__media figcaption {
	padding-top: 0.5rem;
	font-size: 0.82rem;
	color: var(--muted);
}

@media (max-width: 46rem) {
	.article__media {
		margin-inline: -1rem;
	}

	.article__media figcaption {
		padding-inline: 1rem;
	}
}

.entry {
	margin-top: 1.25rem;
	font-family: var(--serif);
	font-size: 1.2rem;
	line-height: 1.7;
	overflow-wrap: break-word;
}

.entry > * {
	margin-block: 0 1.15em;
}

.entry a {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.entry h2,
.entry h3,
.entry h4 {
	margin-block: 1.6em 0.5em;
	font-family: var(--serif);
	line-height: 1.2;
	text-wrap: balance;
}

.entry h2 {
	font-size: 1.6rem;
}

.entry h3 {
	font-size: 1.35rem;
}

.entry h4 {
	font-size: 1.15rem;
}

.entry figure {
	margin-inline: 0;
}

.entry figcaption,
.entry .wp-caption-text {
	margin-top: 0.4rem;
	font-family: var(--sans);
	font-size: 0.82rem;
	line-height: 1.4;
	color: var(--muted);
}

.entry blockquote {
	margin-inline: 0;
	padding-left: 1rem;
	border-left: 3px solid var(--ink);
	font-style: italic;
}

.entry ul,
.entry ol {
	padding-left: 1.4em;
}

.entry table {
	display: block;
	width: 100%;
	overflow-x: auto;
	border-collapse: collapse;
	font-family: var(--sans);
	font-size: 0.95rem;
}

.entry th,
.entry td {
	padding: 0.5rem 0.7rem;
	border: 1px solid var(--line);
	text-align: left;
}

.entry iframe[src*="youtube"],
.entry iframe[src*="youtu.be"] {
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
}

.entry .alignleft,
.entry .alignright {
	float: none;
	margin-inline: 0;
}

.share {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-block: 1.5rem 1rem;
}

.tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 1.25rem 0;
	padding: 0;
	list-style: none;
}

.tags a {
	display: inline-flex;
	align-items: center;
	min-height: 2.25rem;
	padding: 0 0.8rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	font-size: 0.85rem;
	text-decoration: none;
}

.tags a:hover {
	border-color: var(--ink);
}

.related {
	margin-top: 2rem;
	padding-top: 0.75rem;
	border-top: 2px solid var(--ink);
}

.related__title {
	margin: 0 0 0.35rem;
	font-family: var(--serif);
	font-size: 1.3rem;
}

.related__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.related__item {
	padding-block: 0.8rem;
	border-bottom: 1px solid var(--line);
}

.related__item a {
	display: block;
	font-family: var(--serif);
	font-size: 1.12rem;
	font-weight: 700;
	line-height: 1.25;
	text-decoration: none;
}

.related__item a:hover {
	text-decoration: underline;
}

.related__item time {
	font-size: 0.8rem;
	color: var(--muted);
}

/* Comments */
.comments {
	margin-top: 2rem;
	font-size: 0.95rem;
}

.comments__title {
	font-family: var(--serif);
	font-size: 1.3rem;
}

.comments__list {
	padding-left: 1.25rem;
}

.comments .comment-body {
	padding-block: 0.75rem;
	border-bottom: 1px solid var(--line);
}

.comments input[type="text"],
.comments input[type="email"],
.comments input[type="url"],
.comments textarea {
	width: 100%;
	padding: 0.7rem;
	border: 1px solid var(--ink);
	border-radius: 0;
	background: var(--bg);
	color: var(--ink);
	font: inherit;
}

.comments .submit {
	min-height: 3rem;
	padding: 0 1.25rem;
	border: 1px solid var(--ink);
	border-radius: 0;
	background: var(--accent);
	color: var(--on-accent);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

/* ==========================================================================
   7. Explore, search and utility pages
   ========================================================================== */
.tiles {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin: 0.5rem 0 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--line);
}

.tile {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 4.5rem;
	padding: 0.9rem 0;
	border-bottom: 1px solid var(--line);
	color: var(--ink);
	text-decoration: none;
}

.tile:hover .tile__name {
	text-decoration: underline;
}

.tile__name {
	font-family: var(--serif);
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.2;
}

.tile__count {
	font-size: 0.8rem;
	color: var(--muted);
}

.searchform {
	display: flex;
	max-width: var(--read);
}

.searchform input[type="search"] {
	flex: 1;
	min-width: 0;
	min-height: 3rem;
	padding: 0 0.9rem;
	border: 1px solid var(--ink);
	border-right: 0;
	border-radius: 0;
	background: var(--bg);
	color: var(--ink);
	font: inherit;
	-webkit-appearance: none;
	appearance: none;
}

.searchform button {
	min-height: 3rem;
	padding: 0 1.2rem;
	border: 1px solid var(--ink);
	border-radius: 0;
	background: var(--accent);
	color: var(--on-accent);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.page-search {
	max-width: var(--read);
	margin-inline: auto;
	padding-block: 0.5rem 1rem;
}

.notfound {
	padding-block: 2rem;
}

/* ==========================================================================
   8. Footer and tab bar
   ========================================================================== */
.site-footer {
	margin-top: 1.5rem;
	padding-block: 1.5rem 2rem;
	border-top: 2px solid var(--ink);
	font-size: 0.92rem;
	color: var(--ink-2);
}

.site-footer__brand {
	margin: 0;
	font-family: var(--serif);
	font-size: 1.6rem;
	font-weight: 700;
	line-height: 1.1;
	color: var(--ink);
}

.site-footer__tag {
	margin: 0.2rem 0 1rem;
	font-family: var(--serif);
	font-size: 1rem;
}

.footer-menu,
.social {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
	margin: 0 0 1rem;
	padding: 0;
	list-style: none;
}

.footer-menu a {
	display: inline-flex;
	align-items: center;
	min-height: 2.5rem;
	font-weight: 600;
	color: var(--ink);
	text-decoration: none;
}

.footer-menu a:hover {
	text-decoration: underline;
}

.social {
	gap: 0.5rem;
}

.site-footer__copy {
	margin: 0;
}

.tabbar {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 30;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
	background: var(--bg);
	border-top: 1px solid var(--line);
}

.tabbar a {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.15rem;
	min-height: var(--tabbar-h);
	font-size: 0.74rem;
	font-weight: 600;
	color: var(--muted);
	text-decoration: none;
}

.tabbar a[aria-current="page"] {
	color: var(--ink);
	box-shadow: inset 0 3px 0 var(--accent);
}

.tabbar .icon {
	width: 1.4rem;
	height: 1.4rem;
}

/* ==========================================================================
   9. Wider screens
   ========================================================================== */
@media (min-width: 600px) {
	.tiles {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		column-gap: 1.5rem;
	}
}

@media (min-width: 900px) {
	body {
		padding-bottom: 0;
	}

	.tabbar {
		display: none;
	}

	.section-head {
		max-width: none;
	}

	.feed,
	.feed-more,
	.empty,
	.pagination,
	.page-search {
		max-width: none;
	}

	.feed {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: 2.25rem;
	}

	.feed--video {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.feed:not(.feed--video) > .card:first-child {
		grid-column: 1 / -1;
	}

	.feed:not(.feed--video) > .card--media:first-child {
		display: grid;
		grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
		column-gap: 1.75rem;
		align-items: center;
	}

	.feed:not(.feed--video) > .card--media:first-child .card__media {
		margin: 0;
	}

	.feed:not(.feed--video) > .card:first-child .card__title {
		font-size: 2.2rem;
	}

	.btn--more {
		max-width: 24rem;
		margin-inline: auto;
	}

	.tiles {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (min-width: 46.01rem) {
	.article__media figcaption {
		padding-inline: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		scroll-behavior: auto !important;
		transition: none !important;
		animation: none !important;
	}
}

@media print {
	.masthead,
	.catnav,
	.tabbar,
	.share,
	.ad,
	.related,
	.site-footer {
		display: none !important;
	}

	body {
		padding: 0;
	}
}
