/* Fonts, variables.css and animations.css are linked from index.html (no @import),
   so the browser downloads them all at once instead of waiting for this file */

/* ===== CSS Reset ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
}

/* Set by NavBar while the full-screen mobile menu is open (same breakpoint as NavBar.razor.css) */
@media (max-width: 900px) {
    html.nav-menu-open,
    html.nav-menu-open body {
        overflow: hidden;
    }
}

/* Set by the lightbox while it is open */
html.lightbox-open,
html.lightbox-open body {
    overflow: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    color: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* ===== Focus ===== */
:focus-visible {
    outline: 3px solid var(--color-gold-dark);
    outline-offset: 3px;
    border-radius: 4px;
}

h1:focus {
    outline: none;
}

[id] {
    scroll-margin-top: calc(var(--nav-height) + var(--space-md));
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 1.6rem + 3vw, 3.5rem); }
h2 { font-size: clamp(1.9rem, 1.45rem + 2vw, 2.75rem); }
h3 { font-size: clamp(1.35rem, 1.2rem + 0.8vw, 1.75rem); font-weight: 600; }
h4 { font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.35rem); }

p {
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
    text-wrap: pretty;
}

.accent-text {
    font-family: var(--font-accent);
    font-weight: 600;
}

/* ===== Layout Utilities ===== */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.section {
    padding: var(--space-xl) 0;
}

.section-alt {
    background-color: var(--bg-secondary);
}

@media (min-width: 600px) {
    .container {
        padding: 0 var(--space-lg);
    }
}

@media (min-width: 769px) {
    .section {
        padding: var(--space-2xl) 0;
    }
}

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

/* ===== Section Headers ===== */
.section-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto var(--space-lg);
}

.section-header h2 {
    margin-bottom: 0;
}

.subtitle {
    font-family: var(--font-accent);
    font-weight: 600;
    font-size: 1.4rem;
    line-height: 1.3;
    color: var(--text-accent);
    margin-bottom: var(--space-xs);
}

.section-header__lead {
    margin: 0;
}

.section-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-gold-light), var(--color-gold), var(--color-gold-light));
    margin: var(--space-md) auto;
    border-radius: 2px;
}

.section-divider--left {
    margin-left: 0;
}

@media (min-width: 769px) {
    .section-header {
        margin-bottom: var(--space-xl);
    }
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    min-height: 44px;
    padding: 0.8rem 1.75rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-align: center;
    transition: background-color var(--transition-base), color var(--transition-base),
                border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* A soft glaze that sweeps across on hover */
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.7s ease;
}

.btn:hover::after {
    transform: translateX(100%);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary {
    background-color: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    box-shadow: 0 4px 14px rgba(166, 124, 82, 0.28);
}

.btn-primary:hover {
    background-color: var(--btn-primary-hover);
    color: var(--btn-primary-hover-text);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* On dark backgrounds the hover state turns light instead of dark */
.btn-on-dark:hover {
    background-color: var(--color-cream);
    color: var(--color-brown-dark);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 2px solid var(--color-gold);
}

.btn-secondary:hover {
    background-color: var(--color-gold-light);
    border-color: var(--color-gold-light);
    transform: translateY(-2px);
}

.btn-sm {
    min-height: 40px;
    padding: 0.55rem 1.1rem;
    font-size: 0.9rem;
}

.btn-lg {
    min-height: 52px;
    padding: 1rem 2.25rem;
    font-size: 1.075rem;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-cream);
}

::-webkit-scrollbar-thumb {
    background: var(--color-gold-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-gold);
}

/* ===== Form Styles ===== */
.form-group {
    margin-bottom: var(--space-lg);
    position: relative;
}

.form-input {
    width: 100%;
    padding: 0.75rem 0;
    border: none;
    border-bottom: 2px solid var(--border-subtle);
    border-radius: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color var(--transition-base), background-color var(--transition-base);
    outline: none;
}

.form-input:hover {
    border-bottom-color: var(--color-gold-light);
}

.form-input:focus {
    border-bottom-color: var(--color-gold);
}

.form-input:focus-visible {
    outline: none;
    background-color: rgba(232, 213, 168, 0.12);
}

.form-group:has(.validation-message) .form-input {
    border-bottom-color: var(--color-error);
}

.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.form-label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

textarea.form-input {
    resize: vertical;
    min-height: 140px;
}

.validation-message {
    color: var(--color-error);
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: var(--space-xs);
    animation: fadeIn 250ms ease both;
}

/* ===== Blazor specific ===== */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* ===== Selection ===== */
::selection {
    background-color: var(--color-gold-light);
    color: var(--color-brown-dark);
}

/* ===== Reduced motion: keep the content, drop the movement ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 1ms !important;
        animation-delay: 0ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
        transition-delay: 0ms !important;
        scroll-behavior: auto !important;
    }

    [data-animate] {
        opacity: 1;
    }
}
