/* ==========================================================================
   Wine Country Gazette — site layer (redesign 10/8/26)

   Loads on every WCG page, after the theme. Replaces nav.css. Goals:
   plain, bright, readable, WCAG 2.2 AA. Every text colour below is checked
   against white at 4.5:1 or better (most are 7:1+).

   The theme (clean-bloggist / bloggist) and the a11y mu-plugin both ship
   !important rules; the few !importants here exist only to beat those.
   ========================================================================== */

: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:   #8c1d2c;   /*  9.0:1 — wine */
	--w-accent-2: #6b1420;
	--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) !important;
	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) !important;
	outline-offset: 2px;
	border-radius: 2px;
}

.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;
}

.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 !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- 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) !important; color: #fff !important;
	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) !important; 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) !important;
		background: var(--w-paper) !important;
		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 !important;
}
.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 !important; 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 !important; }
.w-footer__links a { display: inline-block; padding: .3rem 0; }
.w-footer__credit { margin: 0; color: var(--w-muted); font-size: .875rem; }

/* ==========================================================================
   Inner pages (theme templates): single posts, pages, archives, search
   ========================================================================== */

body:not(.w-front) #content.site-content { padding-top: 2rem; }
body:not(.w-front) #content > .content-wrap {
	width: auto; max-width: none;
	padding: 0 var(--w-gutter);
}
/* Sidebar removed (sidebar.php) — let the main column take the centre. */
#primary.featured-content {
	float: none;
	width: 100%;
	max-width: var(--w-read);
	margin: 0 auto;
}
.archive #primary.featured-content,
.search #primary.featured-content,
.blog #primary.featured-content { max-width: 56rem; }

.fbox,
.posts-entry {
	background: none !important;
	box-shadow: none !important;
	border: 0 !important;
	padding: 0 !important;
}

/* --- Story / page --- */
.single .posts-entry,
.page .posts-entry { margin-bottom: 2rem; }

.single .entry-header,
.page .entry-header { text-align: left; margin: 0 0 1.5rem; }
.single h1.entry-title,
.page h1.entry-title,
h1.entry-title {
	font-family: var(--w-serif) !important;
	font-weight: 700;
	font-size: clamp(2rem, 4.6vw, 2.875rem);
	line-height: 1.12;
	letter-spacing: -.015em;
	color: var(--w-ink) !important;
	text-align: left;
	margin: 0 0 .75rem;
}
.post-data-divider { display: none; }
.entry-meta { display: block !important; padding: 0 !important; margin: 0 !important; }
.blog-data-wrapper,
.post-data-positioning,
.post-data-text { display: block !important; text-align: left !important; margin: 0 !important; padding: 0 !important; left: auto !important; }
.single .entry-header { margin-bottom: 1.75rem; }
.entry-meta,
.post-data-text,
.post-data-text * {
	font: 400 1rem/1.5 var(--w-sans) !important;
	color: var(--w-muted) !important;
	text-align: left;
}
.post-data-text a { text-decoration: underline; text-underline-offset: 2px; }

.single figure.featured-thumbnail {
	float: none; width: 100%; min-width: 0; max-width: none;
	margin: 0 0 2rem;
	text-align: left;
}
.single figure.featured-thumbnail img { width: 100%; border-radius: 6px; }
.sd-img-caption,
figure.featured-thumbnail .sd-img-caption,
.wp-caption-text,
figcaption {
	font: 400 .9375rem/1.5 var(--w-sans) !important;
	font-style: normal !important;
	color: var(--w-muted) !important;
	text-align: left !important;
	margin-top: .6rem !important;
}

/* Story first, photo first on the page: show the image above the headline
   (template already does), then headline, then byline, then body. */
.single .entry-content,
.page .entry-content {
	font-family: var(--w-serif);
	font-size: 1.1875rem;
	line-height: 1.7;
	color: var(--w-ink);
}
.single .entry-content p,
.page .entry-content p,
.single .entry-content li,
.page .entry-content li { font-size: inherit; line-height: inherit; color: inherit; margin-bottom: 1.15em; }
.entry-content h2,
.entry-content h3,
.entry-content h4 {
	font-family: var(--w-sans) !important;
	font-weight: 700 !important;
	color: var(--w-ink) !important;
	line-height: 1.25;
	letter-spacing: -.01em;
	margin: 2.2rem 0 .75rem;
}
.entry-content h2 { font-size: 1.5rem !important; }
.entry-content h3 { font-size: 1.25rem !important; }
.entry-content a {
	color: var(--w-accent);
	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);
	font-style: normal; color: var(--w-ink-2);
}
.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); }
.entry-content img { border-radius: 4px; }

/* Tags under a story */
.tags-list { display: flex; flex-wrap: wrap; gap: .5rem; margin: 2.5rem 0 0 !important; padding: 0 !important; }
.tags-list li { margin: 0 !important; padding: 0 !important; list-style: none; }
.tags-list a {
	display: inline-flex; align-items: center; min-height: 36px; padding: .35rem .8rem;
	font: 500 .875rem/1 var(--w-sans) !important; color: var(--w-ink-2) !important;
	background: var(--w-wash); border: 1px solid var(--w-line); border-radius: 999px;
	text-decoration: none !important;
}
.tags-list a:hover { border-color: var(--w-accent); color: var(--w-accent) !important; }

/* Related Stories (sonomadaily-related-stories mu-plugin) */
.sonomadaily-related-stories {
	margin: 3rem 0 0; padding: 1.5rem 0 0;
	border-top: 2px solid var(--w-ink);
	font-family: var(--w-sans);
}
.sonomadaily-related-stories h2 { margin-top: 0 !important; font-size: 1.125rem !important; text-transform: uppercase; letter-spacing: .05em; }
.sonomadaily-related-stories ul { list-style: none; margin: 0; padding: 0; }
.sonomadaily-related-stories li { font-size: 1.0625rem !important; padding: .7rem 0; border-bottom: 1px solid var(--w-line); margin: 0 !important; }
.sonomadaily-related-stories li a { font-weight: 600; text-decoration: none; color: var(--w-ink); }
.sonomadaily-related-stories li a:hover { color: var(--w-accent); text-decoration: underline; }
.sonomadaily-related-stories li span { color: var(--w-muted) !important; font-size: .9375rem !important; }

/* --- Archive / search lists --- */
.page-header.fbox,
header.page-header {
	border: 0 !important;
	padding: 0 0 1rem !important;
	margin: 0 0 1.5rem !important;
	border-bottom: 2px solid var(--w-ink) !important;
	text-align: left;
}
.page-header::before, .page-header::after { display: none !important; }
.page-title {
	border: 0 !important;
	padding: 0 !important;
	font: 700 clamp(1.75rem, 4vw, 2.5rem)/1.15 var(--w-serif) !important;
	color: var(--w-ink) !important;
	text-align: left !important;
	margin: 0 !important;
}
.archive-description { color: var(--w-ink-2); margin-top: .5rem; }

.blogposts-list.posts-entry {
	margin: 0 0 0 !important;
	padding: 1.5rem 0 !important;
	border-bottom: 1px solid var(--w-line) !important;
}
.blogposts-list .featured-img-box,
.blogposts-list .no-featured-img-box {
	display: grid !important;
	grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
	gap: 1.5rem;
	align-items: start;
}
.blogposts-list .no-featured-img-box { grid-template-columns: 1fr; }
.blogposts-list .featured-media-col { width: auto !important; min-width: 0 !important; flex: none !important; margin: 0 !important; }
/* Square thumbnails with the caption below — Roger's call, 7/9/26. */
.blogposts-list .featured-thumbnail { float: none !important; width: 100% !important; min-width: 0 !important; display: block; aspect-ratio: 1 / 1; }
.blogposts-list .featured-thumbnail-inner {
	width: 100%; height: 100% !important;
	background-size: cover; background-position: center;
	border-radius: 6px;
}
.blogposts-list .sd-img-caption--card { padding: 0 !important; font-size: .875rem !important; }
.blogposts-list .content-wrapper { padding: 0 !important; width: auto !important; float: none !important; }
.blogposts-list h2.entry-title,
.blogposts-list h2.entry-title a {
	font: 700 clamp(1.25rem, 2.4vw, 1.5rem)/1.25 var(--w-serif) !important;
	color: var(--w-ink) !important;
	text-align: left !important;
	text-decoration: none;
	margin: 0 0 .4rem !important;
}
.blogposts-list h2.entry-title a:hover { color: var(--w-accent) !important; text-decoration: underline; text-underline-offset: 3px; }
.blogposts-list .entry-meta { margin-bottom: .5rem; }
.blogposts-list .entry-meta,
.blogposts-list .post-data-text,
.blogposts-list .post-data-text * { font-size: .9375rem !important; }
.blogposts-list .entry-content,
.blogposts-list .entry-content p {
	font: 400 1.0625rem/1.55 var(--w-sans) !important;
	color: var(--w-ink-2) !important;
	text-align: left !important;
}
.blogposts-list .blogpost-button { display: none !important; }

@media (max-width: 640px) {
	.blogposts-list .featured-img-box { grid-template-columns: 1fr; gap: .9rem; }
}

/* Pagination */
.pagination, .nav-links, .page-numbers { font-family: var(--w-sans); }
a.page-numbers, span.page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 44px; min-height: 44px; padding: 0 .6rem; margin: 1.5rem .15rem 0;
	border: 1px solid var(--w-line-2); border-radius: 6px;
	color: var(--w-ink); text-decoration: none; background: var(--w-paper);
}
a.page-numbers.next,
a.page-numbers.prev { background: var(--w-paper) !important; color: var(--w-ink) !important; }
ul.page-numbers { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem; background: none !important; }
ul.page-numbers li { margin: 0; }
span.page-numbers.current { background: var(--w-ink); color: #fff; border-color: var(--w-ink); }
a.page-numbers:hover { border-color: var(--w-accent); color: var(--w-accent); }

/* Search-results / 404 forms from the theme */
.search-form .search-field,
input[type="search"].search-field { min-height: 44px; font-size: 1rem; }

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