/*
Theme Name: State Desk
Theme URI: https://github.com/deshabhishek007/statedesk
Author: Abhishek Deshpande
Description: Text-led block theme for state news sites (news.gujarat.in, maharashtra.today, news.bihar.in). Style variations per state, light and dark mode, reserved AdSense slots.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
License: GPL-2.0-or-later
Text Domain: statedesk
*/

html[data-theme="dark"] {
	color-scheme: dark;
	--wp--preset--color--canvas: var(--wp--custom--dark--canvas);
	--wp--preset--color--surface: var(--wp--custom--dark--surface);
	--wp--preset--color--ink: var(--wp--custom--dark--ink);
	--wp--preset--color--muted: var(--wp--custom--dark--muted);
	--wp--preset--color--line: var(--wp--custom--dark--line);
	--wp--preset--color--accent-ink: var(--wp--custom--dark--accent-ink);
	--wp--preset--color--tint: var(--wp--custom--dark--tint);
	--wp--preset--color--alert: var(--wp--custom--dark--alert);
	--wp--preset--color--alert-tint: var(--wp--custom--dark--alert-tint);
	--wp--preset--color--footer: var(--wp--custom--dark--footer);
}

:root {
	--sd-canvas: var(--wp--preset--color--canvas);
	--sd-surface: var(--wp--preset--color--surface);
	--sd-ink: var(--wp--preset--color--ink);
	--sd-muted: var(--wp--preset--color--muted);
	--sd-line: var(--wp--preset--color--line);
	--sd-accent: var(--wp--preset--color--accent);
	--sd-accent-ink: var(--wp--preset--color--accent-ink);
	--sd-tint: var(--wp--preset--color--tint);
	--sd-alert: var(--wp--preset--color--alert);
	--sd-alert-tint: var(--wp--preset--color--alert-tint);
	--sd-heading: var(--wp--preset--font-family--heading);
	--sd-track: var(--wp--custom--heading--tracking);
	--sd-lead: var(--wp--custom--heading--leading);
	--sd-radius: 24px;
	--sd-radius-s: 16px;
}

body {
	margin: 0;
	-webkit-font-smoothing: antialiased;
}

a {
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.sd-wrap {
	max-width: 1240px;
	margin-inline: auto;
	padding-inline: 20px;
	box-sizing: border-box;
	width: 100%;
}

.sd-plain,
.sd-plain a,
a.sd-plain {
	color: inherit;
	text-decoration: none;
}

.sd-plain a:hover,
a.sd-plain:hover {
	text-decoration: underline;
}

.sd-h {
	font-family: var(--sd-heading);
	font-weight: 800;
	letter-spacing: var(--sd-track);
	line-height: var(--sd-lead);
	margin: 0;
}

.sd-meta {
	font-size: 0.8125rem;
	color: var(--sd-muted);
}

.sd-card {
	background: var(--sd-surface);
	border-radius: var(--sd-radius);
	box-sizing: border-box;
}

.sd-pill,
.sd-pills a {
	display: inline-block;
	border-radius: 999px;
	padding: 4px 10px;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.4;
	background: var(--sd-tint);
	color: var(--sd-accent-ink);
	text-decoration: none;
}

.sd-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
}

.sd-pills .wp-block-post-terms__separator {
	display: none;
}

.sd-pill--alert {
	background: var(--sd-alert-tint);
	color: var(--sd-alert);
}

.sd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 18px;
	border: 0;
	border-radius: 999px;
	font: 600 0.875rem/1 var(--wp--preset--font-family--body);
	background: var(--sd-canvas);
	color: var(--sd-ink);
	cursor: pointer;
	text-decoration: none;
	box-sizing: border-box;
}

.sd-btn--accent {
	background: var(--sd-accent);
	color: #fff;
}

.sd-btn--icon {
	width: 44px;
	padding: 0;
}

.sd-btn:focus-visible,
.sd-nav a:focus-visible,
.sd-search input:focus-visible {
	outline: 2px solid var(--sd-accent-ink);
	outline-offset: 2px;
}

/* Header */

.sd-header {
	background: var(--sd-surface);
	border-bottom: 1px solid var(--sd-line);
}

.sd-header__inner {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding-block: 16px 12px;
}

.sd-header__row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.sd-brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--sd-ink);
	text-decoration: none;
}

.sd-brand:hover {
	text-decoration: none;
}

.sd-brand__name {
	font-family: var(--sd-heading);
	font-weight: 800;
	font-size: 2.125rem;
	letter-spacing: -0.04em;
	line-height: 1;
}

[lang^="hi"] .sd-brand__name {
	letter-spacing: 0;
	line-height: 1.1;
}

.sd-brand__pill {
	border-radius: 999px;
	padding: 4px 11px;
	font-size: 0.8125rem;
	font-weight: 700;
	background: var(--sd-tint);
	color: var(--sd-accent-ink);
}

.sd-tools {
	display: flex;
	align-items: center;
	gap: 8px;
}

.sd-tools__date {
	margin-right: 8px;
}

.sd-search {
	position: relative;
	margin: 0;
}

.sd-search svg {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--sd-muted);
	pointer-events: none;
}

.sd-search input {
	height: 44px;
	width: 220px;
	border: 0;
	border-radius: 999px;
	padding: 0 16px 0 40px;
	background: var(--sd-canvas);
	color: var(--sd-ink);
	font: 500 0.875rem var(--wp--preset--font-family--body);
	box-sizing: border-box;
}

.sd-search input::placeholder {
	color: var(--sd-muted);
}

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

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

.sd-nav {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	white-space: nowrap;
	padding-bottom: 2px;
	scrollbar-width: none;
}

.sd-nav::-webkit-scrollbar {
	display: none;
}

.sd-nav a {
	border-radius: 999px;
	padding: 9px 16px;
	font-size: 0.875rem;
	font-weight: 600;
	background: var(--sd-canvas);
	color: var(--sd-ink);
	text-decoration: none;
}

.sd-nav a[aria-current="page"] {
	background: var(--sd-ink);
	color: var(--sd-canvas);
}

/* Home */

.sd-home {
	display: flex;
	flex-direction: column;
	gap: 40px;
	padding-block: 28px 56px;
}

.sd-row {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	align-items: stretch;
}

.sd-lead {
	flex: 2 1 620px;
	min-width: 0;
	min-height: 440px;
	padding: 36px;
	border-radius: var(--sd-radius);
	background: var(--sd-accent);
	color: #fff;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 32px;
	position: relative;
	overflow: hidden;
	box-sizing: border-box;
}

.sd-lead::before,
.sd-lead::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.18);
	pointer-events: none;
}

.sd-lead::before {
	width: 320px;
	height: 320px;
	right: -80px;
	top: -80px;
}

.sd-lead::after {
	width: 100px;
	height: 100px;
	right: 30px;
	top: 30px;
}

.sd-lead > * {
	position: relative;
}

.sd-lead__top {
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
	font-size: 0.8125rem;
	color: rgba(255, 255, 255, 0.9);
}

.sd-lead__kicker {
	background: rgba(255, 255, 255, 0.16);
	color: #fff;
	border-radius: 999px;
	padding: 5px 12px;
	font-size: 0.75rem;
	font-weight: 700;
}

.sd-lead__title {
	font-size: clamp(2rem, 1.2rem + 2.6vw, 3.25rem);
	max-width: 760px;
	color: #fff;
}

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

.sd-lead__dek {
	margin: 16px 0 0;
	font-size: 1.125rem;
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.92);
	max-width: 620px;
}

.sd-lead__cta {
	align-self: flex-start;
	background: #fff;
	color: var(--sd-accent);
	border-radius: 999px;
	padding: 12px 20px;
	font-size: 0.875rem;
	font-weight: 700;
	text-decoration: none;
}

.sd-latest {
	flex: 1 1 320px;
	min-width: 0;
	padding: 24px;
	display: flex;
	flex-direction: column;
}

.sd-latest__title,
.sd-section-head h2 {
	font-size: 1.375rem;
	margin-bottom: 8px;
}

.sd-numbered {
	list-style: none;
	margin: 0;
	padding: 0;
	counter-reset: sd;
}

.sd-numbered li {
	counter-increment: sd;
	display: flex;
	gap: 14px;
	padding: 12px 0;
	border-top: 1px solid var(--sd-line);
}

.sd-numbered li::before {
	content: counter(sd, decimal-leading-zero);
	font-family: var(--sd-heading);
	font-weight: 800;
	font-size: 1.375rem;
	line-height: 1.2;
	color: var(--sd-accent-ink);
	min-width: 30px;
}

.sd-numbered a {
	display: block;
	font-family: var(--sd-heading);
	font-weight: 700;
	font-size: 1.0625rem;
	letter-spacing: var(--sd-track);
	line-height: 1.3;
	color: var(--sd-ink);
	text-decoration: none;
	margin-bottom: 4px;
}

.sd-numbered a:hover,
.sd-link-list a:hover,
.sd-tile__title a:hover,
.sd-section__lead:hover {
	text-decoration: underline;
}

.sd-section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.sd-section-head h2 {
	font-size: 1.75rem;
	margin: 0;
}

.sd-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
	gap: 20px;
}

.sd-tile {
	background: var(--sd-tint);
	border-radius: 20px;
	padding: 22px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	align-items: flex-start;
}

.sd-tile .sd-pill {
	background: var(--sd-surface);
}

.sd-tile__title {
	font-size: 1.3125rem;
}

.sd-tile__title a {
	color: var(--sd-ink);
	text-decoration: none;
}

.sd-tile p {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--sd-muted);
}

.sd-section {
	padding: 12px;
	display: flex;
	flex-direction: column;
}

.sd-section__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 12px 0;
}

.sd-section__name {
	font-size: 1.625rem;
	color: var(--sd-accent-ink);
}

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

.sd-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--sd-accent);
}

.sd-section__body {
	padding: 16px 12px 8px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	align-items: flex-start;
}

.sd-section__lead {
	font-family: var(--sd-heading);
	font-weight: 800;
	font-size: 1.1875rem;
	letter-spacing: var(--sd-track);
	line-height: 1.25;
	color: var(--sd-ink);
	text-decoration: none;
	padding-bottom: 10px;
}

.sd-link-list {
	list-style: none;
	margin: 0;
	padding: 0;
	width: 100%;
}

.sd-link-list li {
	border-top: 1px solid var(--sd-line);
	padding: 12px 0;
}

.sd-link-list a {
	color: var(--sd-ink);
	text-decoration: none;
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.4;
}

.sd-more {
	margin-top: 6px;
	background: var(--sd-canvas);
	color: var(--sd-accent-ink);
	border-radius: 999px;
	padding: 8px 14px;
	font-size: 0.8125rem;
	font-weight: 600;
	text-decoration: none;
}

.sd-center {
	display: flex;
	justify-content: center;
}

/* Ads */

.sd-ad {
	display: flex;
	flex-direction: column;
	gap: 6px;
	width: 100%;
	margin-inline: auto;
}

.sd-ad__label {
	font-size: 0.6875rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--sd-muted);
}

[lang^="hi"] .sd-ad__label {
	letter-spacing: 0;
	text-transform: none;
	font-size: 0.75rem;
}

.sd-ad__unit {
	min-height: 250px;
	width: 100%;
}

.sd-ad--wide {
	max-width: 970px;
}

.sd-ad--article .sd-ad__unit {
	min-height: 280px;
}

.sd-ad--tall .sd-ad__unit {
	min-height: 600px;
}

.sd-ad--latest {
	margin-top: 12px;
}

@media (max-width: 781px) {
	.sd-ad--wide .sd-ad__unit {
		min-height: 280px;
	}
}

/* Single */

.sd-single {
	display: flex;
	flex-wrap: wrap;
	gap: 32px;
	align-items: flex-start;
	padding-block: 32px 64px;
}

.sd-single__main {
	flex: 999 1 640px;
	min-width: 0;
	max-width: 760px;
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.sd-single__main > * {
	margin-block: 0;
}

.sd-single__head {
	padding: 32px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.sd-single__head > * {
	margin: 0;
}

.sd-single__title {
	font-size: clamp(2rem, 1.3rem + 2.2vw, 3rem);
}

.sd-single__dek,
.sd-single__dek p {
	margin: 0;
	font-size: 1.25rem;
	line-height: 1.5;
	color: var(--sd-muted);
}

.sd-byline {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	padding-top: 12px;
	border-top: 1px solid var(--sd-line);
	font-size: 0.875rem;
	color: var(--sd-muted);
}

.sd-byline b {
	color: var(--sd-ink);
}

.sd-byline__share {
	display: flex;
	gap: 8px;
}

.sd-ntk {
	background: var(--sd-tint);
	border-radius: 20px;
	padding: 24px 28px;
}

.sd-ntk h2 {
	font-size: 1.25rem;
	color: var(--sd-accent-ink);
	margin: 0 0 10px;
}

.sd-ntk ul {
	margin: 0;
	padding-left: 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: 1rem;
	line-height: 1.55;
}

.sd-prose {
	font-size: 1.125rem;
	line-height: 1.75;
	padding-inline: 4px;
}

.sd-prose > * {
	margin-block: 0 1.1em;
}

.sd-prose h2 {
	font-size: 1.875rem;
	margin-top: 1.4em;
	margin-bottom: 0.5em;
}

.sd-prose h3 {
	font-size: 1.375rem;
	margin-top: 1.2em;
}

.sd-prose a {
	color: var(--sd-accent-ink);
	text-decoration: underline;
}

.sd-prose blockquote,
.sd-prose .wp-block-quote,
.sd-prose .wp-block-pullquote {
	margin: 0 0 1.1em;
	padding: 24px 28px;
	border: 0;
	border-radius: 20px;
	background: var(--sd-surface);
	font-family: var(--sd-heading);
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: var(--sd-track);
	line-height: 1.3;
}

.sd-prose blockquote p:last-child {
	margin-bottom: 0;
}

.sd-prose ul,
.sd-prose ol {
	padding-left: 1.3em;
}

.sd-prose li + li {
	margin-top: 0.35em;
}

.sd-prose img {
	max-width: 100%;
	height: auto;
	border-radius: var(--sd-radius-s);
}

.sd-prose table {
	display: block;
	overflow-x: auto;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.sd-prose td,
.sd-prose th {
	border: 1px solid var(--sd-line);
	padding: 8px 10px;
}

.sd-prose .sd-ad {
	margin-block: 4px 1.2em;
}

.sd-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 0.8125rem;
}

.sd-tags a {
	border: 1px solid var(--sd-line);
	border-radius: 999px;
	padding: 6px 12px;
	color: var(--sd-ink);
	text-decoration: none;
}

.sd-tags .wp-block-post-terms__separator {
	display: none;
}

.sd-aside {
	flex: 1 1 300px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 24px;
	position: sticky;
	top: 16px;
}

.sd-aside .sd-card {
	padding: 22px;
}

.sd-aside .sd-link-list a {
	font-family: var(--sd-heading);
	font-weight: 700;
	font-size: 1rem;
	letter-spacing: var(--sd-track);
}

/* Lists, archive, search */

.sd-archive {
	padding-block: 32px 64px;
	display: flex;
	flex-wrap: wrap;
	gap: 32px;
	align-items: flex-start;
}

.sd-archive__main {
	flex: 999 1 640px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.sd-archive__main > * {
	margin: 0;
}

.sd-archive__title {
	font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.5rem);
}

.sd-list .wp-block-post-template {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.sd-list__item {
	padding: 24px 28px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.sd-list__item > * {
	margin: 0;
}

.sd-list__title {
	font-size: 1.5rem;
}

.sd-list__title a {
	color: var(--sd-ink);
	text-decoration: none;
}

.sd-list__title a:hover {
	text-decoration: underline;
}

.sd-list__dek {
	color: var(--sd-muted);
	font-size: 1rem;
	line-height: 1.55;
}

.sd-list__dek p {
	margin: 0;
}

.sd-pager {
	margin-top: 8px;
	gap: 8px;
	font-weight: 600;
}

.sd-pager a,
.sd-pager .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 14px;
	box-sizing: border-box;
	border-radius: 999px;
	background: var(--sd-surface);
	color: var(--sd-ink);
	text-decoration: none;
}

.sd-pager .page-numbers.current {
	background: var(--sd-ink);
	color: var(--sd-canvas);
}

.sd-pager .page-numbers.dots {
	background: transparent;
}

/* Footer */

.sd-footer {
	background: var(--wp--preset--color--footer);
	color: #c9cdd5;
	font-size: 0.875rem;
	line-height: 1.65;
}

.sd-footer__inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 24px;
	padding-block: 36px;
}

.sd-footer__about {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-width: 540px;
}

.sd-footer .sd-brand {
	color: #fff;
}

.sd-footer .sd-brand__name {
	font-size: 1.75rem;
}

.sd-footer .sd-brand__pill {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
}

.sd-footer__links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.sd-footer a {
	color: #fff;
	text-decoration: none;
}

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

.sd-404 {
	padding-block: 80px;
	text-align: center;
	display: flex;
	flex-direction: column;
	gap: 16px;
	align-items: center;
}

.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal;
}

@media (max-width: 781px) {
	.sd-tools__date,
	.sd-search {
		display: none;
	}

	.sd-brand__name {
		font-size: 1.5rem;
	}

	.sd-brand {
		gap: 8px;
		min-width: 0;
	}

	.sd-brand__pill {
		font-size: 0.75rem;
		padding: 3px 9px;
	}

	.sd-header__row {
		flex-wrap: nowrap;
		gap: 8px;
	}

	.sd-tools {
		gap: 4px;
		flex-shrink: 0;
	}

	.sd-header__inner {
		gap: 10px;
		padding-block: 10px 8px;
	}

	.sd-lead {
		padding: 24px;
		min-height: 0;
	}

	.sd-single__head {
		padding: 22px;
	}

	.sd-list__item,
	.sd-ntk {
		padding: 20px;
	}

	.sd-aside {
		position: static;
	}

	.sd-ad--tall {
		display: none;
	}
}

@media (min-width: 782px) {
	.sd-search-toggle {
		display: none;
	}
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

.sd-searchpage .wp-block-search__inside-wrapper {
	border: 0;
	padding: 0;
	gap: 8px;
}

.sd-searchpage .wp-block-search__input {
	min-height: 48px;
	border: 1px solid var(--sd-line);
	border-radius: 999px;
	padding: 0 18px;
	background: var(--sd-surface);
	color: var(--sd-ink);
}

.sd-searchpage .wp-block-search__button {
	min-width: 48px;
	min-height: 48px;
	border-radius: 999px;
	margin: 0;
	background: var(--sd-accent);
	color: #fff;
}

.sd-404 .sd-searchpage {
	width: min(100%, 520px);
}
