/*
 * Angel Bags for Savannah — hand-written theme styles.
 *
 * app.css holds the compiled Tailwind utilities used by the templates. This file
 * covers everything Tailwind doesn't: WordPress integration, the menu overlay,
 * scroll effects, and editor (post/page) content. Colors come from the same
 * HSL tokens defined in app.css (--background, --primary, --accent, ...).
 */

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

html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

:focus-visible {
	outline: 2px solid hsl(var(--primary));
	outline-offset: 3px;
}

.skip-link {
	position: absolute;
	top: -100px;
	left: 1rem;
	z-index: 100;
	padding: 0.75rem 1rem;
	background: hsl(var(--accent));
	color: hsl(var(--background));
	font-size: 0.875rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.skip-link:focus {
	top: 1rem;
}

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

/* Utilities used by templates but not present in the compiled Tailwind build. */
.hover\:text-primary:hover {
	color: hsl(var(--primary));
}

@media (min-width: 1024px) {
	.lg\:grid-cols-3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* ------------------------------------------------------------------ *
 * Header
 * ------------------------------------------------------------------ */

.site-header {
	transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

.site-header.is-scrolled {
	background-color: hsl(var(--background) / 0.9);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	box-shadow: 0 1px 0 hsl(var(--accent) / 0.08);
}

/* Keep the fixed header and menu below the WordPress admin bar. */
.admin-bar .site-header,
.admin-bar .site-menu {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .site-header,
	.admin-bar .site-menu {
		top: 46px;
	}
}

/* ------------------------------------------------------------------ *
 * Social icons (footer and menu overlay)
 * ------------------------------------------------------------------ */

.social-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 1.5rem 0 0;
	padding: 0;
	list-style: none;
}

.social-links__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 9999px;
	transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* On the dark footer. */
.social-links--dark .social-links__link {
	border: 1px solid hsl(var(--background) / 0.25);
	color: hsl(var(--background) / 0.8);
}

.social-links--dark .social-links__link:hover,
.social-links--dark .social-links__link:focus-visible {
	border-color: hsl(var(--secondary));
	background-color: hsl(var(--secondary));
	color: hsl(var(--accent));
}

/* On the light menu overlay. */
.social-links--light {
	margin-top: 1rem;
}

.social-links--light .social-links__link {
	border: 1px solid hsl(var(--primary) / 0.25);
	color: hsl(var(--primary));
}

.social-links--light .social-links__link:hover,
.social-links--light .social-links__link:focus-visible {
	border-color: hsl(var(--primary));
	background-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
}

/* ------------------------------------------------------------------ *
 * Menu overlay
 * ------------------------------------------------------------------ */

.site-menu {
	position: fixed;
	inset: 0;
	z-index: 50;
	overflow-y: auto;
	background-color: hsl(var(--background));
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.5s;
}

.menu-open .site-menu {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
}

.menu-open {
	overflow: hidden;
}

.site-menu__inner {
	display: flex;
	flex-direction: column;
	min-height: 100%;
}

.site-menu__nav {
	display: flex;
	flex: 1;
	align-items: center;
	padding-block: 3rem;
}

.site-menu__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-menu__item {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.menu-open .site-menu__item {
	opacity: 1;
	transform: none;
	transition-delay: calc(var(--item-index, 0) * 60ms + 150ms);
}

.site-menu__link {
	display: flex;
	align-items: baseline;
	gap: 1.25rem;
	padding-block: 0.1em;
	font-family: var(--font-display);
	font-size: clamp(2.5rem, 7vw, 5.5rem);
	line-height: 1.05;
	color: hsl(var(--foreground));
	transition: color 0.3s ease;
}

.site-menu__num {
	flex-shrink: 0;
	width: 2rem;
	font-family: var(--font-body);
	font-size: 0.75rem;
	letter-spacing: 0.3em;
	color: hsl(var(--primary) / 0.6);
}

.site-menu__link:hover .site-menu__label,
.site-menu__link:focus-visible .site-menu__label,
.site-menu__link[aria-current="page"] .site-menu__label {
	font-style: italic;
	color: hsl(var(--primary));
}

/* Sub-pages: small links under their parent, aligned with its label. */
.site-menu__sub {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.5rem;
	margin: 0.25rem 0 0.75rem;
	padding: 0 0 0 3.25rem;
	list-style: none;
}

.site-menu__sub a {
	font-size: 0.875rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: hsl(var(--foreground) / 0.6);
	transition: color 0.3s ease;
}

.site-menu__sub a:hover,
.site-menu__sub a:focus-visible,
.site-menu__sub a[aria-current="page"] {
	color: hsl(var(--primary));
}

.site-menu__footer {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	padding-block: 2rem;
	border-top: 1px solid hsl(var(--accent) / 0.15);
}

.site-menu__contact {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	color: hsl(var(--foreground) / 0.6);
}

.site-menu__contact a:hover {
	color: hsl(var(--primary));
}

@media (min-width: 768px) {
	.site-menu__footer {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
}

@media (prefers-reduced-motion: reduce) {
	.site-menu,
	.site-menu__item {
		transition: none;
		transform: none;
	}
}

/* ------------------------------------------------------------------ *
 * Scroll reveal (assets/js/theme.js adds .is-revealed)
 * Content stays visible when JavaScript is off.
 * ------------------------------------------------------------------ */

.js [data-reveal] {
	opacity: 0;
	transform: translateY(32px);
	transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
	transition-delay: var(--reveal-delay, 0s);
}

.js [data-reveal].is-revealed {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.js [data-reveal] {
		opacity: 1;
		transform: none;
		transition: none;
	}
}

/* ------------------------------------------------------------------ *
 * Home hero
 * ------------------------------------------------------------------ */

.hero-media {
	transform: scale(1.08);
	will-change: transform;
}

/* ------------------------------------------------------------------ *
 * Gallery horizontal scroller
 * Without JS (or with reduced motion) it becomes a swipeable row.
 * ------------------------------------------------------------------ */

.gallery-scroller__track {
	will-change: transform;
}

html:not(.js) .gallery-scroller,
.gallery-scroller.is-static {
	height: auto;
}

html:not(.js) .gallery-scroller__viewport,
.gallery-scroller.is-static .gallery-scroller__viewport {
	position: static;
	height: auto;
	padding-block: 2rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
}

html:not(.js) .gallery-scroller__track figure,
.gallery-scroller.is-static .gallery-scroller__track figure {
	scroll-snap-align: start;
}

/* ------------------------------------------------------------------ *
 * Team cards: bio sits under the photo; touch users see the photo in color.
 * ------------------------------------------------------------------ */

.team-grid {
	row-gap: 5rem;
}

@media (min-width: 768px) {
	.team-grid {
		row-gap: 6rem;
	}
}

@media (hover: none) {
	.team-card .grayscale {
		--tw-grayscale: grayscale(0);
	}
}

/* ------------------------------------------------------------------ *
 * Contact form (Forminator, "None" design style)
 * Matches the original design: underlined fields, small uppercase labels.
 * ------------------------------------------------------------------ */

.ab-form .forminator-ui {
	font-family: var(--font-body);
}

.ab-form .forminator-row {
	display: grid;
	gap: 2rem;
	margin: 0 0 2rem;
}

@media (min-width: 640px) {
	.ab-form .forminator-row {
		grid-template-columns: repeat(12, minmax(0, 1fr));
	}

	.ab-form .forminator-col {
		grid-column: span 12;
	}

	.ab-form .forminator-col-6 {
		grid-column: span 6;
	}
}

.ab-form .forminator-col {
	width: auto;
	max-width: none;
	margin: 0;
	padding: 0;
	flex: none;
}

.ab-form .forminator-label {
	display: block;
	margin-bottom: 0.75rem;
	font-size: 0.75rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: hsl(var(--primary));
}

.ab-form .forminator-required {
	color: hsl(var(--primary) / 0.6);
}

.ab-form .forminator-input,
.ab-form .forminator-textarea,
.ab-form select {
	width: 100%;
	padding: 0.75rem 0;
	border: 0;
	border-bottom: 1px solid hsl(var(--primary) / 0.25);
	border-radius: 0;
	background: transparent;
	font-family: inherit;
	font-size: 1.125rem;
	color: hsl(var(--foreground));
	transition: border-color 0.2s ease;
}

.ab-form .forminator-input::placeholder,
.ab-form .forminator-textarea::placeholder {
	color: hsl(var(--foreground) / 0.4);
}

.ab-form .forminator-input:focus,
.ab-form .forminator-textarea:focus,
.ab-form select:focus {
	border-bottom-color: hsl(var(--primary));
	outline: none;
}

.ab-form .forminator-textarea {
	min-height: 140px;
	resize: none;
}

.ab-form select option {
	background: hsl(var(--background));
	color: hsl(var(--foreground));
}

/* Field errors. */
.ab-form .forminator-has_error .forminator-input,
.ab-form .forminator-has_error .forminator-textarea {
	border-bottom-color: hsl(var(--destructive));
}

.ab-form .forminator-error-message {
	display: block;
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: hsl(var(--destructive));
}

/* Send button, styled like the site's primary button with a paper-plane icon. */
.ab-form .forminator-button-submit {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 1rem 2rem;
	border: 0;
	border-radius: 0;
	background-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
	font-family: inherit;
	font-size: 0.875rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

.ab-form .forminator-button-submit::after {
	content: "";
	width: 1rem;
	height: 1rem;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z'/%3E%3Cpath d='m21.854 2.147-10.94 10.939'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z'/%3E%3Cpath d='m21.854 2.147-10.94 10.939'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform 0.3s ease;
}

.ab-form .forminator-button-submit:hover {
	background-color: hsl(var(--accent));
}

.ab-form .forminator-button-submit:hover::after {
	transform: translate(2px, -2px);
}

/* Success / error message above the form. */
.ab-form .forminator-response-message:not(:empty) {
	margin-bottom: 2rem;
	padding: 1rem 1.25rem;
	border-left: 2px solid hsl(var(--primary));
	background-color: hsl(var(--secondary) / 0.4);
	color: hsl(var(--accent));
}

.ab-form .forminator-response-message.forminator-error:not(:empty) {
	border-left-color: hsl(var(--destructive));
	color: hsl(var(--destructive));
}

.ab-form .forminator-response-message p {
	margin: 0;
}

/* Spam trap stays hidden. */
.ab-form .forminator-hidden {
	display: none !important;
}

/* ------------------------------------------------------------------ *
 * Editor content (default pages and posts)
 * ------------------------------------------------------------------ */

.entry-content {
	font-size: 1.125rem;
	line-height: 1.8;
	color: hsl(var(--foreground) / 0.8);
}

.entry-content > * + * {
	margin-top: 1.5em;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	margin-top: 2em;
	font-family: var(--font-display);
	line-height: 1.2;
	color: hsl(var(--foreground));
}

.entry-content h2 {
	font-size: 2.25rem;
}

.entry-content h3 {
	font-size: 1.75rem;
}

.entry-content h4 {
	font-size: 1.375rem;
}

.entry-content a {
	color: hsl(var(--primary));
	text-decoration: underline;
	text-decoration-color: hsl(var(--primary) / 0.4);
	text-underline-offset: 4px;
}

.entry-content a:hover {
	color: hsl(var(--accent));
	text-decoration-color: currentColor;
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.5em;
}

.entry-content ul {
	list-style: disc;
}

.entry-content ol {
	list-style: decimal;
}

.entry-content li + li {
	margin-top: 0.5em;
}

.entry-content blockquote {
	padding-left: 1.5em;
	border-left: 2px solid hsl(var(--secondary));
	font-family: var(--font-display);
	font-size: 1.5rem;
	font-style: italic;
	line-height: 1.4;
	color: hsl(var(--accent));
}

.entry-content img {
	height: auto;
	border-radius: 0.125rem;
}

.entry-content figcaption {
	margin-top: 0.5em;
	font-size: 0.875rem;
	color: hsl(var(--foreground) / 0.6);
}

.entry-content hr {
	border-top: 1px solid hsl(var(--primary) / 0.15);
}

.entry-content .wp-block-button__link {
	display: inline-block;
	padding: 1rem 2rem;
	border-radius: 0;
	background-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
	font-size: 0.875rem;
	letter-spacing: 0.2em;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color 0.3s ease;
}

.entry-content .wp-block-button__link:hover {
	background-color: hsl(var(--accent));
	color: hsl(var(--primary-foreground));
}

.entry-content .alignleft {
	float: left;
	margin: 0.5em 1.5em 1em 0;
}

.entry-content .alignright {
	float: right;
	margin: 0.5em 0 1em 1.5em;
}

.entry-content .aligncenter {
	margin-inline: auto;
}

/* ------------------------------------------------------------------ *
 * Blog: cards, post navigation, pagination, search
 * ------------------------------------------------------------------ */

.post-card__image {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.post-nav {
	display: grid;
	gap: 1.5rem;
	padding-top: 2rem;
	border-top: 1px solid hsl(var(--primary) / 0.15);
}

.post-nav a {
	display: block;
	font-family: var(--font-display);
	font-size: 1.5rem;
	line-height: 1.3;
	color: hsl(var(--foreground));
	transition: color 0.3s ease;
}

.post-nav a:hover {
	color: hsl(var(--primary));
}

.post-nav a span {
	display: block;
	margin-bottom: 0.5rem;
	font-family: var(--font-body);
	font-size: 0.75rem;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: hsl(var(--primary));
}

@media (min-width: 768px) {
	.post-nav {
		grid-template-columns: 1fr 1fr;
	}

	.post-nav__next {
		grid-column: 2;
		text-align: right;
	}
}

.pagination-wrap .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 4rem;
}

.pagination-wrap .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 3rem;
	height: 3rem;
	padding-inline: 1rem;
	border: 1px solid hsl(var(--primary) / 0.15);
	font-size: 0.875rem;
	letter-spacing: 0.1em;
	color: hsl(var(--primary));
	transition: background-color 0.3s ease, color 0.3s ease;
}

.pagination-wrap .page-numbers:hover,
.pagination-wrap .page-numbers.current {
	background-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
}

.search-form {
	display: flex;
	gap: 1rem;
	align-items: flex-end;
}

.search-form label {
	flex: 1;
}

.search-form .search-field {
	width: 100%;
	padding-block: 0.75rem;
	border-bottom: 1px solid hsl(var(--primary) / 0.25);
	background: transparent;
	font-size: 1.125rem;
	color: hsl(var(--foreground));
}

.search-form .search-field:focus {
	border-color: hsl(var(--primary));
	outline: none;
}

.search-form .search-submit {
	padding: 0.75rem 1.5rem;
	background-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
	font-size: 0.875rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

.search-form .search-submit:hover {
	background-color: hsl(var(--accent));
}
