/*
 * ============================================================
 * Pumpkin Carving/Decorating Contest
 * File: css/styles.css
 * Purpose: Shared site-wide styling
 * Copyright: © 2026 Nathan Ostrander
 * ============================================================
 */


/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */

:root {
    color-scheme: dark;

    /* Backgrounds */
    --background: #100b1d;
    --background-deep: #0b0814;
    --background-alt: #171024;

    --surface: #1b142d;
    --surface-secondary: #251a39;
    --surface-hover: #302144;

    /* Halloween accents */
    --pumpkin: #f28c28;
    --pumpkin-light: #ffb357;
    --pumpkin-dark: #c76a18;

    --moonlight: #f0ddb7;
    --purple: #956bc0;
    --purple-light: #c5a4e1;

    /* Typography */
    --text: #f4eaf9;
    --text-muted: #c7b8d5;
    --text-subtle: #a795b9;

    /* Borders */
    --border: rgba(217, 199, 237, 0.18);
    --border-strong: rgba(217, 199, 237, 0.32);

    /* Status */
    --success: #78cfa0;
    --success-background: rgba(54, 156, 105, 0.13);

    --error: #ff9292;
    --error-background: rgba(205, 65, 75, 0.13);

    --warning: #ffd080;
    --warning-background: rgba(242, 140, 40, 0.11);

    /* Layout */
    --container-width: 1180px;

    --radius-small: 8px;
    --radius-medium: 12px;
    --radius-large: 18px;

    /* Shadows */
    --shadow-card: 0 12px 35px rgba(0, 0, 0, 0.22);
    --shadow-strong: 0 20px 55px rgba(0, 0, 0, 0.38);

    /* Transitions */
    --transition-fast: 0.18s ease;
    --transition-normal: 0.25s ease;
}


/* ============================================================
   2. RESET AND BASE STYLES
   ============================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;

    display: flex;
    flex-direction: column;

    background:
        radial-gradient(
            ellipse at 50% 0%,
            rgba(92, 48, 124, 0.13),
            transparent 55%
        ),
        var(--background);

    color: var(--text);

    font-family:
        "Segoe UI",
        "Trebuchet MS",
        Arial,
        sans-serif;

    font-size: 16px;
    line-height: 1.6;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

main {
    display: block;
    flex: 1 0 auto;
    width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.25;
    font-weight: 750;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    overflow-wrap: break-word;
}

p {
    margin-top: 0;
}

a {
    color: var(--pumpkin-light);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--moonlight);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
}

img,
picture,
video,
canvas,
svg {
    max-width: 100%;
}

img {
    display: block;
    height: auto;
}

[hidden] {
    display: none !important;
}

::selection {
    background: rgba(242, 140, 40, 0.42);
    color: #fff;
}


/* ============================================================
   3. ACCESSIBILITY
   ============================================================ */

:focus-visible {
    outline: 3px solid var(--pumpkin-light);
    outline-offset: 3px;
}

:focus:not(:focus-visible) {
    outline: none;
}

.skip-link {
    position: absolute;
    z-index: 9999;
    top: -100px;
    left: 12px;

    padding: 0.75rem 1rem;

    border-radius: var(--radius-small);
    background: var(--pumpkin);
    color: #160d1d;

    font-weight: 700;
    text-decoration: none;
}

.skip-link:focus {
    top: 12px;
}

.sr-only,
.visually-hidden {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;

    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}


/* ============================================================
   4. CONTAINERS
   ============================================================ */

.container {
    width: min(
        calc(100% - 2.5rem),
        var(--container-width)
    );

    margin-inline: auto;
}

.container-narrow {
    width: min(
        calc(100% - 2.5rem),
        850px
    );

    margin-inline: auto;
}

.section {
    padding: 4.5rem 0;
}

.section-alt {
    background: var(--background-alt);
}

.section-heading {
    max-width: 760px;
    margin: 0 auto 2.5rem;
    text-align: center;
}

.section-heading h2 {
    margin: 0 0 0.8rem;

    color: var(--pumpkin-light);
    font-size: clamp(1.7rem, 3.5vw, 2.7rem);
}

.section-heading p {
    color: var(--text-muted);
    line-height: 1.8;
}


/* ============================================================
   5. SITE HEADER
   ============================================================ */

.site-header {
    position: relative;
    z-index: 100;

    width: 100%;

    border-bottom: 1px solid var(--border);

    background: rgba(16, 11, 29, 0.97);

    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.18);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 1.5rem;

    min-height: 82px;
}

.site-logo {
    display: inline-flex;
    align-items: center;

    gap: 0.7rem;

    color: var(--pumpkin-light);

    font-size: clamp(1.05rem, 2vw, 1.35rem);
    font-weight: 800;

    letter-spacing: -0.02em;
    line-height: 1.25;

    text-decoration: none;

    transition: color var(--transition-fast);
}

.site-logo:hover {
    color: var(--moonlight);
}

.site-logo span {
    flex-shrink: 0;
    font-size: 1.8rem;
    line-height: 1;
}


/* ============================================================
   6. DESKTOP NAVIGATION
   ============================================================ */

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 0.2rem;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;
    padding: 0.65rem 0.9rem;

    border-radius: var(--radius-small);

    color: var(--text-muted);

    font-size: 0.94rem;
    font-weight: 650;

    text-decoration: none;

    white-space: nowrap;

    transition:
        background var(--transition-fast),
        color var(--transition-fast);
}

.site-nav a:hover {
    background: rgba(242, 140, 40, 0.08);
    color: var(--pumpkin-light);
}

.site-nav a.active,
.site-nav a[aria-current="page"] {
    background: rgba(242, 140, 40, 0.12);
    color: var(--pumpkin-light);
}


/* ============================================================
   7. MOBILE NAVIGATION TOGGLE
   ============================================================ */

.nav-toggle {
    display: none;

    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 5px;

    width: 45px;
    height: 45px;

    padding: 0;

    border: 1px solid var(--border-strong);
    border-radius: var(--radius-small);

    background: var(--surface);

    color: var(--text);
}

.nav-toggle span {
    display: block;

    width: 21px;
    height: 2px;

    border-radius: 2px;

    background: var(--pumpkin-light);

    transition:
        transform var(--transition-fast),
        opacity var(--transition-fast);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* ============================================================
   8. SITE FOOTER
   ============================================================ */

.site-footer {
    flex-shrink: 0;

    padding: 1.8rem 0;

    border-top: 1px solid var(--border);

    background: var(--background-deep);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;

    flex-wrap: wrap;

    gap: 0.75rem 2rem;
}

.footer-inner p {
    margin: 0;

    color: var(--text-subtle);

    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-inner p:last-child {
    color: var(--purple-light);
}


/* ============================================================
   9. TYPOGRAPHY HELPERS
   ============================================================ */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-pumpkin {
    color: var(--pumpkin-light);
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success);
}

.text-error {
    color: var(--error);
}

.text-warning {
    color: var(--warning);
}

.lead {
    color: var(--text-muted);
    font-size: 1.15rem;
    line-height: 1.85;
}

.eyebrow {
    color: var(--pumpkin-light);

    font-size: 0.85rem;
    font-weight: 800;

    letter-spacing: 0.12em;
    text-transform: uppercase;
}


/* ============================================================
   10. BUTTONS
   ============================================================ */

.btn,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 0.55rem;

    min-height: 46px;

    padding: 0.75rem 1.4rem;

    border: 1px solid transparent;
    border-radius: var(--radius-medium);

    font: inherit;
    font-size: 0.95rem;
    font-weight: 750;
    line-height: 1.3;

    text-align: center;
    text-decoration: none;

    transition:
        transform var(--transition-fast),
        background var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast);
}

.btn:hover:not(:disabled),
.button:hover:not(:disabled) {
    transform: translateY(-2px);
}

.btn-primary,
.button-primary {
    background: var(--pumpkin);
    color: #170d1d;
}

.btn-primary:hover:not(:disabled),
.button-primary:hover:not(:disabled) {
    background: var(--pumpkin-light);
    color: #170d1d;
}

.btn-secondary,
.button-secondary {
    border-color: var(--border-strong);

    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.btn-secondary:hover:not(:disabled),
.button-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.btn-outline,
.button-outline {
    border-color: var(--pumpkin);

    background: transparent;
    color: var(--pumpkin-light);
}

.btn-outline:hover:not(:disabled),
.button-outline:hover:not(:disabled) {
    background: rgba(242, 140, 40, 0.1);
}

.btn-danger,
.button-danger {
    background: #a83f4e;
    color: #fff;
}

.btn-danger:hover:not(:disabled),
.button-danger:hover:not(:disabled) {
    background: #c65361;
    color: #fff;
}

.btn:disabled,
.button:disabled {
    opacity: 0.48;
    transform: none;
}

.btn-block,
.button-block {
    width: 100%;
}

.btn-small,
.button-small {
    min-height: 38px;
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
}

.btn-large,
.button-large {
    min-height: 54px;
    padding: 0.95rem 1.8rem;
    font-size: 1.05rem;
}


/* ============================================================
   11. CARDS
   ============================================================ */

.card {
    padding: 1.7rem;

    border: 1px solid var(--border);
    border-radius: var(--radius-large);

    background: var(--surface);

    box-shadow: var(--shadow-card);
}

.card h2,
.card h3 {
    color: var(--pumpkin-light);
}

.card p {
    color: var(--text-muted);
}

.card-hover {
    transition:
        transform var(--transition-normal),
        border-color var(--transition-normal);
}

.card-hover:hover {
    transform: translateY(-4px);
    border-color: rgba(242, 140, 40, 0.5);
}

.panel {
    padding: 2rem;

    border: 1px solid var(--border);
    border-radius: var(--radius-large);

    background: var(--surface);
}


/* ============================================================
   12. FORM ELEMENTS
   ============================================================ */

.form-group {
    margin-bottom: 1.4rem;
}

.form-label,
.form-group label {
    display: block;

    margin-bottom: 0.45rem;

    color: var(--text);

    font-weight: 700;
}

.form-help,
.form-hint {
    display: block;

    margin-top: 0.4rem;

    color: var(--text-subtle);

    font-size: 0.88rem;
    line-height: 1.6;
}

.form-control,
.form-input,
.form-select,
.form-textarea {
    display: block;

    width: 100%;
    min-height: 46px;

    padding: 0.75rem 0.9rem;

    border: 1px solid var(--border-strong);
    border-radius: var(--radius-small);

    background: #120d20;
    color: var(--text);

    font: inherit;

    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast);
}

.form-control:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--pumpkin);

    outline: none;

    box-shadow: 0 0 0 3px rgba(242, 140, 40, 0.13);
}

.form-control::placeholder,
.form-input::placeholder,
.form-textarea::placeholder {
    color: #9584a7;
}

textarea.form-control,
textarea.form-textarea {
    min-height: 120px;
    resize: vertical;
}

select.form-control,
select.form-select {
    cursor: pointer;
}

input[type="file"] {
    max-width: 100%;
    color: var(--text-muted);
}

input[type="file"]::file-selector-button {
    margin-right: 1rem;

    padding: 0.6rem 1rem;

    border: 1px solid var(--border-strong);
    border-radius: var(--radius-small);

    background: var(--surface-secondary);
    color: var(--text);

    font: inherit;
    font-weight: 650;

    cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
    background: var(--surface-hover);
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--pumpkin);
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.form-checkbox input {
    flex-shrink: 0;
    margin-top: 0.35rem;
}

.form-checkbox label {
    margin: 0;
    line-height: 1.65;
}

.form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 1.5rem;
}


/* ============================================================
   13. ALERTS AND MESSAGES
   ============================================================ */

.alert {
    margin: 1rem 0;
    padding: 1rem 1.2rem;

    border: 1px solid var(--border);
    border-radius: var(--radius-medium);

    background: var(--surface-secondary);
    color: var(--text);

    line-height: 1.7;
}

.alert-success,
.message-success {
    border-color: rgba(120, 207, 160, 0.35);

    background: var(--success-background);
    color: #b7efce;
}

.alert-error,
.message-error {
    border-color: rgba(255, 146, 146, 0.35);

    background: var(--error-background);
    color: #ffd0d0;
}

.alert-warning,
.message-warning {
    border-color: rgba(255, 208, 128, 0.35);

    background: var(--warning-background);
    color: #ffe2ad;
}

.alert-info,
.message-info {
    border-color: rgba(197, 164, 225, 0.3);

    background: rgba(149, 107, 192, 0.12);
    color: #e1c9f2;
}


/* ============================================================
   14. STATUS INDICATORS
   ============================================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;

    padding: 0.4rem 0.8rem;

    border: 1px solid var(--border-strong);
    border-radius: 999px;

    background: var(--surface-secondary);
    color: var(--text-muted);

    font-size: 0.82rem;
    font-weight: 750;
}

.status-badge.open {
    border-color: rgba(120, 207, 160, 0.4);
    color: var(--success);
}

.status-badge.closed {
    border-color: rgba(255, 146, 146, 0.3);
    color: var(--error);
}

.status-badge.pending {
    border-color: rgba(255, 208, 128, 0.35);
    color: var(--warning);
}


/* ============================================================
   15. LOADING INDICATORS
   ============================================================ */

.loading-spinner {
    display: inline-block;

    width: 35px;
    height: 35px;

    border: 3px solid rgba(217, 199, 237, 0.2);
    border-top-color: var(--pumpkin);

    border-radius: 50%;

    animation: pumpkin-spin 0.8s linear infinite;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 1rem;

    min-height: 180px;

    padding: 2rem;

    color: var(--text-muted);
    text-align: center;
}

@keyframes pumpkin-spin {
    to {
        transform: rotate(360deg);
    }
}


/* ============================================================
   16. GRID UTILITIES
   ============================================================ */

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
}


/* ============================================================
   17. SPACING UTILITIES
   ============================================================ */

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.w-100 {
    width: 100%;
}


/* ============================================================
   18. DIVIDERS
   ============================================================ */

hr {
    height: 1px;
    margin: 2rem 0;

    border: 0;
    background: var(--border);
}

.divider {
    height: 1px;
    background: var(--border);
}


/* ============================================================
   19. RESPONSIVE NAVIGATION
   ============================================================ */

@media (max-width: 900px) {

    .header-inner {
        min-height: 72px;
    }

    .nav-toggle {
        display: flex;
        flex-shrink: 0;
    }

    .site-nav {
        position: absolute;

        top: 100%;
        left: 0;
        right: 0;

        display: none;
        flex-direction: column;
        align-items: stretch;

        gap: 0.3rem;

        padding: 1rem max(
            1.25rem,
            calc((100vw - var(--container-width)) / 2)
        );

        border-bottom: 1px solid var(--border);

        background: #160e25;

        box-shadow: 0 15px 25px rgba(0, 0, 0, 0.25);
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav a {
        justify-content: flex-start;

        width: 100%;
        min-height: 46px;

        padding: 0.8rem 1rem;

        font-size: 1rem;
    }

    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* ============================================================
   20. TABLET LAYOUT
   ============================================================ */

@media (max-width: 760px) {

    .container,
    .container-narrow {
        width: calc(100% - 2rem);
    }

    .section {
        padding: 3rem 0;
    }

    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
        align-items: center;

        text-align: center;
    }
}


/* ============================================================
   21. MOBILE LAYOUT
   ============================================================ */

@media (max-width: 480px) {

    body {
        font-size: 15px;
    }

    .site-logo {
        font-size: 1rem;
    }

    .site-logo span {
        font-size: 1.5rem;
    }

    .header-inner {
        gap: 0.75rem;
    }

    .grid-4 {
        grid-template-columns: 1fr;
    }

    .card,
    .panel {
        padding: 1.25rem;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions .btn,
    .form-actions .button {
        width: 100%;
    }
}


/* ============================================================
   22. REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ============================================================
   END OF SHARED STYLESHEET
   ============================================================ */
