/*
Theme Name: DESHABAKTHI ePaper
Theme URI: https://deshabakthi.example/
Author: DESHABAKTHI
Author URI: https://deshabakthi.example/
Description: Daily newspaper e-paper reader. Visitors land on today's edition rendered page-by-page from the uploaded PDF, with previous/next day navigation and a jump-to-date picker. Editors upload each day's PDF from the DESHABAKTHI admin menu.
Version: 1.1.1
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: deshabakthi
Tags: newspaper, epaper, custom-menu, translation-ready
*/

/* ---------------------------------------------------------------------------
   Design tokens
   --------------------------------------------------------------------------- */
:root {
	/* Force a light rendering everywhere so phone browsers (Chrome/Android
	   "auto dark theme") can't invert the paper to a dark background. */
	color-scheme: only light;
	--dbk-ink: #14110f;
	--dbk-ink-soft: #5b544e;
	--dbk-ink-faint: #8d857d;
	--dbk-paper: #ffffff;
	--dbk-surface: #ffffff;
	--dbk-line: #ddd6cc;
	--dbk-accent: #b3131b;
	--dbk-accent-dark: #8d0f16;
	--dbk-focus: #1a5fb4;
	--dbk-radius: 8px;
	--dbk-shadow: 0 1px 2px rgba(20, 17, 15, .08), 0 8px 24px rgba(20, 17, 15, .06);
	--dbk-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
	--dbk-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* The masthead and paper stay white regardless of the OS colour scheme, so the
   newspaper always reads on a clean white background. */
@media (prefers-color-scheme: dark) {
	:root {
		--dbk-ink: #14110f;
		--dbk-ink-soft: #5b544e;
		--dbk-ink-faint: #8d857d;
		--dbk-paper: #ffffff;
		--dbk-surface: #ffffff;
		--dbk-line: #ddd6cc;
		--dbk-accent: #b3131b;
		--dbk-accent-dark: #8d0f16;
		--dbk-shadow: 0 1px 2px rgba(20, 17, 15, .08), 0 8px 24px rgba(20, 17, 15, .06);
	}
}

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

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

body {
	margin: 0;
	background: var(--dbk-paper);
	color: var(--dbk-ink);
	font-family: var(--dbk-sans);
	font-size: 16px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

a {
	color: var(--dbk-accent);
}

img {
	max-width: 100%;
	height: auto;
}

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

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

.dbk-skip-link {
	position: absolute;
	left: -9999px;
	z-index: 100;
	padding: 10px 16px;
	background: var(--dbk-surface);
	color: var(--dbk-ink);
	border-radius: var(--dbk-radius);
}

.dbk-skip-link:focus {
	left: 12px;
	top: 12px;
}

.dbk-shell {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
}

.dbk-wrap {
	width: 100%;
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 16px;
}

/* Full-screen newspaper: the reader spans the whole viewport width. */
.dbk-wrap--full {
	max-width: none;
	padding: 0 12px;
}

/* ---------------------------------------------------------------------------
   Masthead
   --------------------------------------------------------------------------- */
.dbk-masthead {
	background: var(--dbk-surface);
	border-bottom: 3px double var(--dbk-line);
}

/* Logo sits at the top, centred, like a printed newspaper masthead. */
.dbk-masthead__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 18px 16px 12px;
	text-align: center;
}

.dbk-brand {
	display: block;
	width: 100%;
	max-width: 720px;
	text-decoration: none;
	color: inherit;
}

.dbk-brand__logo,
.dbk-brand .custom-logo {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
}

.dbk-masthead__meta {
	font-size: .8rem;
	letter-spacing: .04em;
	color: var(--dbk-ink-soft);
	white-space: nowrap;
}

@media (max-width: 640px) {
	.dbk-masthead__inner {
		padding: 12px 16px 10px;
	}
}

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */
.dbk-footer {
	margin-top: auto;
	padding: 18px 16px 24px;
	border-top: 1px solid var(--dbk-line);
	background: var(--dbk-surface);
	color: var(--dbk-ink-faint);
	font-size: .8rem;
	text-align: center;
}

.dbk-footer p {
	margin: 0;
}

/* ---------------------------------------------------------------------------
   Generic content pages (index.php / page.php fallbacks)
   --------------------------------------------------------------------------- */
.dbk-content {
	padding: 32px 0 48px;
}

.dbk-content article + article {
	margin-top: 32px;
	padding-top: 32px;
	border-top: 1px solid var(--dbk-line);
}

.dbk-content h1,
.dbk-content h2 {
	font-family: var(--dbk-serif);
	line-height: 1.2;
}

.dbk-empty {
	max-width: 560px;
	margin: 48px auto;
	padding: 32px;
	background: var(--dbk-surface);
	border: 1px solid var(--dbk-line);
	border-radius: var(--dbk-radius);
	text-align: center;
	box-shadow: var(--dbk-shadow);
}

.dbk-empty h2 {
	margin: 0 0 8px;
	font-family: var(--dbk-serif);
}

.dbk-empty p {
	margin: 0 0 8px;
	color: var(--dbk-ink-soft);
}
