/*
Theme Name: Logline It
Theme URI: https://loglineit.com
Author: The Story Shop
Description: Lightweight, accessible, fast theme for loglineit.com — the purpose-built companion to the Logline Engine plugin. Classic PHP theme, no build step, system fonts, minimal payload.
Version: 0.6.0
Requires at least: 6.4
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: loglineit
*/

/* Design tokens --------------------------------------------------------- */
:root {
	--brand-bg: #ffffff;
	--brand-surface: #f6f8fa;
	--brand-text: #16202b;
	--brand-muted: #56636f;
	--brand-border: #e2e6ea;
	/* Brand palette from the logo (fav.pdf): steel blue + raspberry magenta.
	   The exact logo blue #4880a0 is just under WCAG-AA contrast on white, so
	   the interactive accent is a slightly deepened blue that passes AA for
	   button/link text; --brand-blue keeps the exact logo colour for
	   decorative use. */
	--brand-blue: #4880a0;          /* exact logo blue (decorative) */
	--brand-accent: #3e7391;        /* interactive blue, AA on white (5.1:1) */
	--brand-accent-hover: #2f5a73;
	--brand-accent-contrast: #ffffff;
	--brand-accent-2: #b00858;      /* logo magenta / raspberry */
	--brand-accent-2-hover: #8c0446;
	--brand-maxw: 46rem;
	--brand-maxw-wide: 64rem;
	--brand-radius: 10px;
	--brand-space: clamp(1rem, 2.5vw, 1.5rem);
}

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

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

body {
	margin: 0;
	background: var(--brand-bg);
	color: var(--brand-text);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 1.0625rem;
	line-height: 1.65;
	/* Lets the home banner break out to full width without a horizontal
	   scrollbar; `clip` (unlike `hidden`) doesn't break the sticky header. */
	overflow-x: clip;
}

h1, h2, h3, h4 {
	line-height: 1.25;
	font-weight: 700;
	color: var(--brand-text);
}

a {
	color: var(--brand-accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

a:hover {
	color: var(--brand-accent-hover);
}

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

/* Visible, high-contrast focus for keyboard users. */
:focus-visible {
	outline: 3px solid var(--brand-accent);
	outline-offset: 2px;
}

/* Accessibility helpers ------------------------------------------------- */
.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;
}

.skip-link {
	position: absolute;
	left: -999px;
	top: 0;
	z-index: 100;
	padding: 0.6rem 1rem;
	background: var(--brand-accent);
	color: var(--brand-accent-contrast);
	border-radius: 0 0 var(--brand-radius) 0;
}

.skip-link:focus {
	left: 0;
	color: var(--brand-accent-contrast);
}

/* Layout ---------------------------------------------------------------- */
.site-container {
	width: 100%;
	max-width: var(--brand-maxw-wide);
	margin: 0 auto;
	padding: 0 var(--brand-space);
}

/* Header ---------------------------------------------------------------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 30;
	border-bottom: 1px solid var(--brand-border);
	background: var(--brand-bg);
}

.site-header-inner {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	align-items: baseline;
	justify-content: space-between;
	padding: 1rem 0;
}

.site-branding {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 0.6rem;
}

.site-logo-mark {
	display: block;
	width: 40px;
	height: 40px;
	flex: 0 0 auto;
}

.site-branding-text {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
}

.site-title {
	margin: 0;
	font-size: 1.4rem;
	font-weight: 800;
	letter-spacing: -0.01em;
}

.site-title a {
	color: var(--brand-text);
	text-decoration: none;
}

.site-description {
	margin: 0;
	color: var(--brand-muted);
	font-size: 0.9rem;
}

/* Primary nav ----------------------------------------------------------- */
.primary-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.primary-nav a {
	color: var(--brand-text);
	text-decoration: none;
	font-weight: 600;
	padding: 0.25rem 0;
	border-bottom: 2px solid transparent;
}

.primary-nav a:hover,
.primary-nav .current-menu-item > a {
	color: var(--brand-accent);
	border-bottom-color: var(--brand-accent);
}

/* Content --------------------------------------------------------------- */
.site-main {
	padding: var(--brand-space) 0 3rem;
}

.content-narrow {
	max-width: var(--brand-maxw);
	margin: 0 auto;
}

.page-title {
	font-size: clamp(1.5rem, 4vw, 2rem);
	margin: 0 0 1rem;
}

.entry-content > * + * {
	margin-top: 1rem;
}

/* Search form ----------------------------------------------------------- */
.search-form {
	display: flex;
	gap: 0.5rem;
	max-width: 30rem;
}

.search-form input[type="search"] {
	flex: 1 1 auto;
	padding: 0.5rem 0.7rem;
	border: 1px solid var(--brand-border);
	border-radius: var(--brand-radius);
	font: inherit;
}

.search-form button {
	padding: 0.5rem 1rem;
	border: 0;
	border-radius: var(--brand-radius);
	background: var(--brand-accent);
	color: var(--brand-accent-contrast);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

/* Footer ---------------------------------------------------------------- */
.site-footer {
	border-top: 1px solid var(--brand-border);
	padding: 2rem 0;
	color: var(--brand-muted);
	font-size: 0.9rem;
}

.site-footer a {
	color: var(--brand-muted);
}

/* Home hub -------------------------------------------------------------- */
.home-hero {
	padding: 1.5rem 0 0.5rem;
}

.home-hero h1 {
	font-size: clamp(1.75rem, 5vw, 2.5rem);
	margin: 0 0 0.5rem;
}

.home-hero p {
	margin: 0;
	color: var(--brand-muted);
	font-size: 1.1rem;
}

.home-section-title {
	margin: 2rem 0 0.5rem;
	font-size: 1.2rem;
}

/* Logline list on theme pages (home hub, etc.). The plugin styles these on
   its own views; this covers pages where the plugin bundle is not loaded. */
.logline-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.logline-list-item {
	padding: 0.85rem 0;
	border-bottom: 1px solid var(--brand-border);
}

.logline-list-title {
	margin: 0 0 0.2rem;
	font-size: 1.1rem;
	line-height: 1.35;
}

/* Logline titles are clickable but read as titles, not hyperlinks: no
   underline, inherit the text colour, and shift to the accent on hover/focus
   so the affordance stays clear without an underline. */
.logline-list-title a,
.logline-title a {
	color: inherit;
	text-decoration: none;
}

.logline-list-title a:hover,
.logline-list-title a:focus-visible {
	color: var(--brand-accent);
}

.logline-list-meta {
	margin: 0;
	color: var(--brand-muted);
	font-size: 0.85rem;
}

/* Pagination (WordPress default markup). */
.pagination .page-numbers,
.nav-links .page-numbers {
	display: inline-block;
	padding: 0.3rem 0.6rem;
	margin: 0 0.25rem 0.25rem 0;
	border: 1px solid var(--brand-border);
	border-radius: 6px;
	text-decoration: none;
}

.pagination .current,
.nav-links .current {
	background: var(--brand-accent);
	color: var(--brand-accent-contrast);
	border-color: var(--brand-accent);
}

/* Home page ------------------------------------------------------------- */
/* Full-width banner: breaks out of the centred container to the viewport
   edges (body has overflow-x: clip to keep the page from scrolling sideways). */
.home-banner {
	position: relative;
	width: 100%;
	height: clamp(150px, 22vw, 250px);
	overflow: hidden;
	background: #0a1420;
}

.home-banner-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

.home-banner-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	background: linear-gradient(0deg, rgba(6, 12, 20, 0.85), rgba(6, 12, 20, 0.05) 58%);
}

.home-banner-inner {
	max-width: var(--brand-maxw-wide);
	width: 100%;
	margin: 0 auto;
	padding: 0 var(--brand-space) 1.75rem;
	color: #fff;
	box-sizing: border-box;
}

.home-banner-title {
	color: #fff;
	font-size: clamp(1.5rem, 3.6vw, 2.2rem);
	font-weight: 800;
	letter-spacing: -0.01em;
	line-height: 1.15;
	margin: 0 0 0.4rem;
}

.home-banner-sub {
	color: #d3dde6;
	margin: 0;
	/* One line, always: the font shrinks responsively to fit the width. */
	white-space: nowrap;
	font-size: clamp(0.8rem, 2.6vw, 1.1rem);
}

.secondary-nav {
	border-bottom: 1px solid var(--brand-border);
}

.secondary-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 1.4rem;
	margin: 0;
	padding: 0.65rem 0;
	list-style: none;
}

.secondary-nav a {
	color: var(--brand-muted);
	text-decoration: none;
	font-size: 0.85rem;
	font-weight: 600;
}

.secondary-nav a:hover,
.secondary-nav .current-menu-item > a {
	color: var(--brand-accent);
}

/* Site-wide content + sidebar grid (the sidebar and its widgets show on every
   page, so navigation never disappears when you leave the home page). */
.site-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 2rem;
	align-items: start;
	padding: var(--brand-space) 0 3rem;
}

.site-content {
	min-width: 0;
}

.home-feed {
	min-width: 0;
}

.home-section-title {
	margin: 0 0 0.75rem;
	font-size: 1.15rem;
}

.home-browse {
	margin-top: 1rem;
}

/* Home feed rows: score + content (the plugin styles the archive/profile;
   the home page carries its own copy). */
.logline-list-item {
	display: flex;
	gap: 0.85rem;
	align-items: baseline;
}

.logline-list-score {
	flex: 0 0 auto;
	min-width: 2.6rem;
	text-align: right;
	color: var(--brand-muted);
	font-weight: 600;
}

.logline-list-score.is-quiet {
	opacity: 0.4;
	font-weight: 400;
}

.logline-list-main {
	min-width: 0;
}

.logline-meta-quiet {
	font-style: italic;
}

/* Sidebar widgets */
.site-sidebar {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	min-width: 0;
}

.widget {
	border: 1px solid var(--brand-border);
	border-radius: 12px;
	background: var(--brand-surface);
	padding: 1rem 1.1rem;
}

.widget-title {
	margin: 0 0 0.8rem;
	font-size: 0.72rem;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--brand-muted);
}

.stat-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1px;
	background: var(--brand-border);
	border-radius: 10px;
	overflow: hidden;
}

.stat {
	background: var(--brand-surface);
	padding: 0.85rem 0.8rem;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

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

a.stat:hover {
	background: color-mix(in srgb, var(--brand-accent) 7%, var(--brand-surface));
}

.stat-num {
	font-size: 1.5rem;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--brand-accent);
	font-variant-numeric: tabular-nums;
	line-height: 1.1;
}

.stat-lab {
	font-size: 0.75rem;
	color: var(--brand-muted);
}

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

.widget-menu .menu li {
	border-bottom: 1px solid var(--brand-border);
}

.widget-menu .menu li:last-child {
	border-bottom: 0;
}

.widget-menu .menu a {
	display: block;
	padding: 0.55rem 0;
	color: var(--brand-text);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.92rem;
}

.widget-menu .menu a:hover {
	color: var(--brand-accent);
}

@media (max-width: 820px) {
	.site-layout {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 600px) {
	body {
		font-size: 1rem;
	}
}
