/*
Theme Name: Dawg Stories
Description: Plain, bright, readable news theme for dawgstories.com. Same layout and type as the Wine Country Gazette redesign (10/8/26), as one standalone theme with no plugin.
Version: 1.0.0
Requires PHP: 8.0
Text Domain: dawgstories
*/
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p, figure, ul { margin-top: 0; }
button, input { font: inherit; }
:root {
	--w-ink:      #1b1a19;   /* 17.4:1 on white */
	--w-ink-2:    #3d3a37;   /* 11.0:1 */
	--w-muted:    #5c5752;   /*  7.0:1 */
	--w-paper:    #ffffff;
	--w-wash:     #f6f4f1;
	--w-line:     #e3ded7;
	--w-line-2:   #cfc8bf;
	--w-accent:   #0f5c63;   /*  7.6:1 — teal */
	--w-accent-2: #0a4348;
	--w-focus:    #1d5fbf;
	--w-serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
	--w-sans:  "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--w-gutter: clamp(1rem, 4vw, 2.5rem);
	--w-max: 1200px;
	--w-read: 42rem;
}

/* ---------- Base ---------- */

html { -webkit-text-size-adjust: 100%; }
body,
body.w-front {
	background: var(--w-paper);
	color: var(--w-ink);
	font-family: var(--w-sans);
	font-size: 1.0625rem;
	line-height: 1.6;
	overflow-x: hidden;
}
img { max-width: 100%; height: auto; }

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

:focus-visible {
	outline: 3px solid var(--w-focus);
	outline-offset: 2px;
	border-radius: 2px;
}

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

.w-skip {
	position: absolute; left: .75rem; top: -4rem; z-index: 100001;
	background: var(--w-ink); color: #fff; padding: .7rem 1rem;
	font: 600 1rem/1 var(--w-sans); text-decoration: none; border-radius: 4px;
}
.w-skip:focus { top: .75rem; color: #fff; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none; transition: none; scroll-behavior: auto; }
}

/* ---------- Masthead ---------- */

.w-mast {
	background: var(--w-paper);
	border-bottom: 1px solid var(--w-line);
}
.w-mast__inner {
	max-width: var(--w-max);
	margin: 0 auto;
	padding: 1rem var(--w-gutter) .85rem;
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: .5rem 1.5rem;
}
.w-brand { margin: 0; font-size: inherit; line-height: 1; }
.w-brand a {
	display: inline-flex; align-items: center; gap: .75rem;
	color: var(--w-ink); text-decoration: none;
}
.w-brand__logo { width: 52px; height: 52px; object-fit: contain; flex: none; }
.w-brand__name {
	font-family: var(--w-serif);
	font-weight: 700;
	font-size: clamp(1.5rem, 3.2vw, 2.25rem);
	letter-spacing: -.015em;
	white-space: nowrap;
}
.w-brand__accent { color: var(--w-accent); font-style: italic; font-weight: 600; }
.w-brand__tm { font-size: .4em; vertical-align: super; font-weight: 400; margin-left: .1em; }
.w-mast__date {
	margin: 0;
	font-size: .9375rem;
	color: var(--w-muted);
	justify-self: end;
}

.w-search { display: flex; align-items: stretch; }
.w-search input[type="search"] {
	font: 400 1rem/1.2 var(--w-sans);
	color: var(--w-ink);
	width: 13rem;
	min-height: 44px;
	padding: .55rem .8rem;
	border: 1px solid var(--w-line-2);
	border-right: 0;
	border-radius: 6px 0 0 6px;
	background: var(--w-paper);
	-webkit-appearance: none;
	margin: 0;
	box-shadow: none;
}
.w-search input[type="search"]::placeholder { color: var(--w-muted); opacity: 1; }
.w-search button {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 44px; min-height: 44px; padding: 0 .75rem;
	background: var(--w-ink); color: #fff;
	border: 1px solid var(--w-ink); border-radius: 0 6px 6px 0;
	cursor: pointer; margin: 0; box-shadow: none;
}
.w-search button:hover { background: var(--w-accent); border-color: var(--w-accent); }

/* ---------- Nav ---------- */

.sd-nav {
	border-top: 1px solid var(--w-line);
	background: var(--w-paper);
}
.sd-nav > ul {
	max-width: var(--w-max);
	margin: 0 auto;
	padding: 0 var(--w-gutter);
	list-style: none;
	display: flex; flex-wrap: wrap; align-items: center;
	gap: 0 .25rem;
}
.sd-nav li { margin: 0; padding: 0; list-style: none; }
.sd-nav a,
.sd-nav__toggle {
	display: inline-flex; align-items: center;
	min-height: 44px;
	padding: .55rem .7rem;
	font: 600 .975rem/1.2 var(--w-sans);
	letter-spacing: 0;
	text-transform: none;
	color: var(--w-ink);
	text-decoration: none;
	background: none; border: 0; border-radius: 0; box-shadow: none;
	cursor: pointer;
	position: relative;
}
.sd-nav a:hover,
.sd-nav__toggle:hover { color: var(--w-accent); }
.sd-nav a.is-active,
.sd-nav__toggle.is-active { color: var(--w-accent); box-shadow: inset 0 -3px 0 var(--w-accent); }

.sd-nav__parent { position: relative; }
.sd-nav__parent > a::after,
.sd-nav__parent > .sd-nav__toggle::after {
	content: "";
	width: .38rem; height: .38rem; margin-left: .45rem;
	border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
	transform: translateY(-25%) rotate(45deg);
}
.sd-nav .sd-subnav {
	position: absolute; top: 100%; left: 0; z-index: 100000;
	min-width: 12rem;
	margin: 0; padding: .4rem 0;
	list-style: none;
	background: var(--w-paper);
	border: 1px solid var(--w-line-2);
	border-radius: 8px;
	box-shadow: 0 10px 30px rgba(27, 26, 25, .12);
	display: none;
}
.sd-nav .sd-subnav a {
	display: flex; width: 100%;
	padding: .55rem 1rem;
	font-weight: 500;
	white-space: nowrap;
}
.sd-nav .sd-subnav a:hover { background: var(--w-wash); }
.sd-nav__parent:hover > .sd-subnav,
.sd-nav__parent:focus-within > .sd-subnav,
.sd-nav__parent.is-open > .sd-subnav { display: block; }

/* Phone menu button — hidden on desktop. */
.sd-nav__menu { display: none; }

@media (max-width: 860px) {
	.w-mast__inner {
		grid-template-columns: 1fr auto;
		padding-top: .75rem; padding-bottom: .6rem;
	}
	.w-mast__date { display: none; }
	.w-search { grid-column: 1 / -1; }
	.w-search input[type="search"] { width: 100%; flex: 1; }
	.w-brand__logo { width: 40px; height: 40px; }

	.sd-nav__menu {
		display: flex; align-items: center; gap: .6rem;
		width: 100%;
		min-height: 48px;
		padding: .6rem var(--w-gutter);
		font: 600 1rem/1 var(--w-sans);
		color: var(--w-ink);
		background: var(--w-paper);
		border: 0; border-radius: 0; box-shadow: none;
		cursor: pointer; text-align: left;
	}
	.sd-nav__menu-icon,
	.sd-nav__menu-icon::before,
	.sd-nav__menu-icon::after {
		display: block; width: 20px; height: 2px; background: currentColor; position: relative;
		transition: transform .2s;
	}
	.sd-nav__menu-icon::before,
	.sd-nav__menu-icon::after { content: ""; position: absolute; left: 0; }
	.sd-nav__menu-icon::before { top: -6px; }
	.sd-nav__menu-icon::after  { top: 6px; }
	.sd-nav.is-open .sd-nav__menu-icon { background: transparent; }
	.sd-nav.is-open .sd-nav__menu-icon::before { transform: translateY(6px) rotate(45deg); }
	.sd-nav.is-open .sd-nav__menu-icon::after  { transform: translateY(-6px) rotate(-45deg); }

	/* Without JS the list just shows, stacked. With JS it waits for the button. */
	.sd-nav > ul {
		flex-direction: column; align-items: stretch; flex-wrap: nowrap;
		padding: 0 0 .5rem;
		border-top: 1px solid var(--w-line);
	}
	.sd-js .sd-nav:not(.is-open) > ul { display: none; }
	.sd-nav > ul > li { border-bottom: 1px solid var(--w-line); }
	.sd-nav > ul > li:last-child { border-bottom: 0; }
	.sd-nav a,
	.sd-nav__toggle {
		display: flex; width: 100%;
		padding: .7rem var(--w-gutter);
		font-size: 1.0625rem;
	}
	.sd-nav a.is-active,
	.sd-nav__toggle.is-active { box-shadow: inset 4px 0 0 var(--w-accent); }

	/* Sections with children: children always listed, indented, under the parent. */
	.sd-nav__parent > a::after,
	.sd-nav__parent > .sd-nav__toggle::after { content: none; }
	.sd-nav__toggle { cursor: default; color: var(--w-muted); font-size: .9375rem; text-transform: uppercase; letter-spacing: .05em; padding-bottom: .2rem; }
	.sd-nav .sd-subnav,
	.sd-nav__parent:hover > .sd-subnav,
	.sd-nav__parent:focus-within > .sd-subnav {
		display: block; position: static;
		min-width: 0; padding: 0 0 .35rem;
		border: 0; border-radius: 0; box-shadow: none; background: none;
	}
	.sd-nav .sd-subnav a { padding: .55rem var(--w-gutter) .55rem calc(var(--w-gutter) + 1rem); font-weight: 500; }
	.sd-nav .sd-subnav__dupe { display: none; }
}

/* Section row under the nav on inner pages (desktop only — the phone menu lists these). */
.sd-subnav-bar { background: var(--w-wash); border-top: 1px solid var(--w-line); }
.sd-subnav-bar ul {
	max-width: var(--w-max); margin: 0 auto; padding: 0 var(--w-gutter);
	list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 0 .25rem;
}
.sd-subnav-bar li { margin: 0; }
.sd-subnav-bar__label {
	font: 700 .8125rem/1 var(--w-sans); text-transform: uppercase; letter-spacing: .06em;
	color: var(--w-muted); margin-right: .5rem;
}
.sd-subnav-bar a {
	display: inline-flex; align-items: center; min-height: 40px; padding: .4rem .65rem;
	font: 500 .9375rem/1.2 var(--w-sans); color: var(--w-ink-2); text-decoration: none;
}
.sd-subnav-bar a:hover { color: var(--w-accent); }
.sd-subnav-bar a.is-active { color: var(--w-accent); box-shadow: inset 0 -3px 0 var(--w-accent); }
@media (max-width: 860px) { .sd-subnav-bar { display: none; } }

/* ---------- Shared bits ---------- */

.w-kicker {
	margin: 0 0 .35rem;
	font: 700 .8125rem/1.3 var(--w-sans);
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--w-accent);
}
.w-meta {
	margin: 0;
	font: 400 .9375rem/1.4 var(--w-sans);
	color: var(--w-muted);
}
.w-meta span[aria-hidden] { margin: 0 .3rem; }
.w-button {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 48px; padding: .75rem 1.4rem;
	font: 600 1rem/1 var(--w-sans);
	color: #fff; background: var(--w-ink);
	border-radius: 999px; text-decoration: none;
}
.w-button:hover { background: var(--w-accent); }

/* ---------- Footer ---------- */

.w-footer {
	margin-top: 4rem;
	background: var(--w-wash);
	border-top: 1px solid var(--w-line);
	color: var(--w-ink-2);
	font: 400 .9375rem/1.6 var(--w-sans);
	clear: both;
}
.w-footer__inner { max-width: var(--w-max); margin: 0 auto; padding: 2.5rem var(--w-gutter) 2rem; }
.w-footer a { color: var(--w-ink); text-decoration: underline; text-underline-offset: 3px; }
.w-footer a:hover { color: var(--w-accent); }
.w-footer__brand { margin: 0 0 1rem; font: 700 1.375rem/1.2 var(--w-serif); color: var(--w-ink); }
.w-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.w-footer li { margin: 0; }
.w-footer__nav { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--w-line-2); }
.w-footer__nav a { font-weight: 600; text-decoration: none; display: inline-block; padding: .3rem 0; }
.w-footer__affil,
.w-footer__legal { margin: 0 0 .6rem; max-width: 46rem; }
.w-footer__links { margin: 1rem 0; }
.w-footer__links a { display: inline-block; padding: .3rem 0; }
.w-footer__credit { margin: 0; color: var(--w-muted); font-size: .875rem; }
.w-main {
	max-width: var(--w-max);
	margin: 0 auto;
	padding: 2rem var(--w-gutter) 0;
}
.w-main:focus { outline: none; }

/* ---------- Lead story ---------- */

.w-lead {
	display: grid;
	grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
	gap: 2rem 2.5rem;
	align-items: center;
	padding-bottom: 2.5rem;
	margin-bottom: 2.5rem;
	border-bottom: 1px solid var(--w-line);
}
.w-lead__media { margin: 0; }
.w-lead__caption { margin: .4rem 0 0; font-size: .8125rem; line-height: 1.4; color: var(--w-muted); }
.w-lead__caption a { color: inherit; }
.w-lead__img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: 8px;
	background: var(--w-wash);
}
.w-lead__title {
	margin: 0 0 .9rem;
	font: 700 clamp(1.875rem, 3.6vw, 2.75rem)/1.1 var(--w-serif);
	letter-spacing: -.02em;
	color: var(--w-ink);
}
.w-lead__dek {
	margin: 0 0 1rem;
	font: 400 1.1875rem/1.55 var(--w-serif);
	color: var(--w-ink-2);
}

/* ---------- Card grid ---------- */

.w-section-title {
	margin: 0 0 1.5rem;
	padding-bottom: .6rem;
	border-bottom: 2px solid var(--w-ink);
	font: 700 1rem/1.2 var(--w-sans);
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--w-ink);
}

.w-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 2.5rem 2rem;
}
.w-grid > li { margin: 0; padding: 0; }

.w-card {
	position: relative;          /* the headline link stretches over the whole card */
	display: flex;
	flex-direction: column;
	height: 100%;
}
.w-card__media { margin: 0 0 .9rem; }
.w-card__img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: 6px;
	background: var(--w-wash);
	transition: opacity .15s;
}
.w-card__title {
	margin: 0 0 .5rem;
	font: 700 1.3125rem/1.25 var(--w-serif);
	letter-spacing: -.01em;
	color: var(--w-ink);
}
.w-card__dek {
	margin: 0 0 .6rem;
	font: 400 1rem/1.5 var(--w-sans);
	color: var(--w-ink-2);
}
.w-card .w-meta { margin-top: auto; }

/* Headline links: ink, underline on hover/focus. */
.w-lead__title a,
.w-card__title a {
	color: inherit;
	text-decoration: none;
}
.w-lead__title a:hover,
.w-card__title a:hover,
.w-lead__title a:focus-visible,
.w-card__title a:focus-visible {
	color: var(--w-accent);
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}
/* Whole card clickable, one link in the tab order. */
.w-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}
.w-card:hover .w-card__img { opacity: .9; }

.w-more {
	text-align: center;
	margin: 3.5rem 0 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
	.w-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
	.w-main { padding-top: 1.25rem; }
	.w-lead { grid-template-columns: 1fr; gap: 1.1rem; padding-bottom: 2rem; margin-bottom: 2rem; }
	.w-lead__dek { font-size: 1.125rem; }
}
@media (max-width: 600px) {
	.w-grid { grid-template-columns: 1fr; gap: 2rem; }
	.w-card__title { font-size: 1.375rem; }
}

/* A lead story with no photo runs as one column at reading width. */
.w-lead--text { grid-template-columns: minmax(0, 48rem); }

/* ---------- Story and page ---------- */
.d-read { max-width: var(--w-read); margin: 0 auto; padding: 2rem var(--w-gutter) 0; }
.d-read:focus, .d-list:focus { outline: none; }
.d-story__title {
	margin: 0 0 .75rem;
	font: 700 clamp(2rem, 4.6vw, 2.875rem)/1.12 var(--w-serif);
	letter-spacing: -.015em; color: var(--w-ink);
}
.d-story__dek { margin: 0 0 1rem; font: 400 1.25rem/1.5 var(--w-serif); color: var(--w-ink-2); }
.d-story__head { margin-bottom: 1.75rem; }
.d-story__art { margin: 0 0 2rem; }
.d-story__art img { display: block; width: 100%; border-radius: 6px; }
figcaption, .wp-caption-text { margin-top: .6rem; font: 400 .9375rem/1.5 var(--w-sans); color: var(--w-muted); }
.entry-content { font-family: var(--w-serif); font-size: 1.1875rem; line-height: 1.7; }
.entry-content p, .entry-content li { margin-bottom: 1.15em; }
.entry-content h2, .entry-content h3, .entry-content h4 {
	font-family: var(--w-sans); font-weight: 700; line-height: 1.25; letter-spacing: -.01em; margin: 2.2rem 0 .75rem;
}
.entry-content h2 { font-size: 1.5rem; }
.entry-content h3 { font-size: 1.25rem; }
.entry-content a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.entry-content a:hover { text-decoration-thickness: 2px; }
.entry-content blockquote { margin: 1.75rem 0; padding: .25rem 0 .25rem 1.25rem; border-left: 4px solid var(--w-accent); color: var(--w-ink-2); }
.entry-content img { border-radius: 4px; }
.entry-content table { width: 100%; border-collapse: collapse; font: 400 1rem/1.45 var(--w-sans); display: block; overflow-x: auto; }
.entry-content th, .entry-content td { padding: .6rem .75rem; border-bottom: 1px solid var(--w-line); text-align: left; }
.entry-content th { font-weight: 700; border-bottom: 2px solid var(--w-ink); }
.d-tags { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 2.5rem 0 0; padding: 0; }
.d-tags a {
	display: inline-flex; align-items: center; min-height: 36px; padding: .35rem .8rem;
	font: 500 .875rem/1 var(--w-sans); color: var(--w-ink-2); background: var(--w-wash);
	border: 1px solid var(--w-line); border-radius: 999px; text-decoration: none;
}
.d-tags a:hover { border-color: var(--w-accent); color: var(--w-accent); }

/* ---------- Section, search and archive lists ---------- */
.d-list { max-width: var(--w-max); margin: 0 auto; padding: 2rem var(--w-gutter) 0; }
.d-list__title {
	margin: 0 0 1.5rem; padding-bottom: 1rem; border-bottom: 2px solid var(--w-ink);
	font: 700 clamp(1.75rem, 4vw, 2.5rem)/1.15 var(--w-serif); color: var(--w-ink);
}
.d-empty { font-size: 1.125rem; color: var(--w-ink-2); }
.d-pages { margin: 3rem 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem; font-family: var(--w-sans); }
.d-pages .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 44px; min-height: 44px; padding: 0 .6rem;
	border: 1px solid var(--w-line-2); border-radius: 6px; color: var(--w-ink); text-decoration: none;
}
.d-pages .page-numbers.current { background: var(--w-ink); color: #fff; border-color: var(--w-ink); }
.d-pages a.page-numbers:hover { border-color: var(--w-accent); color: var(--w-accent); }

@media print {
	.w-mast .w-search, .sd-nav, .w-footer__nav, .w-skip { display: none; }
	.entry-content { font-size: 12pt; }
}
