/* ============================================================
   Derwent Valley Cycling Club — Single-page styles
   Palette:
     Cream bg   #f6f4ee
     Navy        #15264A
     Red         #F80017
     Dark red    #d00014
     Text        #333
     Light grey  #e8e4dc
   ============================================================ */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 72px; /* header height */
}

body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #333;
    background-color: #f6f4ee;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: #F80017; text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #15264A;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

.header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.site-logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: .05em;
    text-decoration: none;
}
.site-logo:hover { text-decoration: none; color: #F80017; }

.site-nav a {
    color: #ddd;
    font-size: .9rem;
    font-weight: 600;
    margin-left: 1.5rem;
    transition: color .15s;
}
.site-nav a:hover, .site-nav a:focus {
    color: #fff;
    text-decoration: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    background: url('/media/crummock.jpg') center / cover no-repeat;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(21,38,74,.55), rgba(21,38,74,.7));
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 2rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.hero-jersey {
    height: 250px;
    width: auto;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,.4));
}

.hero-text {
    text-align: left;
}

.hero h1 {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: .4rem;
    line-height: 1.2;
}

.hero .tagline {
    font-size: 1.15rem;
    font-weight: 400;
    opacity: .92;
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-block;
    padding: .65rem 1.6rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: .95rem;
    transition: background-color .15s, transform .1s;
}

.btn-primary {
    background-color: #F80017;
    color: #fff;
}
.btn-primary:hover {
    background-color: #d00014;
    text-decoration: none;
    transform: translateY(-1px);
}

/* ---------- Sections ---------- */

/* Hugo may wrap consecutive shortcodes in <p> tags — neutralise */
main > p { margin: 0; padding: 0; }

.section {
    max-width: 760px;
    margin: 0 auto;
    padding: 3.5rem 1.25rem;
}

.section + .section {
    border-top: 1px solid #e8e4dc;
}

.section h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #15264A;
    margin-bottom: 1rem;
}

.section h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #15264A;
    margin-top: 1.5rem;
    margin-bottom: .5rem;
}

.section p {
    margin-bottom: .85rem;
    font-size: .95rem;
}

.section ul, .section ol {
    margin: 0 0 1rem 1.5rem;
    font-size: .95rem;
}
.section li { margin-bottom: .35rem; }

/* ---------- Gallery ---------- */

.gallery-wrapper {
    position: relative;
    margin: 1.5rem 0;
}

.gallery-strip {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.gallery-strip::-webkit-scrollbar { display: none; }

/* Hugo may wrap images in a <p> — make it transparent to flex */
.gallery-strip p {
    display: contents;
}

.gallery-strip img {
    flex: 0 0 calc((100% - 1rem) / 3);
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    scroll-snap-align: start;
    cursor: pointer;
    transition: opacity .15s;
}
.gallery-strip img:hover { opacity: .85; }

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: rgba(21,38,74,.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.gallery-arrow:hover { background: rgba(21,38,74,.9); }
.gallery-arrow-left { left: .4rem; }
.gallery-arrow-right { right: .4rem; }
.gallery-wrapper.has-overflow .gallery-arrow { display: flex; }

/* ---------- Lightbox ---------- */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,.85);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.lightbox-overlay.active { display: flex; }

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 4px;
    cursor: default;
    box-shadow: 0 4px 30px rgba(0,0,0,.5);
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    opacity: .8;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.15);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.lightbox-nav:hover { background: rgba(255,255,255,.3); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

/* ---------- Info cards (rides, fees) ---------- */

.card-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.card {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    padding: 1.25rem;
}

.card h3 {
    margin-top: 0;
    font-size: 1.05rem;
    color: #15264A;
    border-left: 3px solid #F80017;
    padding-left: .6rem;
}

.card p, .card li {
    font-size: .9rem;
}

/* ---------- Fee table ---------- */

.section table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: .9rem;
}

.section th, .section td {
    text-align: left;
    padding: .5rem .75rem;
    border-bottom: 1px solid #e8e4dc;
}

.section th {
    font-weight: 600;
    color: #15264A;
}

/* ---------- Contact ---------- */

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.contact-links a {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: 600;
}

/* ---------- Footer ---------- */

.site-footer {
    background-color: #15264A;
    color: #aaa;
    text-align: center;
    padding: 2rem 1.25rem;
    font-size: .85rem;
}

.site-footer a { color: #F80017; }
.site-footer a:hover { color: #fff; }
.footer-social { margin-top: .5rem; }
.sep { margin: 0 .25rem; }

/* ---------- Responsive ---------- */

@media (max-width: 680px) {
    .nav-toggle { display: block; }

    .site-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background-color: #15264A;
        padding: .75rem 0;
        box-shadow: 0 4px 8px rgba(0,0,0,.2);
    }

    .site-nav.open { display: flex; flex-direction: column; align-items: center; }
    .site-nav a { margin: .5rem 0; font-size: 1rem; }

    .hero { min-height: 320px; }
    .hero-content { flex-direction: column; gap: 1.5rem; }
    .hero-text { text-align: center; }
    .hero-jersey { height: 180px; }
    .hero h1 { font-size: 1.7rem; }

    .section { padding: 2.5rem 1rem; }

    .gallery-strip img { flex: 0 0 calc(100% - .25rem); height: 180px; }
}
