/*
Theme Name: The Old Horse
Theme URI: https://theoldhorse.co.uk
Author: RKH
Description: A block theme for The Old Horse pub, Leicester. Heritage-inspired design with warm tones, serif typography, and full-width atmospheric layouts.
Requires at least: 6.7
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: the-old-horse
Tags: one-column, custom-colors, custom-menu, custom-logo, editor-style, full-site-editing, block-patterns, wide-blocks, block-styles
*/

/* Double-border "picture frame" inset on buttons */
.wp-element-button {
	outline: 1px solid color-mix(in srgb, currentColor 30%, transparent);
	outline-offset: -4px;
	transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

/* Gravity Forms — match theme button styles */
.gform_wrapper .gform_footer input[type="submit"],
.gform_wrapper .gform_footer button[type="submit"],
.gform_wrapper .gform_page_footer input[type="submit"],
.gform_wrapper input.gform_button,
.gform_wrapper button.gform_button,
.gform-theme.gform-theme--framework .gform_footer input[type="submit"],
.gform-theme.gform-theme--framework button.gform-theme-button {
	font-family: var(--wp--preset--font-family--body) !important;
	font-size: 0.8125rem !important;
	font-weight: 500 !important;
	letter-spacing: 0.1em !important;
	text-transform: uppercase !important;
	background-color: var(--wp--preset--color--accent) !important;
	color: #ffffff !important;
	border: 1px solid var(--wp--preset--color--accent) !important;
	border-radius: 0px !important;
	padding: 0.8em 1.8em !important;
	cursor: pointer;
	outline: 1px solid color-mix(in srgb, #ffffff 30%, transparent) !important;
	outline-offset: -4px;
	transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.gform_wrapper .gform_footer input[type="submit"]:hover,
.gform_wrapper .gform_footer button[type="submit"]:hover,
.gform_wrapper input.gform_button:hover,
.gform_wrapper button.gform_button:hover,
.gform-theme.gform-theme--framework .gform_footer input[type="submit"]:hover,
.gform-theme.gform-theme--framework button.gform-theme-button:hover {
	background-color: #5E2832 !important;
	border-color: #5E2832 !important;
}

/* Gravity Forms — clean up field styling */
.gform_wrapper input:not([type="submit"]):not([type="button"]):not([type="image"]):not([type="hidden"]),
.gform_wrapper textarea,
.gform_wrapper select {
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--primary) 20%, transparent) !important;
	border-radius: 0px !important;
	font-family: var(--wp--preset--font-family--body) !important;
	font-size: 0.95rem !important;
	background: #ffffff !important;
	transition: border-color 0.2s ease;
}

.gform_wrapper input:not([type="submit"]):not([type="button"]):focus,
.gform_wrapper textarea:focus,
.gform_wrapper select:focus {
	border-color: var(--wp--preset--color--primary) !important;
	outline: none !important;
	box-shadow: none !important;
}

.gform_wrapper .gfield_label,
.gform_wrapper .gform-field-label {
	font-family: var(--wp--preset--font-family--body) !important;
	font-size: 0.7rem !important;
	font-weight: 500 !important;
	letter-spacing: 0.1em !important;
	text-transform: uppercase !important;
}

.gform_wrapper .gfield_description,
.gform_wrapper .ginput_counter {
	font-size: 0.8rem !important;
	opacity: 0.6;
}

.gform_wrapper .gfield_required {
	color: var(--wp--preset--color--accent) !important;
}

/* Contact split layout — keep columns flush on the anchored section */
.page-template-default .wp-block-columns.alignfull {
	gap: 0;
}

/* Section-green nav link hover (navigation block doesn't inherit section element styles) */
.is-style-section-green .wp-block-navigation-item__content:hover {
	color: #E8C4A0 !important;
}

/* Mobile overlay — give the Book a Table CTA more breathing room */
.rkh-overlay-ctas .wp-block-button__link {
	padding-top: 0.85em !important;
	padding-bottom: 0.85em !important;
}

/* Arrow button style — trailing arrow that slides on hover */
.is-style-arrow .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
}

.is-style-arrow .wp-block-button__link::after {
	content: "\2192";
	display: inline-block;
	transition: transform 0.3s ease;
}

.is-style-arrow .wp-block-button__link:hover::after {
	transform: translateX(4px);
}

/* Separators — thin 1px, inherit section text colour */
.wp-block-separator {
	border-bottom-width: 1px !important;
	color: inherit !important;
	border-color: currentColor !important;
	opacity: 0.5;
}

/* Beautiful Pubs logo — recolour dark SVG to cream (#FFF8EE) */
.is-style-section-green .beautiful-pubs-badge img {
	filter: brightness(0) invert(97%) sepia(6%) saturate(500%) hue-rotate(340deg) brightness(103%);
}

/* Active navigation link - match RKH plugin ::after underline */
.wp-block-navigation__container > .current-menu-item > .wp-block-navigation-item__content::after {
	transform: scaleX(1) !important;
	transform-origin: left !important;
}

/* Hero — staggered entrance on page load */
@media (prefers-reduced-motion: no-preference) {
	@keyframes toh-hero-entrance {
		from { opacity: 0; transform: translateY(12px); }
		to   { opacity: 1; transform: translateY(0); }
	}

	.toh-hero-entrance > * {
		animation: toh-hero-entrance 0.6s ease-out both;
	}

	.toh-hero-entrance > *:nth-child(1) { animation-delay: 0.3s; }
	.toh-hero-entrance > *:nth-child(2) { animation-delay: 0.5s; }
	.toh-hero-entrance > *:nth-child(3) { animation-delay: 0.7s; }
	.toh-hero-entrance > *:nth-child(4) { animation-delay: 0.9s; }
	.toh-hero-entrance > *:nth-child(5) { animation-delay: 1.1s; }
}

/* Full-link cover — stretches the first link across the whole card */
.wp-block-cover.is-style-full-link {
	cursor: pointer;
	overflow: hidden;
}

.wp-block-cover.is-style-full-link .wp-block-cover__inner-container {
	position: static !important;
	z-index: 1;
}

.wp-block-cover.is-style-full-link .wp-block-cover__inner-container > * {
	position: static;
}

.wp-block-cover.is-style-full-link a::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1;
}

.wp-block-cover.is-style-full-link img {
	transition: transform 0.5s ease-out;
}

.wp-block-cover.is-style-full-link:hover img {
	transform: scale(1.03);
}

.wp-block-cover.is-style-full-link a:hover {
	color: inherit;
}

/* ── Picture frames for image ticker ─────────────────────────────
   Toggle: add class "has-frames" to the ticker block in the editor.
   Creates 5 cycling frame styles evoking a pub gallery wall.
   ──────────────────────────────────────────────────────────────── */

/* Container adjustments — room for frames + shadows */
.wp-block-text-ticker-ticker-block.content-type-images.has-frames .text-ticker-container {
	padding: 2em 0;
}

.wp-block-text-ticker-ticker-block.content-type-images.has-frames .ticker-scroll-gsap {
	gap: calc(var(--ticker-item-spacing, 16px) * 2);
}

/* Base frame — shared mat + positioning */
.wp-block-text-ticker-ticker-block.content-type-images.has-frames .ticker-item-image {
	position: relative;
	padding: 12px;
	background-color: #F5F0E8 !important;
	box-sizing: border-box;
	overflow: hidden;
}

/* Constrain image + figure within the frame */
.wp-block-text-ticker-ticker-block.content-type-images.has-frames .ticker-item-image figure {
	overflow: hidden;
}

.wp-block-text-ticker-ticker-block.content-type-images.has-frames .ticker-item-image img {
	object-fit: cover !important;
	max-height: 100%;
}

/* Subtle inset shadow on images — simulates glass/rebate edge */
.wp-block-text-ticker-ticker-block.content-type-images.has-frames .ticker-item-image img {
	box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Frame 1: Ornate Gold */
.wp-block-text-ticker-ticker-block.content-type-images.has-frames .ticker-item-image:nth-child(5n+1) {
	padding: 14px;
	background-color: #FAF4E8 !important;
	border: 5px solid #C19A4E;
	outline: 2px solid #A67C3D;
	outline-offset: -1px;
	box-shadow:
		inset 0 2px 4px rgba(212, 175, 97, 0.5),
		inset 2px 0 4px rgba(212, 175, 97, 0.3),
		inset 0 -2px 3px rgba(100, 70, 20, 0.3),
		inset -2px 0 3px rgba(100, 70, 20, 0.2),
		0 4px 12px rgba(0, 0, 0, 0.25),
		0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Frame 2: Dark Walnut */
.wp-block-text-ticker-ticker-block.content-type-images.has-frames .ticker-item-image:nth-child(5n+2) {
	padding: 12px;
	background-color: #EDE7D9 !important;
	border: 6px solid #3B2314;
	outline: 1px solid #2A1A0E;
	outline-offset: 0px;
	box-shadow:
		inset 0 2px 3px rgba(90, 55, 25, 0.4),
		inset 0 -2px 3px rgba(20, 10, 5, 0.5),
		inset 2px 0 3px rgba(120, 70, 30, 0.25),
		0 5px 15px rgba(0, 0, 0, 0.3),
		0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Frame 3: Thin Gilt */
.wp-block-text-ticker-ticker-block.content-type-images.has-frames .ticker-item-image:nth-child(5n+3) {
	padding: 10px;
	background-color: #FAF6EE !important;
	border: 3px solid #B8922F;
	outline: 1px solid #D4AF61;
	outline-offset: 1px;
	box-shadow:
		inset 0 1px 2px rgba(212, 175, 97, 0.6),
		inset 0 -1px 2px rgba(80, 55, 15, 0.35),
		0 3px 8px rgba(0, 0, 0, 0.2),
		0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Frame 4: Aged Brass */
.wp-block-text-ticker-ticker-block.content-type-images.has-frames .ticker-item-image:nth-child(5n+4) {
	padding: 11px;
	background-color: #F0EBE0 !important;
	border: 4px solid #7A6B3A;
	outline: 1px solid #5C5228;
	outline-offset: 0px;
	box-shadow:
		inset 0 1px 3px rgba(140, 125, 70, 0.4),
		inset 0 -1px 2px rgba(50, 40, 15, 0.4),
		inset 1px 0 2px rgba(80, 90, 50, 0.2),
		0 4px 10px rgba(0, 0, 0, 0.22),
		0 1px 4px rgba(0, 0, 0, 0.15);
}

/* Frame 5: Black & Gold */
.wp-block-text-ticker-ticker-block.content-type-images.has-frames .ticker-item-image:nth-child(5n+5) {
	padding: 13px;
	background-color: #F5F0E6 !important;
	border: 5px solid #1C1917;
	outline: 2px solid #C19A4E;
	outline-offset: -7px;
	box-shadow:
		inset 0 0 4px rgba(193, 154, 78, 0.3),
		inset 0 2px 3px rgba(0, 0, 0, 0.15),
		inset 0 -2px 3px rgba(0, 0, 0, 0.25),
		0 5px 14px rgba(0, 0, 0, 0.3),
		0 2px 5px rgba(0, 0, 0, 0.18);
}

/* Mobile — scale down frames */
@media (max-width: 768px) {
	.wp-block-text-ticker-ticker-block.content-type-images.has-frames .text-ticker-container {
		padding: 1.5em 0;
	}

	.wp-block-text-ticker-ticker-block.content-type-images.has-frames .ticker-scroll-gsap {
		gap: calc(var(--ticker-item-spacing, 16px) * 2);
	}

	.wp-block-text-ticker-ticker-block.content-type-images.has-frames .ticker-item-image {
		padding: 8px;
	}

	.wp-block-text-ticker-ticker-block.content-type-images.has-frames .ticker-item-image:nth-child(5n+1) {
		border-width: 4px;
		padding: 10px;
	}

	.wp-block-text-ticker-ticker-block.content-type-images.has-frames .ticker-item-image:nth-child(5n+2) {
		border-width: 4px;
		padding: 9px;
	}

	.wp-block-text-ticker-ticker-block.content-type-images.has-frames .ticker-item-image:nth-child(5n+3) {
		border-width: 2px;
		padding: 7px;
	}

	.wp-block-text-ticker-ticker-block.content-type-images.has-frames .ticker-item-image:nth-child(5n+4) {
		border-width: 3px;
		padding: 8px;
	}

	.wp-block-text-ticker-ticker-block.content-type-images.has-frames .ticker-item-image:nth-child(5n+5) {
		border-width: 4px;
		outline-offset: -6px;
		padding: 9px;
	}
}