/*
Theme Name: The Store Saloon
Description: Custom block theme for The Store Saloon in St. Nicholas, Minn. Edit everything under Appearance → Editor.
Version: 1.0.3
Requires at least: 6.6
Requires PHP: 7.4
Text Domain: store-saloon
License: GPL-2.0-or-later
*/

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { -webkit-font-smoothing: antialiased; }
img { height: auto; }

/* ---------- Header ---------- */
header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 50;
}
.admin-bar header.wp-block-template-part { top: 32px; }
@media (max-width: 782px) {
	.admin-bar header.wp-block-template-part { top: 46px; }
}
.site-header {
	background: rgba(21, 17, 15, 0.94);
	backdrop-filter: blur(6px);
	border-bottom: 1px solid rgba(243, 234, 208, 0.14);
}
.site-brand { margin: 0; white-space: nowrap; }
.site-brand a { text-decoration: none; }
.site-header .wp-block-navigation a { color: var(--wp--preset--color--cream-dim); }
.site-header .wp-block-navigation a:hover { color: var(--wp--preset--color--cream); }
.site-header .wp-block-button__link { padding: 8px 14px; font-size: 0.95rem; }
.wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--ink) !important;
	color: var(--wp--preset--color--cream) !important;
}
.site-header .wp-block-navigation { flex-wrap: nowrap; white-space: nowrap; }
/* The phone number is also in the hero, hours and footer, so drop it from the header on smaller screens */
@media (max-width: 1000px) {
	.site-header .wp-block-buttons { display: none; }
}

/* ---------- Shared bits ---------- */
.is-style-eyebrow {
	font-family: var(--wp--preset--font-family--smallcaps);
	color: var(--wp--preset--color--brass);
	letter-spacing: 0.12em;
	margin-bottom: 0.3rem !important;
}
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	border-color: var(--wp--preset--color--cream-dim);
	color: var(--wp--preset--color--cream);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: rgba(243, 234, 208, 0.08);
}
.muted { color: var(--wp--preset--color--cream-dim); }

/* ---------- Hero ---------- */
.saloon-hero .hero-logo img {
	width: min(560px, 86vw);
	filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.6));
}
.saloon-hero .wp-block-cover__image-background { filter: saturate(0.85); }
.saloon-status {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--wp--preset--color--cream-dim);
}
.saloon-status::before {
	content: "";
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #777;
	flex: none;
}
.saloon-status.is-open::before {
	background: #5fbf6a;
	box-shadow: 0 0 0 4px rgba(95, 191, 106, 0.2);
}

/* ---------- Hours strip ---------- */
.hours-strip p { margin: 0; }
.hours-strip .k {
	font-family: var(--wp--preset--font-family--smallcaps);
	letter-spacing: 0.1em;
	font-size: 0.9rem;
	opacity: 0.85;
}
.hours-strip .v { font-weight: 600; font-size: 1.1rem; }

/* ---------- Timeline list ---------- */
ul.is-style-timeline {
	list-style: none;
	margin-left: 7px;
	padding: 0;
	border-left: 2px solid var(--wp--preset--color--brass);
}
ul.is-style-timeline li {
	position: relative;
	padding: 0 0 18px 22px;
	color: var(--wp--preset--color--cream-dim);
	font-size: 0.95rem;
}
ul.is-style-timeline li::before {
	content: "";
	position: absolute;
	left: -7px;
	top: 7px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--wp--preset--color--ink-2);
	border: 2px solid var(--wp--preset--color--brass);
}
ul.is-style-timeline li:last-child::before {
	background: var(--wp--preset--color--red);
	border-color: var(--wp--preset--color--red);
}
ul.is-style-timeline li strong { color: var(--wp--preset--color--cream); font-size: 1.0625rem; }
ul.is-style-timeline li em {
	font-style: normal;
	font-family: var(--wp--preset--font-family--display);
	color: var(--wp--preset--color--red);
	font-size: 1.15rem;
	margin-right: 6px;
}

/* ---------- Photo frame & remodel link ---------- */
.photo-frame {
	border: 1px solid rgba(243, 234, 208, 0.14);
	padding: 10px;
	background: var(--wp--preset--color--ink);
}
.remodel-link {
	border: 1px dashed var(--wp--preset--color--brass);
	border-radius: 6px;
}
.remodel-link p { margin: 0; }
.remodel-link a { text-decoration: none; }

/* ---------- Cards ---------- */
.wp-block-group.is-style-card {
	background: var(--wp--preset--color--ink-2);
	border: 1px solid rgba(243, 234, 208, 0.14);
	border-radius: 6px;
	overflow: hidden;
	height: 100%;
}
.wp-block-group.is-style-card > .wp-block-image { margin: 0; }
.wp-block-group.is-style-card > :not(.wp-block-image) { margin-left: 22px; margin-right: 22px; }
.wp-block-group.is-style-card > :last-child { margin-bottom: 24px; }
.wp-block-group.is-style-card .is-style-eyebrow { margin-top: 18px; }

/* ---------- Hours table ---------- */
.wp-block-table.is-style-hours table { border-collapse: collapse; width: 100%; }
.wp-block-table.is-style-hours td {
	border: 0;
	border-bottom: 1px solid rgba(243, 234, 208, 0.14);
	padding: 10px 0;
}
.wp-block-table.is-style-hours td:last-child { text-align: right; font-weight: 600; }
.wp-block-table.is-style-hours tr.is-closed td { color: #8a8172; }
.wp-block-table.is-style-hours tr.is-closed td:last-child { font-weight: 400; }
.wp-block-table.is-style-hours tr.is-today td { color: var(--wp--preset--color--brass); }

/* ---------- Menu board ---------- */
.wp-block-table.is-style-menu table { border-collapse: collapse; width: 100%; table-layout: auto; }
.wp-block-table.is-style-menu td {
	border: 0;
	padding: 9px 0;
	vertical-align: bottom;
	font-weight: 600;
}
.wp-block-table.is-style-menu tr td { border-bottom: 2px dotted rgba(21, 17, 15, 0.22); }
.wp-block-table.is-style-menu td:first-child { padding-right: 12px; }
.wp-block-table.is-style-menu td:last-child {
	text-align: right;
	width: 1%;
	white-space: nowrap;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	padding-left: 12px;
}
.wp-block-table.is-style-menu td em {
	display: block;
	font-style: normal;
	font-weight: 400;
	font-size: 0.92rem;
	color: var(--wp--preset--color--menu-text);
}

/* ---------- Gallery ---------- */
.wp-block-gallery.saloon-gallery img { border-radius: 3px; }

/* ---------- Map ---------- */
.saloon-map {
	border: 1px solid rgba(243, 234, 208, 0.14);
	border-radius: 6px;
	overflow: hidden;
	min-height: 360px;
	height: 100%;
}
.saloon-map iframe {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 360px;
	border: 0;
	filter: grayscale(0.3) contrast(1.05);
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid rgba(243, 234, 208, 0.14); }
.site-footer a { color: var(--wp--preset--color--cream-dim); }

/* ---------- Regular pages (e.g. the remodel page) ---------- */
.saloon-page .wp-block-post-content a { color: var(--wp--preset--color--brass); }

/* ---------- Remodel page (built with Toolset Views) ---------- */
/* Banner: brings back the brick photo the old theme used behind the page heading */
.remodel-page .header-image {
	position: relative;
	padding: 48px 32px;
	border-radius: 6px;
	overflow: hidden;
	background: url("/wp-content/uploads/2018/04/IMG_0192-2.jpg") center / cover;
}
.remodel-page .header-image::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgba(21, 17, 15, 0.85), rgba(21, 17, 15, 0.45));
}
.remodel-page .header-image > * { position: relative; }
.remodel-page .header-image h1 { font-size: var(--wp--preset--font-size--xx-large); margin: 0 0 0.3em; }
.remodel-page .header-image h3 {
	font-family: var(--wp--preset--font-family--smallcaps);
	color: var(--wp--preset--color--brass);
	letter-spacing: 0.08em;
	font-size: 1.2rem;
	margin: 0;
}

/* The post list: no bullets, a divider between posts, title above the date */
.remodel-page .wpv-loop { list-style: none; margin: 0; padding: 0; }
.remodel-page .wpv-loop > li {
	padding-bottom: 2.5rem;
	margin-bottom: 2.5rem;
	border-bottom: 1px solid rgba(243, 234, 208, 0.14);
}
.remodel-page .wpv-loop > li:last-child { border-bottom: 0; }
.remodel-page .wpv-loop .row > [class*="col-"] { display: flex; flex-direction: column; }
.remodel-page .wpv-loop .row > [class*="col-"] > h2:first-of-type { order: -2; margin: 0 0 0.25em; font-size: var(--wp--preset--font-size--x-large); }
.remodel-page .wpv-loop .row > [class*="col-"] > h4:first-of-type {
	order: -1;
	margin: 0 0 1em;
	font-family: var(--wp--preset--font-family--smallcaps);
	font-size: 1rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--brass);
}
.remodel-page .wpv-loop h2 a { text-decoration: none; }
.remodel-page .wpv-loop p:empty { display: none; }
.remodel-page .main-content a:not(.wp-element-button) { color: var(--wp--preset--color--brass); }
.remodel-page .main-content .wpv-loop h2 a { color: var(--wp--preset--color--cream); }

/* Photo galleries from Jetpack are a fixed 500px wide; keep them inside the column */
.remodel-page .tiled-gallery,
.saloon-page .tiled-gallery { max-width: 100%; }
.saloon-page .tiled-gallery .gallery-row { margin: 0 auto; }

/* Sidebar: search box and email sign-up */
.saloon-page .wp-block-search__inside-wrapper {
	border: 1px solid rgba(243, 234, 208, 0.3);
	border-radius: 4px;
	background: var(--wp--preset--color--ink-2);
}
.saloon-page .wp-block-search__input {
	background: transparent;
	border: 0;
	color: var(--wp--preset--color--cream);
}
.saloon-page .wp-block-search__button { background: var(--wp--preset--color--red); color: var(--wp--preset--color--cream); border: 0; }
.saloon-page .wp-block-jetpack-subscriptions input[type="email"] {
	box-sizing: border-box;
	width: 100%;
	background: var(--wp--preset--color--ink-2);
	color: var(--wp--preset--color--cream);
	border: 1px solid rgba(243, 234, 208, 0.3) !important;
	border-radius: 4px !important;
}
.saloon-page .wp-block-jetpack-subscriptions button,
.saloon-page .wp-block-jetpack-subscriptions input[type="submit"] {
	background: var(--wp--preset--color--red);
	color: var(--wp--preset--color--cream);
	border: 0;
	border-radius: 4px;
	padding: 12px 22px;
	font-weight: 600;
	cursor: pointer;
}
/* Phones: the sidebar becomes a slide-out panel (remodel.js adds .has-sidebar-drawer) */
.remodel-sidebar__toggle,
.remodel-sidebar__close,
.remodel-sidebar__backdrop { display: none; }
@media (max-width: 781px) {
	.has-sidebar-drawer .remodel-page .remodel-sidebar {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		z-index: 100001; /* above the WordPress admin bar */
		box-sizing: border-box;
		width: min(360px, 88vw);
		max-width: none;
		margin: 0;
		padding: 64px 22px 32px;
		overflow-y: auto;
		overscroll-behavior: contain;
		background: var(--wp--preset--color--ink-2);
		border-left: 1px solid rgba(243, 234, 208, 0.14);
		box-shadow: -12px 0 32px rgba(0, 0, 0, 0.5);
		transform: translateX(100%);
		visibility: hidden;
		transition: transform 0.25s ease, visibility 0s linear 0.25s;
	}
	.sidebar-open .remodel-page .remodel-sidebar {
		transform: none;
		visibility: visible;
		transition: transform 0.25s ease;
	}
	.has-sidebar-drawer .remodel-sidebar__close {
		display: block;
		position: absolute;
		top: 12px;
		right: 12px;
		width: 40px;
		height: 40px;
		border: 1px solid rgba(243, 234, 208, 0.3);
		border-radius: 50%;
		background: transparent;
		color: var(--wp--preset--color--cream);
		font-size: 1.5rem;
		line-height: 1;
		cursor: pointer;
	}
	.has-sidebar-drawer .remodel-sidebar__toggle {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		position: fixed;
		right: 16px;
		bottom: calc(16px + env(safe-area-inset-bottom));
		z-index: 900;
		padding: 12px 18px;
		border: 0;
		border-radius: 999px;
		background: var(--wp--preset--color--red);
		color: var(--wp--preset--color--cream);
		font: 600 0.95rem var(--wp--preset--font-family--body);
		box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
		cursor: pointer;
	}
	.has-sidebar-drawer .remodel-sidebar__backdrop {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 100000;
		background: rgba(0, 0, 0, 0.55);
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.25s ease;
	}
	.sidebar-open .remodel-sidebar__backdrop { opacity: 1; pointer-events: auto; }
	.sidebar-open body { overflow: hidden; }
}
@media (max-width: 781px) and (prefers-reduced-motion: reduce) {
	.has-sidebar-drawer .remodel-page .remodel-sidebar,
	.has-sidebar-drawer .remodel-sidebar__backdrop { transition: none; }
}

/* Older posts embed videos with a fixed pixel width */
.saloon-page .wp-video { width: 100% !important; max-width: 100%; }
.saloon-page video,
.saloon-page iframe,
.saloon-page img { max-width: 100%; }
.saloon-page .wp-video .mejs-container { max-width: 100%; }
.remodel-page .main-content + .wp-block-column h2 { font-size: var(--wp--preset--font-size--x-large); }

/* Phones: Jetpack tiled galleries are built at a fixed 500px; lay them out as a simple two-up grid instead */
@media (max-width: 600px) {
	.saloon-page .tiled-gallery,
	.saloon-page .tiled-gallery .gallery-row {
		width: auto !important;
		height: auto !important;
	}
	.saloon-page .tiled-gallery .gallery-row {
		display: flex;
		flex-wrap: wrap;
		gap: 4px;
		margin-bottom: 4px;
	}
	.saloon-page .tiled-gallery .gallery-group {
		width: auto !important;
		height: auto !important;
		flex: 1 1 calc(50% - 4px);
		display: flex;
		flex-direction: column;
		gap: 4px;
	}
	.saloon-page .tiled-gallery .tiled-gallery-item { margin: 0 !important; }
	.saloon-page .tiled-gallery .tiled-gallery-item img {
		width: 100% !important;
		height: auto !important;
		margin: 0 !important;
	}
}
