/**
 * Base Styles: Layout Foundation, Typography, Links, Buttons, Forms & A11y
 */

/* ==========================================================================
   Layout Foundation: Override GeneratePress container constraints site-wide
   ========================================================================== */
body.hops-theme #page {
	min-height: 100vh;
	min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px));
	display: flex;
	flex-direction: column;
}

body.hops-theme #page.grid-container {
	max-width: 100%;
	width: 100%;
	margin-left: auto;
	margin-right: auto;
	padding: 0;
}

body.hops-theme #content.site-content {
	flex: 1 0 auto;
}

body.hops-theme #content.site-content,
body.hops-theme #primary.content-area,
body.hops-theme #main.site-main {
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
	display: block;
	background: transparent;
}

/* ==========================================================================
   Base Reset & Typography
   ========================================================================== */
*,
*::before,
*::after {
	box-sizing: border-box;
}

body,
button,
input,
textarea,
select {
	font-family: var(--font-sans);
}

html {
	scrollbar-gutter: stable;
}

html,
body {
	overflow-x: clip;
}

body {
	background-color: var(--bg-page);
	color: var(--text-body);
	font-size: var(--text-base);
	line-height: var(--leading-normal);
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.main-title,
.pin-card__title,
.pin-modal__title {
	font-family: var(--font-serif);
	color: var(--text-heading);
	line-height: var(--leading-tight);
}

a {
	color: var(--color-primary);
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

a:hover {
	color: var(--color-primary-hover);
}

img,
svg,
video,
iframe,
table {
	max-width: 100%;
}

img {
	height: auto;
}

input[type="checkbox"],
input[type="radio"] {
	accent-color: var(--color-primary);
}

.entry-content a,
.hops-arc-breadcrumb {
	overflow-wrap: anywhere;
}

/* ==========================================================================
   Focus Visible & Screen Reader / Skip Link
   ========================================================================== */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--color-primary-hover);
	outline-offset: 2px;
}

main:focus {
	outline: none;
}

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

.hops-skip-link {
	position: absolute;
	left: -9999px;
	top: var(--space-2);
	z-index: calc(var(--z-modal) + 10);
	padding: var(--space-3) var(--space-4);
	background: var(--color-primary);
	color: var(--bg-page);
	font-weight: 700;
	font-size: var(--text-sm);
	border-radius: var(--radius-sm);
	text-decoration: none;
}

.hops-skip-link:focus {
	left: var(--space-4);
}

/* ==========================================================================
   Unified Button System (.hops-btn)
   ========================================================================== */
.hops-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2);
	min-height: var(--control-h);
	padding: 8px 18px;
	border-radius: var(--radius-sm);
	border: 1px solid transparent;
	font-family: var(--font-sans);
	font-size: var(--text-sm);
	font-weight: 700;
	line-height: 1.25;
	color: var(--text-heading);
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hops-btn:hover,
.hops-btn:focus-visible {
	text-decoration: none;
}

body.hops-theme .hops-btn--primary,
body.hops-theme .hops-btn--primary:hover,
body.hops-theme .hops-btn--primary:focus,
body.hops-theme .hops-btn--primary:focus-visible {
	background-color: var(--color-primary);
	border-color: var(--color-primary);
	color: var(--color-on-primary);
}

body.hops-theme .hops-btn--primary:hover,
body.hops-theme .hops-btn--primary:focus-visible {
	background-color: var(--color-primary-hover);
	border-color: var(--color-primary-hover);
}

body.hops-theme .hops-btn--secondary,
body.hops-theme .hops-btn--secondary:focus {
	background-color: var(--bg-white);
	border-color: var(--border-soft);
	color: var(--text-heading);
}

body.hops-theme .hops-btn--secondary:hover,
body.hops-theme .hops-btn--secondary:focus-visible {
	background-color: var(--bg-page);
	border-color: var(--color-primary);
	color: var(--text-heading);
}

body.hops-theme .hops-btn--ghost,
body.hops-theme .hops-btn--ghost:focus {
	background-color: transparent;
	border-color: var(--border-soft);
	color: var(--text-heading);
}

body.hops-theme .hops-btn--ghost:hover,
body.hops-theme .hops-btn--ghost:focus-visible {
	background-color: var(--bg-surface);
	border-color: var(--color-primary);
	color: var(--text-heading);
}

.hops-btn--sm {
	min-height: 34px;
	padding: 5px 12px;
	font-size: var(--text-xs);
}

.hops-btn:disabled,
.hops-btn[aria-disabled="true"] {
	opacity: 0.65;
	cursor: not-allowed;
}

@media (hover: none), (max-width: 767px) {
	.hops-btn:not(.hops-btn--sm) {
		min-height: var(--control-h-touch);
	}
}

/* ==========================================================================
   Shared Form Controls & Validation States
   ========================================================================== */
.hops-field {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
	margin-bottom: var(--space-4);
}

.hops-label {
	font-size: var(--text-sm);
	font-weight: 700;
	color: var(--text-heading);
}

.hops-input,
.hops-textarea,
.hops-select,
.hops-contact-field input[type="text"],
.hops-contact-field input[type="email"],
.hops-contact-field textarea,
#commentform input[type="text"],
#commentform input[type="email"],
#commentform input[type="url"],
#commentform textarea {
	width: 100%;
	min-height: var(--control-h-touch);
	padding: 10px 14px;
	border: 1px solid var(--border-soft);
	border-radius: var(--radius-sm);
	background-color: var(--bg-white);
	color: var(--text-heading);
	font-family: var(--font-sans);
	font-size: var(--text-base);
	line-height: 1.4;
	transition: border-color 0.15s ease;
}

.hops-textarea {
	min-height: 120px;
	resize: vertical;
}

.hops-input::placeholder,
.hops-textarea::placeholder {
	color: var(--text-muted);
	opacity: 0.85;
}

.hops-input:focus,
.hops-textarea:focus,
.hops-select:focus {
	border-color: var(--color-primary-hover);
}

.hops-input:disabled,
.hops-textarea:disabled,
.hops-select:disabled {
	background-color: var(--bg-surface);
	color: var(--text-body);
	opacity: 0.8;
	cursor: not-allowed;
}

.hops-form-error {
	margin: var(--space-1) 0 0;
	font-size: var(--text-sm);
	font-weight: 700;
	color: var(--color-danger);
}

.hops-form-success {
	margin: var(--space-2) 0 0;
	padding: var(--space-3) var(--space-4);
	border-radius: var(--radius-sm);
	background-color: var(--bg-surface);
	border-left: 3px solid var(--color-success);
	font-size: var(--text-sm);
	font-weight: 700;
	color: var(--color-success);
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto !important;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ==========================================================================
   Ensure [hidden] always wins over component display rules (.hops-btn, .hops-arc-grid, etc.)
   ========================================================================== */
[hidden] {
	display: none !important;
}

@media (max-width: 767px) {
	body.hops-theme .hops-input,
	body.hops-theme .hops-textarea,
	body.hops-theme .hops-select,
	body.hops-theme .hops-contact-field input[type="text"],
	body.hops-theme .hops-contact-field input[type="email"],
	body.hops-theme .hops-contact-field textarea,
	body.hops-theme #commentform input[type="text"],
	body.hops-theme #commentform input[type="email"],
	body.hops-theme #commentform input[type="url"],
	body.hops-theme #commentform textarea,
	body.hops-theme input,
	body.hops-theme select,
	body.hops-theme textarea {
		font-size: 16px;
	}
}
