/* ============================================================
 * Maurice Geldhof — nostalgia overlay
 * Sepia/parchment palette, modern typography, subtle grain.
 * Loads AFTER the template's style.css to override safely.
 * ============================================================ */

:root {
    --mg-cream:      #f4ecd8;
    --mg-parchment:  #ece1c4;
    --mg-paper:      #e8dcbb;
    --mg-ink:        #2b211a;
    --mg-ink-soft:   #4a3a2c;
    --mg-mute:       #6b5a47;
    --mg-rule:       rgba(43, 33, 26, 0.18);
    --mg-accent:     #8a2a1f;   /* faded racing red */
    --mg-accent-2:   #b58330;   /* mustard / yellow jersey */
    --mg-shadow:     0 10px 30px rgba(60, 40, 20, 0.18);
    --mg-radius:     2px;        /* deliberately tight, vintage */
    --mg-display:    "Playfair Display", "Cormorant Garamond", Georgia, serif;
    --mg-body:       "Inter", "Helvetica Neue", Arial, sans-serif;
    --mg-mono:       "JetBrains Mono", ui-monospace, Menlo, monospace;
}

/* ---------- base ---------- */
html, body {
    background: var(--mg-cream) !important;
    color: var(--mg-ink) !important;
    font-family: var(--mg-body) !important;
    font-size: 16.5px;
    line-height: 1.7;
    letter-spacing: 0.005em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle aged-paper grain via repeating gradient (no extra HTTP). */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image:
        radial-gradient(rgba(120,90,55,0.06) 1px, transparent 1px),
        radial-gradient(rgba(60,40,20,0.05)  1px, transparent 1px);
    background-size: 3px 3px, 7px 7px;
    background-position: 0 0, 1px 2px;
    mix-blend-mode: multiply;
    opacity: 0.55;
}
.wrapper { position: relative; z-index: 2; }

/* ---------- typography ---------- */
h1, h2, h3, h4, h5, h6,
.font-alt, .module-title, .hero-text h1, .hero-text h5 {
    font-family: var(--mg-display) !important;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--mg-ink) !important;
}
.font-serif { font-family: var(--mg-display) !important; font-style: italic; }

h2.module-title {
    font-size: 2.4rem;
    margin-bottom: 2.6rem;
    padding-bottom: 1.2rem;
    position: relative;
    display: inline-block;
}
h2.module-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 64px;
    height: 2px;
    background: var(--mg-accent);
    opacity: 0.85;
}
/* When module-title is centered inside a col, center the underline too */
.text-center h2.module-title::after,
.col-sm-8.col-sm-offset-2 h2.module-title::after {
    left: 50%;
    transform: translateX(-50%);
}

.module-subtitle {
    font-family: var(--mg-display) !important;
    font-style: italic;
    color: var(--mg-ink-soft) !important;
    font-size: 1.15rem;
    line-height: 1.6;
    max-width: 760px;
    margin: 0 auto 1.5rem;
}

p { color: var(--mg-ink-soft); }
strong { color: var(--mg-ink); font-weight: 600; }

/* nice "first-letter" accents on the long body intros */
section#maurice .col-sm-4 > p:first-of-type::first-letter,
section#pupevisch .text-justify p:first-of-type::first-letter {
    font-family: var(--mg-display);
    float: left;
    font-size: 3.2rem;
    line-height: 0.9;
    padding: 0.3rem 0.6rem 0 0;
    color: var(--mg-accent);
    font-weight: 700;
}

/* Pupe Visch: extra breathing room between intro text and the photo row */
#pupevisch > .container > .row:nth-of-type(2) {
    margin-top: 2.5rem;
}

/* ---------- sections / backgrounds ---------- */
.module-small, section {
    background: transparent !important;
    padding: 5rem 0;
    position: relative;
}
section + section { border-top: 1px solid var(--mg-rule); }

.bg-light { background: var(--mg-parchment) !important; }
.bg-dark  { background: var(--mg-ink) !important; color: #f1e6cc !important; }
.bg-dark h2, .bg-dark h3, .bg-dark h4, .bg-dark .module-title,
.bg-dark p, .bg-dark strong { color: #f1e6cc !important; }
.bg-dark p { color: #d8caa6 !important; }
.bg-dark .module-title::after { background: var(--mg-accent-2); }

/* ---------- navigation ---------- */
.navbar-custom { background: transparent !important; border: none !important; }
.navbar-custom.navbar-fixed-top {
    transition: background 0.35s ease, box-shadow 0.35s ease, padding 0.35s ease;
    padding: 1.2rem 0;
}
.navbar-custom.navbar-fixed-top.mg-scrolled {
    background: rgba(20, 14, 8, 0.92) !important;
    box-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 0.55rem 0;
}
.navbar-custom .extra-navbar > li > a,
.navbar-custom #icons-navbar a {
    color: #f1e6cc !important;
    font-family: var(--mg-body) !important;
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 500;
}
.navbar-custom .extra-navbar > li > a:hover { color: var(--mg-accent-2) !important; }
.navbar-custom .icon-bar { background: #f1e6cc !important; }

/* overlay menu — keep but warmer */
.overlay-menu { background: rgba(20, 14, 8, 0.96) !important; }
.overlay-menu-nav ul li a {
    font-family: var(--mg-display) !important;
    color: #f1e6cc !important;
}
.overlay-menu-nav ul li a:hover { color: var(--mg-accent-2) !important; }

/* ---------- hero ---------- */
#hero.module-hero {
    position: relative;
    overflow: hidden;
    background-color: #1a120c;
}
#hero .hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    z-index: 0;
    filter: sepia(0.25) saturate(0.9) contrast(1.02) brightness(0.95);
}
/* Template normally sets height via jQuery; ensure full viewport without JS
   AND vertically center the caption (table layout fails when height is auto). */
#hero.module-hero,
.module-hero.module-full-height {
    min-height: 100vh;
    height: auto !important;
    display: flex;
    align-items: center;
    justify-content: center;
}
#hero .hero-caption {
    display: block !important;
    height: auto !important;
    width: 100%;
    position: relative;
    z-index: 2;
}
#hero .hero-text {
    display: block !important;
    vertical-align: initial !important;
    height: auto !important;
}
#hero.module-hero::before {
    content: "";
    position: absolute; inset: 0;
    background:
        linear-gradient(180deg, rgba(20,14,8,0.70) 0%, rgba(20,14,8,0.55) 45%, rgba(20,14,8,0.88) 100%),
        radial-gradient(ellipse at center, rgba(20,14,8,0.15) 30%, rgba(20,14,8,0.65) 100%);
    pointer-events: none;
    z-index: 1;
}
#hero .hero-caption { position: relative; z-index: 2; }
#hero .hero-text h1 {
    font-size: clamp(2.6rem, 7vw, 5.5rem);
    color: #f4ecd8 !important;
    text-shadow: 0 2px 30px rgba(0,0,0,0.5);
    margin-bottom: 0.4rem !important;
    letter-spacing: 0.005em;
}
#hero .hero-text h5 {
    font-family: var(--mg-display) !important;
    font-style: italic;
    font-weight: 400;
    color: var(--mg-accent-2) !important;
    font-size: clamp(1.05rem, 2vw, 1.4rem);
    letter-spacing: 0.18em;
    text-transform: lowercase;
}
/* small decorative scroll cue */
#hero::after {
    content: "";
    position: absolute;
    left: 50%; bottom: 24px;
    width: 1px; height: 38px;
    background: linear-gradient(to bottom, transparent, #f1e6cc);
    transform: translateX(-50%);
    opacity: 0.55;
    z-index: 3;
}
@media (max-height: 640px) { #hero::after { display: none; } }

/* ---------- images: sepia frame ---------- */
section img.img-responsive,
section img.img-rounded,
section img.center-block {
    border-radius: var(--mg-radius) !important;
    box-shadow: var(--mg-shadow);
    border: 6px solid #faf3df;
    outline: 1px solid var(--mg-rule);
    transition: transform 0.4s ease, filter 0.4s ease;
    filter: sepia(0.18) saturate(0.95) contrast(1.02);
    max-width: 100%;
    height: auto;
}
section img:hover {
    transform: translateY(-3px);
    filter: sepia(0.05) saturate(1) contrast(1.02);
}

/* ---------- info card (Maurice fact list) ---------- */
#maurice .col-sm-3 p {
    margin-bottom: 0.45rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px dotted var(--mg-rule);
    font-size: 0.95rem;
}
#maurice .col-sm-3 p:last-child { border: none; }

/* ---------- Tour 1927 stage list ---------- */
#tour1927 .container {
    max-width: 1340px;
    width: 94%;
}
/* intro row: title+subtitle should span the full container, not 8/2 */
#tour1927 > .container > .row:first-of-type > .col-sm-8.col-sm-offset-2 {
    width: 100%;
    margin-left: 0;
    text-align: center;
}
#tour1927 > .container > .row:nth-of-type(2) {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}
#tour1927 .col-sm-8 { width: 70%; }
#tour1927 .col-sm-4 { width: 30%; padding-top: 2.4rem; }
#tour1927 .col-sm-4 > h4 { display: none; }
#tour1927 .col-sm-4 img {
    border: 4px solid #faf3df !important;
    width: 100%;
    height: auto;
}
#tour1927 .col-sm-6 p strong { color: var(--mg-accent); }

/* Tour stages — proper list grid (number / route / winner) */
#tour1927 ol.stages {
    list-style: none;
    padding: 1.1rem 1.2rem;
    margin: 0;
    background: #faf3df;
    border-left: 3px solid var(--mg-accent);
    box-shadow: var(--mg-shadow);
    font-family: var(--mg-body) !important;
    font-size: 0.85rem;
    line-height: 1.45;
    counter-reset: stage;
}
#tour1927 ol.stages .stage {
    display: grid;
    grid-template-columns: 2rem 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.6rem;
    padding: 0.45rem 0;
    border-bottom: 1px dotted var(--mg-rule);
}
#tour1927 ol.stages .stage:last-child { border-bottom: none; }
#tour1927 ol.stages .num {
    grid-row: 1 / span 2;
    align-self: start;
    font-family: var(--mg-mono);
    font-weight: 600;
    color: var(--mg-mute);
    text-align: right;
    padding-top: 0.05rem;
}
#tour1927 ol.stages .route {
    grid-column: 2;
    color: var(--mg-ink);
    font-weight: 500;
}
#tour1927 ol.stages .winner {
    grid-column: 2;
    font-size: 0.78rem;
    color: var(--mg-mute);
    font-style: italic;
}
#tour1927 ol.stages .stage.winner-me {
    background: rgba(138, 42, 31, 0.06);
    border-left: 2px solid var(--mg-accent);
    margin-left: -1.2rem;
    padding-left: 1rem;
    border-bottom-color: transparent;
}
#tour1927 ol.stages .stage.winner-me .num,
#tour1927 ol.stages .stage.winner-me .route { color: var(--mg-accent); }
#tour1927 ol.stages .winner strong { font-style: normal; color: var(--mg-accent); }
@media (max-width: 992px) {
    #tour1927 .col-sm-8, #tour1927 .col-sm-4 { width: 100%; }
    #tour1927 .col-sm-6 p { font-size: 0.78rem; }
}

/* ploeg lijst */
#ploegen .col-sm-2 p strong { color: var(--mg-accent); font-weight: 600; }

/* Ploegen: title sits directly in container (left-aligned, no offset).
   Body cols originally have offset-1 + 2/2/6 — kill the offset so the
   "Ploegen" header aligns under the section title; widen for no wrap. */
#ploegen .row > .col-sm-2.col-sm-offset-1 {
    width: 22%;
    margin-left: 0;
    padding-right: 1rem;
}
#ploegen .row > .col-sm-2:not(.col-sm-offset-1) {
    width: 22%;
}
#ploegen .row > .col-sm-6 {
    width: 56%;
    padding-left: 1.5rem;
}
@media (max-width: 768px) {
    #ploegen .row > .col-sm-2.col-sm-offset-1,
    #ploegen .row > .col-sm-2:not(.col-sm-offset-1),
    #ploegen .row > .col-sm-6 {
        width: 100%;
        margin-left: 0;
        padding: 0 15px;
    }
}

/* ---------- legacy / footer-ish ---------- */
#legacy { padding-bottom: 6rem; }

/* Carrière + Legacy: align body rows with the centered 8/2 intro.
   Title sits in col-sm-8 col-sm-offset-2 → width 66.67%, starts at 16.67%.
   Body cols must match that same band. */

/* CARRIÈRE: body is col-sm-6.offset-1 + col-sm-4 (siblings of the intro .row).
   Make them flex children of the outer .row, constrained to the title band. */
#carriere > .container > .row {
    display: flex;
    flex-wrap: wrap;
    margin-left: 16.6667%;
    margin-right: 16.6667%;
    width: auto;
}
#carriere > .container > .row > .row {
    /* the nested intro row spans full band */
    flex: 0 0 100%;
    max-width: 100%;
    margin-left: -15px;
    margin-right: -15px;
}
#carriere > .container > .row > .row > .col-sm-8.col-sm-offset-2 {
    /* inside the band, the intro is already centered \u2013 reset offset */
    width: 100%;
    margin-left: 0;
    text-align: center;
}
#carriere > .container > .row > .col-sm-6.col-sm-offset-1 {
    flex: 0 0 60%;
    max-width: 60%;
    margin-left: 0;
    padding: 0 1.2rem 0 15px;
}
#carriere > .container > .row > .col-sm-4 {
    flex: 0 0 40%;
    max-width: 40%;
    padding: 0 15px 0 1.2rem;
}

/* LEGACY: intro row + body row, same treatment. */
#legacy > .container > .row {
    display: flex;
    flex-wrap: wrap;
    margin-left: 16.6667%;
    margin-right: 16.6667%;
    width: auto;
}
#legacy > .container > .row > .row {
    flex: 0 0 100%;
    max-width: 100%;
    margin-left: -15px;
    margin-right: -15px;
}
#legacy > .container > .row > .row > .col-sm-8.col-sm-offset-2 {
    width: 100%;
    margin-left: 0;
    text-align: center;
}
#legacy > .container > .row:last-of-type > .col-sm-7 {
    flex: 0 0 58%;
    max-width: 58%;
    padding: 0 1.2rem 0 15px;
}
#legacy > .container > .row:last-of-type > .col-sm-5 {
    flex: 0 0 42%;
    max-width: 42%;
    padding: 0 15px 0 1.2rem;
}

@media (max-width: 992px) {
    #carriere > .container > .row,
    #legacy > .container > .row {
        margin-left: 0;
        margin-right: 0;
    }
    #carriere > .container > .row > .col-sm-6.col-sm-offset-1,
    #carriere > .container > .row > .col-sm-4,
    #legacy > .container > .row:last-of-type > .col-sm-7,
    #legacy > .container > .row:last-of-type > .col-sm-5 {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 0 15px;
    }
}

footer, .copyright {
    background: transparent !important;
    color: var(--mg-mute) !important;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}
footer { padding: 2.5rem 0 !important; border-top: 1px solid var(--mg-rule); }
footer a, .copyright a { color: var(--mg-accent) !important; }
footer a:hover, .copyright a:hover { color: var(--mg-ink) !important; }

/* ---------- hide preloader (instant feel) ---------- */
.page-loader { display: none !important; }

/* ---------- responsive tweaks ---------- */
@media (max-width: 768px) {
    .module-small, section { padding: 3rem 0; }
    h2.module-title { font-size: 1.9rem; }
    #tour1927 .col-sm-6 p { font-size: 0.78rem; }
}
