/*
Theme Name: K-Wire Aurora
Text Domain: k-wire-aurora
Domain Path: /languages
Description: A light glassmorphism Malayalam news theme with glowing accents and modern motion design.
Version: 1.1.0
Requires at least: 6.3
Requires PHP: 7.4
License: GPL-2.0-or-later
WPVibe: yes
*/

/* This file holds the WordPress theme header (above) plus plain-CSS rules
 * that must work without a Tailwind rebuild: WordPress core markup that
 * utilities can't reach (search form, pagination, comments, screen-reader
 * text), Alpine's x-cloak, motion preferences, and classes that templates
 * build at runtime (a Tailwind scan of template source can't see those).
 *
 * - Design tokens live in theme.css's @theme block.
 * - Prose typography is compiled into dist/styles.css.
 * - Layout, color, typography utilities come from Tailwind v4.
 */

html {
	scroll-behavior: smooth;
}

/* ── Alpine ──────────────────────────────────────────────────────────── */

[x-cloak] {
	display: none !important;
}

/* ── Page backdrop ───────────────────────────────────────────────────────
 * Painted on a fixed pseudo-element instead of `background-attachment:
 * fixed`, which forces a full-viewport repaint on every scroll frame. */

body {
	background-color: var(--color-background, #f2effa);
}
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background:
		radial-gradient(circle at 12% 8%, rgba(139, 92, 246, 0.16), transparent 42%),
		radial-gradient(circle at 88% 18%, rgba(236, 72, 153, 0.14), transparent 40%),
		radial-gradient(circle at 50% 95%, rgba(6, 182, 212, 0.12), transparent 45%);
}

/* ── Accessibility ───────────────────────────────────────────────────── */

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}
.screen-reader-text:focus,
.skip-link:focus {
	background: #fff;
	border-radius: 999px;
	box-shadow: 0 8px 24px rgba(76, 29, 149, 0.25);
	clip: auto;
	clip-path: none;
	color: #6d28d9;
	display: block;
	font-weight: 700;
	height: auto;
	left: 1rem;
	margin: 0;
	padding: 0.75rem 1.25rem;
	top: 1rem;
	width: auto;
	z-index: 100000;
}

:where(a, button, input, textarea, select, summary):focus-visible {
	outline: 2px solid #7c3aed;
	outline-offset: 2px;
}

/* ── Motion ──────────────────────────────────────────────────────────── */

.animate-marquee:hover,
.animate-marquee:focus-within {
	animation-play-state: paused;
}

/* Big blurred animated blobs are the costliest thing on the page; keep
 * them as static decoration on phones. */
@media (max-width: 767px) {
	.animate-float {
		animation: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
	html {
		scroll-behavior: auto;
	}
	/* The ticker becomes a static, wrapping list with a single copy. */
	.animate-marquee {
		animation: none !important;
		flex-wrap: wrap;
		white-space: normal;
		width: auto !important;
	}
	.ticker-group[aria-hidden="true"] {
		display: none;
	}
}

/* ── Header ──────────────────────────────────────────────────────────── */

.brand-tagline {
	display: none;
	font-size: 0.75rem;
	font-weight: 500;
	color: #475569;
	line-height: 1.2;
}
@media (min-width: 1280px) {
	.brand-tagline { display: block; }
}

.kw-menu {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}
.kw-menu--mobile {
	flex-wrap: wrap;
	gap: 0.5rem;
}
.kw-menu-wrap {
	flex-basis: 100%;
}

.kw-search-panel {
	border-top: 1px solid rgba(255, 255, 255, 0.4);
	padding: 1rem 1.5rem;
}

/* ── Ticker ──────────────────────────────────────────────────────────────
 * Two identical groups, each with its own trailing padding, so translating
 * the track by -50% loops seamlessly. */

.ticker-group {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	gap: 2.5rem;
	padding-right: 2.5rem;
}
.ticker-sep {
	color: #cbd5e1;
}

/* ── Category glow (archive header icon) ─────────────────────────────── */

.cat-glow-violet  { box-shadow: 0 0 28px 2px rgba(139, 92, 246, 0.35); }
.cat-glow-pink    { box-shadow: 0 0 28px 2px rgba(236, 72, 153, 0.35); }
.cat-glow-cyan    { box-shadow: 0 0 28px 2px rgba(6, 182, 212, 0.35); }
.cat-glow-amber   { box-shadow: 0 0 28px 2px rgba(245, 158, 11, 0.35); }
.cat-glow-emerald { box-shadow: 0 0 28px 2px rgba(16, 185, 129, 0.35); }
.cat-glow-blue    { box-shadow: 0 0 28px 2px rgba(59, 130, 246, 0.35); }

/* ── Pager (archive / search prev-next) ──────────────────────────────── */

.kw-pager {
	margin-top: 3rem;
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	font-size: 0.875rem;
	font-weight: 600;
}
.kw-pager a {
	display: inline-block;
	padding: 0.65rem 1.4rem;
	border-radius: 999px;
	text-decoration: none;
	color: #334155;
	background: rgba(255, 255, 255, 0.5);
	backdrop-filter: blur(20px) saturate(160%);
	-webkit-backdrop-filter: blur(20px) saturate(160%);
	border: 1px solid rgba(255, 255, 255, 0.65);
	box-shadow: 0 8px 32px rgba(76, 29, 149, 0.10);
	transition: color 0.3s ease, box-shadow 0.3s ease;
}
.kw-pager a:hover {
	color: #7c3aed;
	box-shadow: 0 8px 32px rgba(139, 92, 246, 0.25);
}

/* ── Numbered pagination (the_posts_pagination) ──────────────────────── */

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
}
.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 1rem;
	border-radius: 999px;
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	color: #334155;
	background: rgba(255, 255, 255, 0.5);
	backdrop-filter: blur(20px) saturate(160%);
	-webkit-backdrop-filter: blur(20px) saturate(160%);
	border: 1px solid rgba(255, 255, 255, 0.65);
	transition: color 0.3s ease, box-shadow 0.3s ease;
}
.pagination a.page-numbers:hover {
	color: #7c3aed;
	box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}
.pagination .page-numbers.current {
	color: #fff;
	border-color: transparent;
	background: linear-gradient(135deg, #8b5cf6, #ec4899);
	box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35);
}
.pagination .page-numbers.dots {
	background: transparent;
	border-color: transparent;
	box-shadow: none;
}

/* ── Search form (get_search_form) ───────────────────────────────────── */

.search-form {
	display: flex;
	gap: 0.5rem;
	align-items: stretch;
}
.search-form label {
	flex: 1;
	display: block;
	margin: 0;
}
.search-form .search-field {
	width: 100%;
	height: 100%;
	padding: 0.7rem 1.25rem;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.75);
	background: rgba(255, 255, 255, 0.7);
	color: #1e1b2e;
	font: inherit;
}
.search-form .search-field:focus {
	outline: none;
	border-color: #8b5cf6;
	box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}
.search-form .search-submit {
	padding: 0.7rem 1.5rem;
	border-radius: 999px;
	border: 0;
	font: inherit;
	font-weight: 700;
	color: #fff;
	cursor: pointer;
	background: linear-gradient(135deg, #8b5cf6, #ec4899);
	box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.search-form .search-submit:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 32px rgba(139, 92, 246, 0.5);
}

/* ── Comments (comments.php) ─────────────────────────────────────────── */

.comments-area .comments-title,
.comments-area .comment-reply-title {
	font-family: var(--font-serif, Georgia, serif);
	font-size: 1.5rem;
	font-weight: 700;
	color: #1e1b2e;
	margin: 0 0 1.25rem;
}
.comment-list,
.comment-list .children {
	list-style: none;
	margin: 0;
	padding: 0;
}
.comment-list .children {
	margin-left: 1.5rem;
	padding-left: 1rem;
	border-left: 2px solid rgba(139, 92, 246, 0.2);
}
.comment-list > li {
	margin-bottom: 1.25rem;
}
.comment-body {
	padding: 1.1rem 1.25rem;
	border-radius: 1.25rem;
	background: rgba(255, 255, 255, 0.55);
	border: 1px solid rgba(255, 255, 255, 0.7);
}
.comment-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.75rem;
	font-size: 0.8rem;
	color: #64748b;
}
.comment-meta .avatar {
	border-radius: 999px;
	width: 2.25rem;
	height: 2.25rem;
}
.comment-author .fn {
	font-weight: 700;
	font-style: normal;
	color: #1e1b2e;
}
.comment-author .says { display: none; }
.comment-metadata a { color: inherit; text-decoration: none; }
.comment-content {
	margin-top: 0.6rem;
	color: #334155;
	line-height: 1.8;
}
.comment-content p { margin: 0 0 0.75rem; }
.comment-awaiting-moderation {
	display: block;
	margin-top: 0.5rem;
	font-size: 0.8rem;
	color: #b45309;
}
.reply { margin-top: 0.5rem; font-size: 0.8rem; font-weight: 700; }
.reply a { color: #7c3aed; text-decoration: none; }
.comment-respond { margin-top: 2rem; }
.comment-form label {
	display: block;
	margin-bottom: 0.3rem;
	font-size: 0.85rem;
	font-weight: 600;
	color: #334155;
}
.comment-form p { margin: 0 0 1rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 0.7rem 1rem;
	border-radius: 1rem;
	border: 1px solid rgba(255, 255, 255, 0.75);
	background: rgba(255, 255, 255, 0.7);
	color: #1e1b2e;
	font: inherit;
}
.comment-form input:focus,
.comment-form textarea:focus {
	outline: none;
	border-color: #8b5cf6;
	box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}
.comment-form .comment-form-cookies-consent {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}
.comment-form .comment-form-cookies-consent label { margin: 0; }
.comment-form .form-submit .submit {
	padding: 0.7rem 1.5rem;
	border-radius: 999px;
	border: 0;
	font: inherit;
	font-weight: 700;
	color: #fff;
	cursor: pointer;
	background: linear-gradient(135deg, #8b5cf6, #ec4899);
	box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35);
}
.comments-area .no-comments {
	color: #64748b;
	font-size: 0.9rem;
}

.comments-area .nav-links {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin: 1.25rem 0;
	font-size: 0.85rem;
	font-weight: 600;
}
.comments-area .nav-links a { color: #7c3aed; text-decoration: none; }

/* ── Table of contents (single posts / pages) ────────────────────────── */

.kw-toc {
	margin: 0 0 2rem;
	padding: 1.1rem 1.4rem;
	border-radius: 1.25rem;
	background: rgba(255, 255, 255, 0.55);
	border: 1px solid rgba(139, 92, 246, 0.25);
	box-shadow: 0 8px 24px rgba(76, 29, 149, 0.08);
	font-size: 1rem;
	line-height: 1.6;
}
.kw-toc__title {
	cursor: pointer;
	font-family: var(--font-serif, Georgia, serif);
	font-size: 1.15rem;
	font-weight: 700;
	color: #1e1b2e;
}
.kw-toc ol {
	list-style: decimal;
	margin: 0.75rem 0 0;
	padding-left: 1.5rem;
	color: #7c3aed;
}
.kw-toc li {
	margin: 0.35rem 0;
	padding-left: 0.25rem;
}
.kw-toc a {
	color: #334155;
	text-decoration: none;
	transition: color 0.2s ease;
}
.kw-toc a:hover {
	color: #7c3aed;
	text-decoration: underline;
}
/* Land below the sticky header when jumping to a heading. */
.prose h2[id] {
	scroll-margin-top: 6rem;
}

/* ── Home: category tabs ─────────────────────────────────────────────── */

.kw-tabs {
	display: flex;
	gap: 0.5rem;
	overflow-x: auto;
	padding-bottom: 0.25rem;
	scrollbar-width: none;
}
.kw-tabs::-webkit-scrollbar { display: none; }
.kw-tab {
	flex-shrink: 0;
	padding: 0.55rem 1.2rem;
	border-radius: 999px;
	font: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	color: #334155;
	cursor: pointer;
	white-space: nowrap;
	background: rgba(255, 255, 255, 0.5);
	backdrop-filter: blur(20px) saturate(160%);
	-webkit-backdrop-filter: blur(20px) saturate(160%);
	border: 1px solid rgba(255, 255, 255, 0.65);
	transition: color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.kw-tab:hover {
	color: #7c3aed;
	box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}
.kw-tab[aria-selected="true"] {
	color: #fff;
	border-color: transparent;
	background: linear-gradient(135deg, #8b5cf6, #ec4899);
	box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35);
}

/* ── Category badge on top of a photo ────────────────────────────────────
 * The default badge is a translucent tint, which disappears on busy or dark
 * images. On photos it becomes a solid white pill (text keeps its color). */

.badge-glow.badge-on-image {
	background: rgba(255, 255, 255, 0.94);
	border-color: rgba(255, 255, 255, 0.95);
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	font-weight: 700;
}

/* ── Footer newsletter form (Jetpack Subscribe block) ────────────────── */

.kw-subscribe .wp-block-jetpack-subscriptions__container,
.kw-subscribe .wp-block-jetpack-subscriptions {
	max-width: 30rem;
	margin: 1.25rem auto 0;
}
.kw-subscribe .wp-block-jetpack-subscriptions__form-elements {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}
.kw-subscribe .wp-block-jetpack-subscriptions p {
	margin: 0;
}
.kw-subscribe #subscribe-email,
.kw-subscribe p[id^="subscribe-email"] {
	flex: 1 1 14rem;
}
.kw-subscribe input[type="email"] {
	width: 100%;
	padding: 0.7rem 1.25rem;
	border-radius: 999px !important;
	border: 1px solid rgba(255, 255, 255, 0.75) !important;
	background: rgba(255, 255, 255, 0.75);
	color: #1e1b2e;
	font: inherit;
}
.kw-subscribe input[type="email"]:focus {
	outline: none;
	border-color: #8b5cf6 !important;
	box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}
.kw-subscribe button[type="submit"],
.kw-subscribe .wp-block-button__link {
	padding: 0.7rem 1.5rem;
	border: 0 !important;
	border-radius: 999px !important;
	background: linear-gradient(135deg, #8b5cf6, #ec4899) !important;
	color: #fff !important;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35);
}

/* ── Latest e-books block (middle of posts) ──────────────────────────── */

.kw-books {
	margin: 2.25rem 0;
	padding: 1.25rem 1.4rem 1.4rem;
	border-radius: 1.5rem;
	background: rgba(255, 255, 255, 0.6);
	border: 1px solid rgba(139, 92, 246, 0.25);
	box-shadow: 0 8px 32px rgba(76, 29, 149, 0.10);
	font-size: 1rem;
	line-height: 1.5;
}
.kw-books__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1rem;
}
.kw-books__title {
	margin: 0;
	font-family: var(--font-serif, Georgia, serif);
	font-size: 1.25rem;
	font-weight: 700;
	color: #1e1b2e;
}
.kw-books__all {
	font-size: 0.85rem;
	font-weight: 600;
	color: #7c3aed;
	text-decoration: none;
	white-space: nowrap;
}
.kw-books__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem;
}
.kw-book {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	text-decoration: none;
	color: inherit;
	transition: transform 0.3s ease;
}
.kw-book:hover { transform: translateY(-4px); }
.kw-book__cover {
	display: block;
	aspect-ratio: 2 / 3;
	overflow: hidden;
	border-radius: 0.9rem;
	background: linear-gradient(135deg, #ede9fe, #fce7f3);
	box-shadow: 0 8px 24px rgba(76, 29, 149, 0.18);
}
.kw-book__img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
}
.kw-book__title {
	margin-top: 0.4rem;
	font-family: var(--font-serif, Georgia, serif);
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.35;
	color: #1e1b2e;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.kw-book:hover .kw-book__title { color: #7c3aed; }
.kw-book__author {
	font-size: 0.8rem;
	color: #64748b;
}
.kw-book__price {
	font-size: 0.9rem;
	font-weight: 700;
	color: #6d28d9;
}
.kw-book__price del { color: #94a3b8; font-weight: 400; margin-right: 0.3rem; }
.kw-book__price ins { text-decoration: none; }
@media (max-width: 520px) {
	.kw-books { padding: 1rem; }
	.kw-books__grid { gap: 0.65rem; }
	.kw-book__title { font-size: 0.8rem; }
}

/* ── Hero: photo with overlaid title ─────────────────────────────────────
 * Shared by the home-page hero and the single-post header. A full-bleed
 * photo with a category pill and a bold, white/outlined title anchored to
 * the bottom over a dark scrim, so it stays legible on any busy image.
 * Falls back to a plain panel (no .kw-hero-media) when there's no photo. */

/* A CSS-grid stack, not absolute positioning: the photo, scrim and text all
 * share one grid cell (grid-area 1/1), so the row — and everything in it —
 * sizes to the TALLER of min-height or the title's actual content height.
 * (Plain `inset:0` on the overlay would instead lock it to min-height and
 * clip a long, wrapped title on a narrow screen.) */
.kw-hero-media {
	display: grid;
	overflow: hidden;
	min-height: 20rem;
}
@media (min-width: 768px) {
	.kw-hero-media { min-height: 28rem; }
}
.kw-hero-media__bg,
.kw-hero-scrim,
.kw-hero-overlay {
	grid-area: 1 / 1;
}
.kw-hero-media__bg {
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
}
.kw-hero-scrim {
	background: linear-gradient(to top, rgba(12, 8, 26, 0.92) 0%, rgba(12, 8, 26, 0.55) 42%, rgba(12, 8, 26, 0) 75%);
}
.kw-hero-overlay {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 0.75rem;
	padding: 1.75rem 1.5rem;
	/* A grid item's automatic min-width defaults to its content's min-content
	   size, which for a long title can exceed the grid cell — pushing this
	   box (and the text) past the card's edge instead of wrapping. */
	min-width: 0;
}
@media (min-width: 768px) {
	.kw-hero-overlay { padding: 2.75rem; }
}
.kw-hero-overlay .badge-glow {
	align-self: flex-start;
}

.kw-hero-title {
	overflow-wrap: break-word;
	word-break: normal;
	/* Flex item (child of .kw-hero-overlay): without this its automatic
	   min-width follows its inline-block child's preferred width instead of
	   stretching to the container, overflowing the card on a long title. */
	min-width: 0;
}
.kw-hero-overlay .kw-hero-title a {
	text-decoration: none;
	color: inherit;
}

/* Frosted-glass headline: one translucent, blurred glass panel behind the
 * whole title block (inline-block sizes to the wrapped text as a single
 * box, however many lines it takes). A glossy inset top edge + soft outer
 * shadow sell the glass; the scrim behind still carries most of the
 * legibility, so this reads even where backdrop-filter isn't supported. */
.kw-hero-title-text {
	display: inline-block;
	max-width: 100%;
	padding: 0.3em 0.6em;
	border-radius: 1.1rem;
	border: 1px solid rgba(255, 255, 255, 0.4);
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.12));
	-webkit-backdrop-filter: blur(18px) saturate(180%);
	backdrop-filter: blur(18px) saturate(180%);
	color: rgba(255, 255, 255, 0.98);
	text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.55),
		0 8px 24px rgba(0, 0, 0, 0.22);
}
.kw-hero-excerpt {
	margin: 0;
	max-width: 42rem;
	font-size: 1rem;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.92);
	text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
}
@media (min-width: 768px) {
	.kw-hero-excerpt { font-size: 1.0625rem; }
}
.kw-hero-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem;
	margin-top: 0.25rem;
}
/* Same frosted-chip language, smaller — matches the timestamp pill in the
 * reference image. */
.kw-hero-meta {
	display: inline-block;
	padding: 0.25em 0.75em;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	background: rgba(255, 255, 255, 0.16);
	-webkit-backdrop-filter: blur(12px) saturate(180%);
	backdrop-filter: blur(12px) saturate(180%);
	font-size: 0.8rem;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.95);
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}
