/* Alltech Sports Photography — sportsphotos.alltechllc.org */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --sp-bg: #0b0d10;
    --sp-bg-2: #12161b;
    --sp-bg-3: #1a2027;
    --sp-line: #262e37;
    --sp-text: #f4f6f8;
    --sp-muted: #9aa5b1;
    --sp-accent: #f5a524;
    --sp-accent-hi: #ffbb3d;
    --sp-green: #16a34a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background-color: var(--sp-bg);
    color: var(--sp-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* ---------- Type ---------- */
.display {
    font-family: 'Barlow Condensed', 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 0.95;
    font-weight: 700;
}

.eyebrow {
    font-family: 'Barlow Condensed', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--sp-accent);
}

.rule-accent { height: 3px; width: 56px; background: var(--sp-accent); border: 0; }

/* ---------- Header ---------- */
.sp-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(11, 13, 16, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--sp-line);
}

.sp-nav-link {
    font-family: 'Barlow Condensed', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--sp-muted);
    padding: 0.35rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.sp-nav-link:hover { color: var(--sp-text); }
.sp-nav-link.is-active { color: var(--sp-text); border-bottom-color: var(--sp-accent); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: 'Barlow Condensed', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.7rem 1.5rem;
    border-radius: 2px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-accent { background: var(--sp-accent); color: #14181d; }
.btn-accent:hover { background: var(--sp-accent-hi); }

.btn-ghost { border-color: #3a444f; color: var(--sp-text); background: transparent; }
.btn-ghost:hover { border-color: var(--sp-accent); color: var(--sp-accent); }

.btn-solid { background: var(--sp-text); color: #0b0d10; }
.btn-solid:hover { background: #ffffff; }

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--sp-accent);
    outline-offset: 2px;
}

/* ---------- Surfaces ---------- */
.card {
    background: var(--sp-bg-2);
    border: 1px solid var(--sp-line);
    border-radius: 3px;
}

.field {
    width: 100%;
    background: var(--sp-bg-3);
    border: 1px solid var(--sp-line);
    border-radius: 2px;
    color: var(--sp-text);
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
}

.field::placeholder { color: #6b7684; }
.field:focus { border-color: var(--sp-accent); outline: none; }

.label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--sp-muted);
    margin-bottom: 0.35rem;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: 78vh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: #05070a;
}

.hero-media {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 30%;
    filter: saturate(1.05) contrast(1.05);
}

.hero-scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, rgba(11,13,16,0.97) 0%, rgba(11,13,16,0.55) 45%, rgba(11,13,16,0.25) 100%),
        linear-gradient(to right, rgba(11,13,16,0.85) 0%, rgba(11,13,16,0.1) 60%);
}

/* ---------- Gallery grid ---------- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.photo-tile {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: var(--sp-bg-3);
    border: 1px solid var(--sp-line);
    border-radius: 2px;
    cursor: pointer;
}

.photo-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease, opacity 0.3s ease;
    opacity: 0;
}

.photo-tile img.is-loaded { opacity: 1; }
.photo-tile:hover img { transform: scale(1.04); }

.photo-tile-bar {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    background: linear-gradient(to top, rgba(6,8,11,0.92), rgba(6,8,11,0));
    font-size: 0.78rem;
    color: #cfd6dd;
}

.photo-tile.is-selected { border-color: var(--sp-accent); box-shadow: 0 0 0 2px var(--sp-accent); }

.tile-add {
    font-family: 'Barlow Condensed', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
    background: rgba(244,246,248,0.14);
    border: 1px solid rgba(244,246,248,0.25);
    color: #fff;
}

.photo-tile.is-selected .tile-add { background: var(--sp-accent); border-color: var(--sp-accent); color: #14181d; }

/* Masonry-ish portfolio */
.portfolio-grid {
    columns: 3 280px;
    column-gap: 14px;
}

.portfolio-grid figure {
    break-inside: avoid;
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
    border-radius: 2px;
    background: var(--sp-bg-3);
}

.portfolio-grid img { width: 100%; display: block; }

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(5, 7, 10, 0.96);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 1rem 1rem;
}

.lightbox.is-open { display: flex; }
.lightbox img { max-width: 100%; max-height: 78vh; object-fit: contain; }

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    width: 44px; height: 60px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}

.lightbox-nav:hover { background: rgba(255,255,255,0.16); }

/* ---------- Cart badge ---------- */
.cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--sp-accent);
    color: #14181d;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

/* ---------- Misc ---------- */
.divider { border-top: 1px solid var(--sp-line); }
.muted { color: var(--sp-muted); }

.notice {
    border-left: 3px solid var(--sp-accent);
    background: var(--sp-bg-2);
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
}

.notice-error { border-left-color: #ef4444; }
.notice-ok { border-left-color: var(--sp-green); }

.skeleton {
    background: linear-gradient(90deg, #171c22 25%, #1f262e 50%, #171c22 75%);
    background-size: 400% 100%;
    animation: sp-shimmer 1.4s ease infinite;
}

@keyframes sp-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 640px) {
    .portfolio-grid { columns: 1; }
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
}
