/* 360 News Club - main stylesheet. No external fonts or requests. */

:root {
	--bg: #ffffff;
	--surface: #f4f5f7;
	--text: #15181d;
	--muted: #5b6471;
	--border: #e2e5ea;
	--accent: #c8102e;
	--link: var(--accent);
	--on-accent: #ffffff;
	--radius: 10px;
	--max: 1200px;
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", Arial, sans-serif;
	--serif: Georgia, "Times New Roman", "Noto Serif Devanagari", serif;
	color-scheme: light;
}

:root[data-theme="dark"] {
	--bg: #0f1216;
	--surface: #171b21;
	--text: #e8eaed;
	--muted: #a0a8b3;
	--border: #272d36;
	--link: color-mix(in srgb, var(--accent) 55%, #ffffff);
	color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.6;
	--cols: 3;
}

img, video, iframe { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 16px; }

.skip-link {
	position: absolute; left: -9999px; top: 8px; z-index: 100;
	background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 6px;
}
.skip-link:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: var(--bg); border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; flex-direction: column; line-height: 1.15; flex: 0 0 auto; }
.brand__name {
	font-family: var(--serif); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.01em;
	color: var(--text); text-decoration: none; border-bottom: 3px solid var(--accent);
}
.brand__tag { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }
.custom-logo { max-height: 48px; width: auto; }

.primary-nav { flex: 1 1 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.menu, .primary-nav ul { list-style: none; margin: 0; padding: 0; }
.primary-nav .menu { display: flex; flex-wrap: wrap; gap: 4px; }
.primary-nav a {
	display: block; padding: 8px 12px; border-radius: 8px;
	color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.95rem;
}
.primary-nav a:hover, .primary-nav .current-menu-item > a, .primary-nav .current-cat > a { background: var(--surface); color: var(--accent); }
.primary-nav li { position: relative; }
.primary-nav .sub-menu {
	display: none; position: absolute; left: 0; top: 100%; min-width: 200px; z-index: 10;
	background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px;
}
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { display: block; }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.theme-toggle, .nav-toggle {
	display: inline-grid; place-items: center; width: 42px; height: 42px;
	background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 50%; cursor: pointer;
}
.theme-toggle:hover, .nav-toggle:hover { border-color: var(--accent); color: var(--accent); }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
.nav-toggle { display: none; }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
	display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; content: "";
}
.nav-toggle__bars::before { position: absolute; top: -6px; left: 0; }
.nav-toggle__bars::after { position: absolute; top: 6px; left: 0; }

.search-form { display: flex; gap: 6px; }
.search-form label { flex: 1; }
.search-field, .comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 9px 12px; font: inherit; color: var(--text);
	background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
}
.search-submit, .button, .comment-form .submit {
	padding: 9px 16px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block;
	background: var(--accent); color: var(--on-accent); border: 0; border-radius: 8px;
}

@media (max-width: 860px) {
	.nav-toggle { display: inline-grid; }
	.primary-nav {
		display: none; position: absolute; left: 0; right: 0; top: 100%;
		flex-direction: column; align-items: stretch; padding: 12px 16px 16px;
		background: var(--bg); border-bottom: 1px solid var(--border);
	}
	.primary-nav.is-open { display: flex; }
	.primary-nav .menu { flex-direction: column; }
	.primary-nav .sub-menu { display: block; position: static; border: 0; padding: 0 0 0 14px; }
}

/* ---------- Layout ---------- */
.site-main { padding-block: 28px 48px; }
.n360-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; align-items: start; }
.n360-sidebar-none .n360-wrap { grid-template-columns: minmax(0, 1fr); }
.n360-sidebar-left .n360-wrap { grid-template-columns: 320px minmax(0, 1fr); }
.n360-sidebar-left .sidebar { order: -1; }
.content-area { min-width: 0; }
.content-area--narrow { max-width: 640px; margin-inline: auto; }
@media (max-width: 980px) {
	.n360-wrap, .n360-sidebar-left .n360-wrap { grid-template-columns: minmax(0, 1fr); }
	.n360-sidebar-left .sidebar { order: 0; }
}

/* ---------- Grid of articles ---------- */
.n360-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 24px; }
.n360-cols-2 { --cols: 2; }
.n360-cols-3 { --cols: 3; }
.n360-cols-4 { --cols: 4; }
body:not(.n360-sidebar-none).n360-cols-4 { --cols: 3; }
@media (max-width: 1100px) { body.n360-cols-3, body.n360-cols-4 { --cols: 2; } }
@media (max-width: 620px) { body.n360-cols-2, body.n360-cols-3, body.n360-cols-4 { --cols: 1; } }

.card {
	display: flex; flex-direction: column; overflow: hidden;
	background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
	transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card__img { display: block; aspect-ratio: 16 / 10; background: var(--surface); overflow: hidden; }
.card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card__body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__title { margin: 0; font-family: var(--serif); font-size: 1.15rem; line-height: 1.3; }
.card__title a { color: var(--text); text-decoration: none; }
.card__title a:hover { color: var(--link); }
.card__excerpt { margin: 0; color: var(--muted); font-size: 0.92rem; }
.meta { margin: 0; color: var(--muted); font-size: 0.82rem; }
.chip {
	align-self: flex-start; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
	color: var(--on-accent); background: var(--accent); padding: 2px 8px; border-radius: 4px; text-decoration: none;
}

/* Feature card on the homepage */
.card--hero { grid-column: 1 / -1; flex-direction: row; }
.card--hero .card__img { flex: 1.5; aspect-ratio: auto; min-height: 280px; }
.card--hero .card__body { flex: 1; justify-content: center; padding: 24px; }
.card--hero .card__title { font-size: clamp(1.4rem, 2.4vw, 2rem); }
.card--hero .card__excerpt { font-size: 1rem; }
@media (max-width: 700px) {
	.card--hero { flex-direction: column; }
	.card--hero .card__img { aspect-ratio: 16 / 10; min-height: 0; }
}

/* List layout */
.n360-layout-list .n360-grid { grid-template-columns: minmax(0, 1fr); }
.n360-layout-list .card { flex-direction: row; }
.n360-layout-list .card__img { flex: 0 0 280px; aspect-ratio: auto; min-height: 170px; }
@media (max-width: 620px) {
	.n360-layout-list .card { flex-direction: column; }
	.n360-layout-list .card__img { flex: none; aspect-ratio: 16 / 10; }
}

/* Category blocks */
.n360-block { margin-bottom: 40px; }
.n360-block__head { display: flex; align-items: center; gap: 12px; border-bottom: 2px solid var(--border); margin-bottom: 18px; }
.n360-block__head h2 { margin: 0; padding-bottom: 8px; font-size: 1.25rem; border-bottom: 3px solid var(--accent); margin-bottom: -2px; }
.n360-block__head a { color: var(--text); text-decoration: none; }
.n360-grid--block { --cols: 2; }
@media (min-width: 1100px) { .n360-sidebar-none .n360-grid--block { --cols: 4; } }

/* ---------- Ads ---------- */
.n360-ad {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
	padding: 10px; min-height: 120px; overflow: hidden;
	background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
}
.n360-ad__label { font-size: 0.68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.n360-ad__body { max-width: 100%; overflow: hidden; text-align: center; }
.n360-ad--header { margin-top: 16px; }
.n360-ad--inline { margin: 28px 0; }

/* ---------- Archive header, pagination ---------- */
.archive-header { margin-bottom: 22px; }
.archive-header h1 { margin: 0 0 6px; font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.2rem); }
.archive-header__desc { color: var(--muted); }
.pagination { margin-top: 32px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pagination .page-numbers {
	padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--text); font-weight: 600;
}
.pagination .page-numbers.current, .pagination a.page-numbers:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ---------- Single article ---------- */
.crumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.article__title { margin: 0 0 10px; font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.2; }
.article__image { margin: 20px 0; }
.article__image img { width: 100%; border-radius: var(--radius); display: block; }
.article__image figcaption { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }
.entry { font-family: var(--serif); font-size: 1.15rem; line-height: 1.8; max-width: 760px; }
.entry > * { margin-block: 0 1.2em; }
.entry h2, .entry h3 { font-family: var(--font); line-height: 1.3; margin-top: 1.8em; }
.entry blockquote { margin-inline: 0; padding: 4px 18px; border-left: 4px solid var(--accent); color: var(--muted); }
.entry img { border-radius: 8px; }
.entry table { border-collapse: collapse; width: 100%; }
.entry th, .entry td { border: 1px solid var(--border); padding: 8px 10px; }
.article__tags { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.85rem; }
.article__tags a { background: var(--surface); padding: 3px 10px; border-radius: 999px; text-decoration: none; color: var(--text); }
.post-navigation { margin: 36px 0; }
.post-navigation .nav-links { display: flex; justify-content: space-between; gap: 16px; }
.post-navigation a { text-decoration: none; font-weight: 600; }

/* ---------- Sidebar and widgets ---------- */
.sidebar { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 24px; }
.widget { background: var(--surface); border-radius: var(--radius); padding: 16px 18px; }
.widget__title { margin: 0 0 10px; font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid var(--accent); padding-bottom: 6px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.widget li:last-child { border-bottom: 0; }
.widget a { color: var(--text); text-decoration: none; }
.widget a:hover { color: var(--link); }

/* ---------- Comments ---------- */
.comments { margin-top: 40px; max-width: 760px; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 20px; }
.comment-body { padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment-form label { display: block; font-weight: 600; margin-bottom: 4px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding-block: 28px; margin-top: 24px; }
.footer-widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 20px; }
.footer-nav .menu { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-nav a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.footer-copy { margin: 14px 0 0; color: var(--muted); font-size: 0.85rem; }

/* WordPress core alignment helpers */
.alignleft { float: left; margin: 0 1.2em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.2em; }
.aligncenter { display: block; margin-inline: auto; }
.screen-reader-text { position: absolute !important; clip: rect(1px, 1px, 1px, 1px); width: 1px; height: 1px; overflow: hidden; }
.wp-caption-text, .gallery-caption { color: var(--muted); font-size: 0.85rem; }

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
	.site-header, .sidebar, .n360-ad, .site-footer, .comments, .post-navigation { display: none !important; }
	body { background: #fff; color: #000; }
}
