/*
 * West of the Tunnel Obituaries — front-end styles.
 * Intentionally distinct from the regular post/archive design: quieter,
 * warmer, more whitespace, serif headings. Scoped under .wot-obituary-page
 * so it never leaks into the rest of the site.
 *
 * Uses system font stacks only (no external font requests), so it loads
 * reliably and doesn't depend on any theme/font-loading setup.
 */

.wot-obituary-page {
	--wot-bg: #faf7f2;
	--wot-ink: #33302b;
	--wot-ink-soft: #6b665e;
	--wot-line: #e4ddd1;
	--wot-accent: #7a6a4f;
	--wot-accent-soft: #f1ebdd;
	--wot-error-bg: #fbeaea;
	--wot-error-text: #7a2a2a;
	--wot-success-bg: #eaf3ea;
	--wot-success-text: #2c5c33;
	--wot-info-bg: #f3efe6;
	--wot-serif: Georgia, 'Iowan Old Style', 'Palatino Linotype', Palatino, serif;
	--wot-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

	background: var(--wot-bg);
	color: var(--wot-ink);
	font-family: var(--wot-sans);
	line-height: 1.65;
	padding: 3rem 1.25rem 4rem;
}

.wot-obituary-page .wot-container {
	max-width: 760px;
	margin: 0 auto;
}
.wot-obituary-page .wot-view-archive.wot-container {
	max-width: 980px;
}

.wot-obituary-page a {
	color: var(--wot-accent);
}

/* ---------- Compact site title + menu ----------
   Unused now that WOT_Obit_Templates::render_mini_header() is no
   longer called (see its docblock in includes/class-templates.php) —
   left here, commented out, rather than deleted, so it's easy to
   restore alongside that method if it's ever needed again.
.wot-obit-mini-header {
	border-bottom: 1px solid var(--wot-line);
	margin: -3rem 0 2.5rem;
	font-family: var(--wot-sans);
}
.wot-obit-mini-header-inner {
	max-width: 980px;
	margin: 0 auto;
	display: flex;
	justify-content: center;
	padding: 0.85rem 0;
}
.wot-obit-mini-title {
	font-family: var(--wot-serif);
	font-size: 1.15rem;
	font-weight: 400;
	color: var(--wot-ink);
	text-decoration: none;
	letter-spacing: 0.01em;
}
.wot-obit-mini-title:hover {
	color: var(--wot-accent);
}
*/

/* ---------- Back link ---------- */
.wot-obit-back a {
	font-size: 0.9rem;
	text-decoration: none;
	color: var(--wot-ink-soft);
}
.wot-obit-back a:hover {
	color: var(--wot-accent);
}

/* ---------- Splash / landing page ---------- */
.wot-obit-splash {
	text-align: center;
	max-width: 620px;
	margin: 1.5rem auto 0;
}
.wot-obit-splash-title {
	font-family: var(--wot-serif);
	font-weight: 400;
	font-size: 2.4rem;
	margin: 0 0 2rem;
}
.wot-obit-splash-copy {
	text-align: left;
}
.wot-obit-splash-copy p {
	margin: 0 0 1.2rem;
}
.wot-obit-splash-lede {
	font-family: var(--wot-serif);
	font-style: italic;
	font-size: 1.2rem;
	color: var(--wot-accent);
	line-height: 1.5;
}
.wot-obit-splash-signoff {
	font-family: var(--wot-serif);
	font-style: italic;
	color: var(--wot-ink-soft);
	margin-top: 1.75rem !important;
}
.wot-obit-splash-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem;
	margin-top: 2.5rem;
}
.wot-obit-splash-button {
	display: inline-block;
	font-family: var(--wot-serif);
	font-weight: 400;
	font-size: 1rem;
	text-decoration: none;
	color: var(--wot-accent);
	background: transparent;
	border: 1px solid var(--wot-line);
	border-radius: 4px;
	padding: 0.6rem 1.35rem;
	white-space: nowrap;
	transition: background 0.15s ease, border-color 0.15s ease;
}
.wot-obit-splash-button:hover {
	background: var(--wot-accent-soft);
	border-color: var(--wot-accent);
}
@media (max-width: 560px) {
	.wot-obit-splash-actions {
		flex-direction: column;
		align-items: stretch;
	}
	.wot-obit-splash-button {
		text-align: center;
	}
}

/* ---------- Shared page header (archive / submit / request) ---------- */
.wot-obit-page-header,
.wot-obit-archive-header {
	text-align: center;
	margin-bottom: 2rem;
}
.wot-obit-page-header h1,
.wot-obit-archive-header h1 {
	font-family: var(--wot-serif);
	font-weight: 400;
	font-size: 2.1rem;
	margin: 0 0 0.9rem;
}
.wot-obit-page-intro,
.wot-obit-archive-intro {
	color: var(--wot-ink-soft);
	max-width: 560px;
	margin: 0 auto;
}

.wot-obit-callout {
	text-align: left;
	background: var(--wot-info-bg);
	border-radius: 6px;
	padding: 1.1rem 1.4rem;
	margin: 1.5rem auto 0;
	max-width: 560px;
	font-size: 0.92rem;
	color: var(--wot-ink);
}
.wot-obit-callout p {
	margin: 0;
}
.wot-obit-callout-contact {
	text-align: center;
}

.wot-obit-crosslink {
	margin-top: 1.5rem;
	font-size: 0.9rem;
	color: var(--wot-ink-soft);
}
.wot-obit-crosslink a {
	font-weight: 600;
}

/* ---------- Single obituary ---------- */
.wot-obit-article {
	background: #fff;
	border: 1px solid var(--wot-line);
	border-radius: 6px;
	padding: 2.5rem 2.25rem;
	margin-top: 1rem;
}

.wot-obit-photo {
	/* Explicit margin on all sides, not just bottom: this is a <figure>
	   (so the caption below can be a proper <figcaption>), and browsers'
	   default UA stylesheet gives <figure> its own margin (commonly
	   1em 40px) that a bottom-only override wouldn't fully clear. */
	margin: 0 0 1.75rem;
	text-align: center;
}
.wot-obit-photo-link {
	display: inline-block;
	position: relative;
	cursor: zoom-in;
}
.wot-obit-photo img {
	max-width: 260px;
	max-height: 320px;
	width: auto;
	height: auto;
	border-radius: 6px;
	object-fit: cover;
	border: 1px solid var(--wot-line);
	box-shadow: 0 2px 10px rgba(51, 48, 43, 0.06);
	display: block;
}
.wot-obit-photo-caption {
	margin: 0.6rem 0 0;
	font-family: var(--wot-serif);
	font-style: italic;
	font-size: 0.85rem;
	color: var(--wot-ink-soft);
}

/* ---------- Lightbox (single obituary photo) ---------- */
.wot-obit-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(20, 18, 14, 0.86);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	z-index: 100000;
}
.wot-obit-lightbox[hidden] {
	display: none;
}
.wot-obit-lightbox img {
	max-width: 100%;
	max-height: 100%;
	border-radius: 4px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}
.wot-obit-lightbox-close {
	position: absolute;
	top: 1.25rem;
	right: 1.5rem;
	background: transparent;
	border: none;
	color: #fff;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
	padding: 0.25rem 0.5rem;
}
.wot-obit-lightbox-close:hover {
	opacity: 0.75;
}

.wot-obit-header {
	text-align: center;
	margin-bottom: 2rem;
	padding-bottom: 1.75rem;
	border-bottom: 1px solid var(--wot-line);
}

.wot-obit-name {
	font-family: var(--wot-serif);
	font-weight: 400;
	font-size: 2.1rem;
	margin: 0 0 0.4rem;
	color: var(--wot-ink);
}

.wot-obit-dates {
	font-family: var(--wot-serif);
	font-style: italic;
	font-size: 1.15rem;
	color: var(--wot-accent);
	margin: 0 0 0.5rem;
}

.wot-obit-places {
	font-size: 0.95rem;
	color: var(--wot-ink-soft);
	margin: 0;
}

.wot-obit-body {
	font-size: 1.05rem;
}
.wot-obit-body p {
	margin: 0 0 1.2rem;
}

.wot-obit-section {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--wot-line);
}
.wot-obit-section h2 {
	font-family: var(--wot-serif);
	font-weight: 400;
	font-size: 1.25rem;
	margin: 0 0 0.75rem;
	color: var(--wot-accent);
}

.wot-obit-submit-note {
	margin: 2rem 0 0;
	padding-top: 1.5rem;
	text-align: center;
	font-size: 0.9rem;
	color: var(--wot-ink-soft);
}

.wot-obit-comments {
	margin-top: 2.5rem;
	padding-top: 2rem;
	border-top: 1px solid var(--wot-line);
}

/* Quieter styling for WordPress's default comment form/list so it
   doesn't visually outweigh the obituary itself. */
.wot-obit-comments #respond,
.wot-obit-comments .comment-respond {
	background: transparent;
}
.wot-obit-comments .comment-reply-title,
.wot-obit-comments #reply-title {
	font-family: var(--wot-serif);
	font-weight: 400;
	font-size: 1.2rem;
	color: var(--wot-accent);
	margin: 0 0 1rem;
}
.wot-obit-comments .comment-reply-title small {
	font-size: 0.7rem;
}
.wot-obit-comments .comment-notes,
.wot-obit-comments .logged-in-as {
	font-size: 0.85rem;
	color: var(--wot-ink-soft);
}
.wot-obit-comments textarea,
.wot-obit-comments input[type="text"],
.wot-obit-comments input[type="email"],
.wot-obit-comments input[type="url"] {
	width: 100%;
	max-width: 480px;
	box-sizing: border-box;
	font-family: var(--wot-sans);
	font-size: 0.95rem;
	padding: 0.5rem 0.65rem;
	border: 1px solid var(--wot-line);
	border-radius: 4px;
	background: #fff;
	color: var(--wot-ink);
}
.wot-obit-comments .comment-form p {
	margin: 0 0 0.9rem;
}
.wot-obit-comments .comment-form label {
	display: block;
	font-size: 0.85rem;
	font-weight: 600;
	margin-bottom: 0.3rem;
}
.wot-obit-comments .form-submit input[type="submit"],
.wot-obit-comments #submit {
	font-family: var(--wot-sans);
	font-size: 0.9rem;
	font-weight: 600;
	background: transparent;
	color: var(--wot-accent);
	border: 1px solid var(--wot-accent);
	border-radius: 4px;
	padding: 0.5rem 1.4rem;
	cursor: pointer;
}
.wot-obit-comments .form-submit input[type="submit"]:hover,
.wot-obit-comments #submit:hover {
	background: var(--wot-accent);
	color: #fff;
}
.wot-obit-comments .comment-list {
	list-style: none;
	margin: 1.5rem 0 0;
	padding: 0;
}
.wot-obit-comments .comment-body {
	padding: 1.1rem 0;
	border-top: 1px solid var(--wot-line);
	font-size: 0.95rem;
}
.wot-obit-comments .comment-author .fn {
	font-weight: 600;
	font-style: normal;
}
.wot-obit-comments .comment-metadata {
	font-size: 0.78rem;
	color: var(--wot-ink-soft);
}
.wot-obit-comments .comment-metadata a {
	color: inherit;
}

/* ---------- Search ---------- */
.wot-obit-search {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	max-width: 420px;
	margin: 1.5rem auto 0;
}
.wot-obit-search input[type="search"] {
	flex: 1;
	font-family: var(--wot-sans);
	font-size: 0.95rem;
	padding: 0.55rem 0.8rem;
	border: 1px solid var(--wot-line);
	border-radius: 4px;
	background: #fff;
	color: var(--wot-ink);
}
.wot-obit-search button {
	font-family: var(--wot-sans);
	font-size: 0.9rem;
	font-weight: 600;
	background: var(--wot-accent);
	color: #fff;
	border: none;
	border-radius: 4px;
	padding: 0.55rem 1.2rem;
	cursor: pointer;
}
.wot-obit-search button:hover {
	background: #665a42;
}
.wot-obit-search-status {
	text-align: center;
	font-size: 0.85rem;
	color: var(--wot-ink-soft);
	margin-top: 0.75rem;
}
.wot-obit-search-status a {
	margin-left: 0.5rem;
}

/* ---------- Archive grid ---------- */
.wot-obit-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	column-gap: 2.75rem;
	row-gap: 2.25rem;
	margin-bottom: 2.5rem;
}
@media (max-width: 860px) {
	.wot-obit-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (max-width: 560px) {
	.wot-obit-grid {
		grid-template-columns: 1fr;
	}
}

/* Wraps each card. Deliberately NOT overflow:hidden (unlike the card
   itself, below) so the vertical divider line — positioned outside the
   card's own box, out in the gutter — doesn't get clipped. height:100%
   makes it fill its grid row (grid items stretch to the row's tallest
   item by default), which the card itself then fills too (see below),
   so every card in a row shows the same visible height regardless of
   how much name/date/excerpt text it has. */
.wot-obit-card-col {
	position: relative;
	height: 100%;
}

/* Thin vertical rule between columns 2/3 and 1/2, centered in the gutter.
   Only applies at the 3-column breakpoint. Lives on the wrapper, not the
   card itself, because the card has overflow:hidden (to round the photo
   corners) which would otherwise clip this off. */
@media (min-width: 861px) {
	.wot-obit-grid .wot-obit-card-col:nth-child(3n+2)::before,
	.wot-obit-grid .wot-obit-card-col:nth-child(3n)::before {
		content: "";
		position: absolute;
		left: -1.4rem;
		top: 0.25rem;
		bottom: 0.25rem;
		width: 1px;
		background: var(--wot-line);
	}
}

.wot-obit-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	box-sizing: border-box;
	background: #fff;
	border: 1px solid var(--wot-line);
	border-radius: 6px;
	overflow: hidden;
	text-decoration: none;
	color: var(--wot-ink);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.wot-obit-card:hover {
	box-shadow: 0 4px 14px rgba(51, 48, 43, 0.08);
	transform: translateY(-1px);
}

/* Rectangular photo area — not oval — sized to work with portrait,
   landscape, or no photo at all. A landscape-leaning box (rather than
   portrait) means a vertical photo is capped to roughly the same
   height as a horizontal one instead of filling the frame edge to
   edge; it pillarboxes on white instead of towering over its neighbors. */
.wot-obit-card-photo {
	aspect-ratio: 4 / 3;
	flex-shrink: 0;
	/* A soft neutral tint rather than pure white, so the letterboxing
	   that object-fit: contain leaves around non-4:3 photos reads as a
	   deliberate mat around a framed photo instead of stray whitespace —
	   the amount of matting still varies by photo, by design (nothing is
	   cropped), but now it looks intentional either way. */
	background: var(--wot-accent-soft);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}
.wot-obit-card-photo {
	--wot-card-photo-pos: center;
}
.wot-obit-card-photo img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: var(--wot-card-photo-pos);
	display: block;
}
/* Optional per-obituary override (set from the "Obituary Details" box in
   the editor) — fills the frame edge-to-edge instead of showing the whole
   photo, for the rare case where letterboxing looks worse than a crop.
   --wot-card-photo-pos (also set from the editor) controls which part of
   the photo stays in frame once cropped — center by default. */
.wot-obit-card-photo--crop img {
	object-fit: cover;
}
.wot-obit-card-photo-placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(180deg, var(--wot-accent-soft), #ece3d0);
}

.wot-obit-card-body {
	flex: 1 1 auto;
	padding: 1rem 1.1rem 1.25rem;
}
.wot-obit-card-name {
	font-family: var(--wot-serif);
	font-weight: 400;
	font-size: 1.1rem;
	margin: 0 0 0.25rem;
}
.wot-obit-card-dates {
	font-size: 0.85rem;
	color: var(--wot-accent);
	margin: 0 0 0.5rem;
}
.wot-obit-card-excerpt {
	font-size: 0.88rem;
	color: var(--wot-ink-soft);
	margin: 0;
}

.wot-obit-pagination {
	text-align: center;
	margin-bottom: 3rem;
}
.wot-obit-pagination .page-numbers {
	display: inline-block;
	padding: 0.4rem 0.75rem;
	margin: 0 0.15rem;
	border: 1px solid var(--wot-line);
	border-radius: 4px;
	text-decoration: none;
	color: var(--wot-ink);
	font-size: 0.9rem;
}
.wot-obit-pagination .page-numbers.current {
	background: var(--wot-accent);
	border-color: var(--wot-accent);
	color: #fff;
}

.wot-obit-none {
	text-align: center;
	color: var(--wot-ink-soft);
	margin-bottom: 3rem;
}

/* ---------- Submission / request forms ---------- */
.wot-obit-submission-form {
	max-width: 640px;
	margin: 2rem auto 0;
}

.wot-obit-notice {
	border-radius: 6px;
	padding: 1rem 1.25rem;
	margin-bottom: 1.5rem;
}
.wot-obit-notice p, .wot-obit-notice ul {
	margin: 0;
}
.wot-obit-notice-success {
	background: var(--wot-success-bg);
	color: var(--wot-success-text);
}
.wot-obit-notice-error {
	background: var(--wot-error-bg);
	color: var(--wot-error-text);
}
.wot-obit-notice-error ul {
	padding-left: 1.25rem;
}

.wot-obit-form {
	background: #fff;
	border: 1px solid var(--wot-line);
	border-radius: 6px;
	padding: 2rem 2.25rem;
}

.wot-obit-form fieldset {
	border: none;
	padding: 0;
	margin: 0 0 2rem;
}
.wot-obit-form legend {
	font-family: var(--wot-serif);
	font-size: 1.15rem;
	color: var(--wot-accent);
	padding: 0 0 0.75rem;
	width: 100%;
	border-bottom: 1px solid var(--wot-line);
	margin-bottom: 1.25rem;
}

.wot-obit-form-note {
	font-size: 0.85rem;
	color: var(--wot-ink-soft);
	margin: -0.5rem 0 1rem;
}

.wot-obit-field {
	margin: 0 0 1.1rem;
}
.wot-obit-field label {
	display: block;
	font-weight: 600;
	font-size: 0.92rem;
	margin-bottom: 0.35rem;
}
.wot-obit-field .req {
	color: #a13a3a;
}
.wot-obit-field-hint {
	display: block;
	margin-top: 0.35rem;
	font-size: 0.8rem;
	color: var(--wot-ink-soft);
}
.wot-obit-field input[type="text"],
.wot-obit-field input[type="email"],
.wot-obit-field input[type="tel"],
.wot-obit-field input[type="file"],
.wot-obit-field textarea {
	width: 100%;
	box-sizing: border-box;
	font-family: var(--wot-sans);
	font-size: 1rem;
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--wot-line);
	border-radius: 4px;
	background: var(--wot-bg);
	color: var(--wot-ink);
}
.wot-obit-field textarea {
	resize: vertical;
}
.wot-obit-field input:focus,
.wot-obit-field textarea:focus {
	outline: 2px solid var(--wot-accent);
	outline-offset: 1px;
}

.wot-obit-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}
@media (max-width: 520px) {
	.wot-obit-field-row {
		grid-template-columns: 1fr;
	}
}

.wot-obit-checkbox label {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	font-weight: 400;
	font-size: 0.92rem;
}
.wot-obit-checkbox input[type="checkbox"] {
	margin-top: 0.2rem;
}

.wot-obit-hp {
	position: absolute;
	left: -9999px;
	top: -9999px;
}

.wot-obit-submit {
	text-align: center;
	margin-top: 1.5rem;
}
.wot-obit-submit-button {
	font-family: var(--wot-sans);
	font-size: 1rem;
	font-weight: 600;
	background: var(--wot-accent);
	color: #fff;
	border: none;
	border-radius: 4px;
	padding: 0.75rem 2rem;
	cursor: pointer;
}
.wot-obit-submit-button:hover {
	background: #665a42;
}

/*
 * Slightly smaller "West of the Tunnel" site banner title, and a
 * narrower gap between the title and the nav menu below it, on every
 * obituary page -- splash/archive/submit/request, and individual
 * obituary posts.
 *
 * The banner itself is theme markup (wott_get_site_banner_markup() in
 * the child theme's homepage-patterns.php) and appears on every page
 * of the site, not just this plugin's -- so this is scoped two ways
 * to touch only what was asked:
 *
 * 1. `body.post-type-archive-obituary` (the splash/archive/submit/
 *    request views, which all share one request and differ only by
 *    the ?wot_view= query string) and `body.single-obituary` (an
 *    individual obituary post) -- the two body classes WordPress adds
 *    only on this plugin's own pages. No other page/post site-wide
 *    gets either class, so the theme's own banner sizing stays
 *    untouched everywhere else.
 * 2. `@media (min-width: 769px)` -- matches the breakpoint the theme
 *    already uses for its own mobile override of this same title (see
 *    ".wott-site-banner-title" inside "@media (max-width: 768px)" in
 *    homepage-layouts.css), so mobile keeps its existing size and
 *    spacing untouched.
 *
 * This stylesheet only ever loads on this plugin's own pages (see
 * WOT_Obit_Templates::enqueue_assets()), so none of this can leak
 * into the rest of the site regardless.
 */
@media (min-width: 769px) {
	body.post-type-archive-obituary .wott-site-banner-title,
	body.single-obituary .wott-site-banner-title {
		font-size: 2.75rem;
	}

	body.post-type-archive-obituary .wott-site-banner-nav-slot,
	body.single-obituary .wott-site-banner-nav-slot {
		margin-top: 0.35rem;
	}
}
