/* ============================================================
   Village template — template.css
   Typography, palette, components.
   Joomla 5.4+ / 6.x compatible. Per dev notes §8 — typography
   and visual styling live here; layout lives in grid.css;
   breakpoints live in responsive.css.
   ============================================================ */

/* ---- Design tokens --------------------------------------- */
:root {
    /* Palette — Morning Sky */
    --paper:       #F8F6F0;
    --paper-deep:  #EDE9DC;
    --paper-soft:  #FAF8F4;
    --ink:         #2A2620;
    --ink-soft:    #4A4238;
    --ink-mute:    #6B6258;
    --blue:        #3A5985;
    --blue-deep:   #2C4768;
    --blue-soft:   #6B85A8;
    --gold:        #C9954F;
    --gold-soft:   #E3C58E;
    --hairline:    #D5CBB3;

    /* Sky gradient stops */
    --sky-top:     #CCD8E5;
    --sky-mid:     #E8DDC6;
    --sky-low:     #F3E4C3;

    /* Type stack */
    --display: 'Lora', Georgia, 'Times New Roman', serif;
    --body:    'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* Rhythm */
    --row-pad-y: 5.5rem;
    --radius:    8px;
    --radius-lg: 12px;
    --band-inner-max: 1100px;
}

/* ---- Reset + base ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* required for .band breakout pattern */
}

body {
    font-family: var(--body);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--ink-soft);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ---- Typography ------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--display);
    color: var(--ink);
    font-weight: 500;
    line-height: 1.2;
    margin: 0 0 1rem;
}

h1 { font-size: clamp(2.4rem, 5vw, 4.4rem); font-weight: 500; line-height: 1.1; letter-spacing: -0.01em; }
h2 { font-size: clamp(2rem, 3.4vw, 2.8rem); font-weight: 500; }
h3 { font-size: 1.4rem; font-weight: 600; }

h1 em, h2 em, h3 em { font-style: italic; color: var(--blue); }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; transition: color 0.2s ease; }
a:hover { color: var(--gold); }

strong, b { color: var(--ink); font-weight: 600; }

blockquote {
    font-family: var(--display);
    font-style: italic;
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--ink);
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 3px solid var(--gold);
    background: rgba(201, 149, 79, 0.06);
    border-radius: 0 var(--radius) var(--radius) 0;
}

hr {
    border: none;
    border-top: 1px solid var(--hairline);
    margin: 2rem 0;
}

ul, ol { padding-left: 1.5rem; }
li { margin-bottom: 0.4rem; }

/* ---- Background utility classes (dev notes §7) ----------- */
.bgd-paper       { background: var(--paper); }
.bgd-paper-deep  { background: var(--paper-deep); }
.bgd-paper-soft  { background: var(--paper-soft); }

.bgd-sky-top {
    /* Solid pale cream — color-matched to the top edge of hero-church.jpg
       so the seam between header and hero image is barely visible. */
    background: #E3DDCB;
}

.bgd-sky {
    /* Hero band — the church-on-hill painting fills this region. The
       scrim above the church is a soft white overlay that helps any
       overlaid module text remain readable; the bottom 15% fades to
       paper so the hero transitions smoothly into the article content
       on the cream background below. */
    background:
        linear-gradient(180deg,
            rgba(248, 246, 240, 0.20) 0%,
            rgba(248, 246, 240, 0.05) 22%,
            rgba(248, 246, 240, 0) 50%,
            rgba(248, 246, 240, 0) 78%,
            rgba(248, 246, 240, 0.55) 92%,
            var(--paper) 100%),
        url('../images/hero-church.jpg') center 40% / cover no-repeat;
    background-color: var(--sky-mid);
}

.bgd-sky-down {
    background:
        radial-gradient(ellipse at 75% 80%, rgba(243, 228, 195, 0.45) 0%, transparent 60%),
        linear-gradient(180deg, var(--paper) 0%, var(--sky-mid) 70%, var(--sky-top) 100%);
}

.bgd-blue        { background: var(--blue); color: var(--paper); }
.bgd-blue h1, .bgd-blue h2, .bgd-blue h3,
.bgd-blue h4, .bgd-blue h5, .bgd-blue h6 { color: var(--paper); }
.bgd-blue a { color: var(--gold-soft); }
.bgd-blue a:hover { color: #ffffff; }

/* ---- The .band breakout pattern -------------------------- */
/* Use inside the article body to create a full-width band
   that breaks out of the .row container. Body must have
   overflow-x: hidden (set above).

   The --sidebar-correction custom property accounts for the
   article's offset from viewport center when an asymmetric
   sidebar is present (defined on .content-inner — see the
   SIDEBARS section below). Without this correction the band
   shifts to one side and clips against the viewport edge.
   This was the v1.2.1 fix. */

.band {
    width: 100vw;
    margin-left:  calc(50% - 50vw - var(--sidebar-correction, 0px));
    margin-right: calc(50% - 50vw + var(--sidebar-correction, 0px));
    padding-top: var(--row-pad-y);
    padding-bottom: var(--row-pad-y);
}

.band-inner {
    max-width: var(--band-inner-max);
    margin: 0 auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Convenience: combine .band with a background class
   in the markup, e.g.: <section class="band bgd-paper-deep"> */

/* ---- Common: section headings ---------------------------- */
.eyebrow {
    font-family: var(--body);
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--gold);
    margin-bottom: 1rem;
    display: inline-block;
}

.section-head {
    text-align: center;
    margin: 0 auto 4rem;
    max-width: 44rem;
}
.section-head h2 { margin: 0.5rem 0 1rem; }
.section-intro {
    font-size: 1.1rem;
    color: var(--ink-soft);
    line-height: 1.6;
}

/* ---- Buttons --------------------------------------------- */
.btn,
a.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--body);
    font-size: 1rem;
    font-weight: 500;
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    line-height: 1.2;
}
.btn-primary,
a.btn-primary {
    background: var(--blue);
    color: var(--paper);
}
.btn-primary:hover,
a.btn-primary:hover {
    background: var(--blue-deep);
    color: var(--paper);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(58, 89, 133, 0.18);
}
.btn-ghost,
a.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--hairline);
}
.btn-ghost:hover,
a.btn-ghost:hover {
    border-color: var(--blue);
    color: var(--blue);
}
.btn .arrow { transition: transform 0.2s ease; }
.btn:hover .arrow { transform: translateX(3px); }

.link-arrow {
    color: var(--blue);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.2s ease;
}
.link-arrow:hover { color: var(--gold); }
.link-arrow .arrow { transition: transform 0.2s ease; }
.link-arrow:hover .arrow { transform: translateX(3px); }

/* ============================================================
   HEADER (template-emitted)
   ============================================================ */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.4rem 0;
    gap: 2rem;
}
.brand {
    font-family: var(--display);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    line-height: 1.1;
}
.brand:hover { color: var(--blue); }
.brand-name { display: inline-block; }

.top-nav {
    display: flex;
    gap: 0;
    align-items: center;
}
/* mod_menu renders a <ul> — neutralise its bullets and reflow */
.top-nav ul.mod-menu,
.top-nav ul {
    display: flex;
    gap: 2rem;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}
.top-nav ul li { margin: 0; }
.top-nav a {
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    transition: color 0.2s ease;
}
.top-nav a:hover,
.top-nav .current > a,
.top-nav .active > a { color: var(--blue); }

.topbar-cta { display: inline-flex; align-items: center; }

/* ============================================================
   HERO BAND (template-emitted, homepage)
   The hero band displays the church-on-hill painting as its
   background. Height is viewport-aware so the image reads well
   on phones (short) through to ultrawide desktops (capped).
   If a "hero" module is published, its content renders centered
   on top of the image with a slight scrim for readability.
   ============================================================ */
.hero-band {
    min-height: 380px;
    height: 52vh;
    max-height: 620px;
    padding: 3rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}
.hero-band:empty { padding: 0; }

/* When the article body's first section is .hero-content, it
   appears inside the main content area but sits visually on
   the paper background just below the sky band. */
.hero-content {
    padding: 4rem 0 5rem;
    text-align: center;
}
.hero-content h1 {
    margin: 0 auto 1.5rem;
    max-width: 24ch;
}
.hero-lead {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--ink-soft);
    max-width: 38rem;
    margin: 0 auto 2.5rem;
}
.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}
.hero-scripture {
    max-width: 36rem;
    margin: 0 auto;
    padding: 2rem 0 0;
    border-top: 1px solid rgba(58, 89, 133, 0.18);
    background: none;
    border-left: none;
    border-radius: 0;
}
.hero-scripture-text {
    font-family: var(--display);
    font-style: italic;
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--ink);
    margin: 0 0 0.6rem;
}
.hero-scripture-ref {
    font-size: 0.85rem;
    color: var(--blue);
    font-weight: 500;
    letter-spacing: 0.05em;
    display: block;
}

/* ============================================================
   WELCOME / TRUST STATS
   ============================================================ */
.welcome-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    max-width: 56rem;
    margin: 0 auto;
    padding: 2rem 0 3rem;
    border-bottom: 1px solid var(--hairline);
    text-align: center;
}
.welcome-stat-num {
    font-family: var(--display);
    font-size: 2.4rem;
    font-weight: 500;
    color: var(--blue);
    line-height: 1;
    margin-bottom: 0.4rem;
}
.welcome-stat-label {
    font-size: 0.85rem;
    color: var(--ink-mute);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 500;
}

/* ============================================================
   PILLAR GRID
   ============================================================ */
.pillar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}
.pillar {
    background: var(--paper-soft);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 2rem 1.75rem;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}
.pillar:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(42, 38, 32, 0.07);
    border-color: var(--blue-soft);
}
.pillar-num {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--blue);
    color: var(--paper);
    font-family: var(--body);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    flex-shrink: 0;
}
.pillar h3 {
    font-family: var(--display);
    font-weight: 600;
    font-size: 1.3rem;
    line-height: 1.2;
    margin: 0 0 0.5rem;
    color: var(--ink);
}
.pillar-essence {
    font-family: var(--display);
    font-style: italic;
    font-size: 1rem;
    color: var(--blue);
    margin: 0 0 1rem;
    line-height: 1.4;
}
.pillar p:not(.pillar-essence) {
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--ink-soft);
    flex: 1;
}
.pillar-link {
    color: var(--blue);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: auto;
}
.pillar-link:hover { color: var(--gold); }

/* ============================================================
   CURRICULUM / LEVELS
   ============================================================ */
.curriculum-intro {
    background: var(--paper-soft);
    border-left: 4px solid var(--gold);
    padding: 1.75rem 2rem;
    margin: 0 auto 3rem;
    max-width: 42rem;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.curriculum-intro p {
    margin: 0;
    font-size: 1.05rem;
    color: var(--ink-soft);
    line-height: 1.6;
}
.levels {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin: 2rem 0;
}
.level {
    background: var(--paper-soft);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    transition: all 0.25s ease;
}
.level:hover {
    border-color: var(--gold);
    box-shadow: 0 4px 14px rgba(201, 149, 79, 0.1);
}
.level-num {
    font-family: var(--body);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--gold);
    margin-bottom: 0.75rem;
}
.level h3 {
    font-family: var(--display);
    font-weight: 600;
    font-size: 1.2rem;
    line-height: 1.2;
    margin: 0 0 0.5rem;
    color: var(--ink);
}
.level-sub {
    font-family: var(--display);
    font-style: italic;
    color: var(--blue);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}
.level p {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--ink-soft);
    margin: 0 0 1rem;
}
.level-count {
    font-size: 0.82rem;
    color: var(--ink-mute);
    font-weight: 500;
}

/* ============================================================
   OFFERINGS
   ============================================================ */
.offerings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 2rem 0;
}
.offering-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(201, 149, 79, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    color: var(--gold);
    font-size: 1.5rem;
    font-family: var(--display);
}
.offering h3 {
    font-family: var(--display);
    font-weight: 600;
    font-size: 1.3rem;
    margin: 0 0 0.6rem;
}
.offering p {
    font-size: 0.98rem;
    line-height: 1.6;
    color: var(--ink-soft);
    margin: 0;
}

/* ============================================================
   AUDIENCE / WHO THIS IS FOR
   ============================================================ */
.audience-body {
    max-width: 44rem;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--ink-soft);
}
.audience-body p { margin: 0 0 1.5rem; }

.audience-checklist {
    list-style: none;
    padding: 1.75rem 2rem;
    margin: 2rem 0;
    background: var(--paper-soft);
    border-radius: var(--radius);
}
.audience-checklist li {
    padding: 0.6rem 0 0.6rem 1.75rem;
    position: relative;
    border-bottom: 1px solid var(--hairline);
    margin: 0;
}
.audience-checklist li:last-child { border-bottom: none; }
.audience-checklist li::before {
    content: '✓';
    color: var(--gold);
    font-weight: 700;
    position: absolute;
    left: 0;
    top: 0.55rem;
    font-size: 1.1rem;
}

/* ============================================================
   FOUNDER
   ============================================================ */
.founder-layout {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 3.5rem;
    align-items: start;
    max-width: 64rem;
    margin: 0 auto;
}
.founder-photo {
    aspect-ratio: 4 / 5;
    background:
        radial-gradient(ellipse at 40% 30%, var(--gold-soft) 0%, transparent 55%),
        linear-gradient(160deg, var(--sky-mid) 0%, var(--paper-deep) 100%);
    border-radius: var(--radius);
    overflow: hidden;
}
.founder-body h2 { margin: 0 0 1.25rem; }
.founder-body p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--ink-soft);
    margin: 0 0 1.25rem;
}
.founder-milestones {
    display: flex;
    gap: 2rem;
    margin: 1.75rem 0 1.5rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
}
.milestone-year {
    font-family: var(--display);
    font-style: italic;
    color: var(--blue);
    font-size: 1.4rem;
    font-weight: 500;
    line-height: 1;
}
.milestone-label {
    font-size: 0.85rem;
    color: var(--ink-mute);
    margin-top: 0.25rem;
}

/* ============================================================
   CONVICTIONS
   ============================================================ */
.convictions-body {
    max-width: 44rem;
    margin: 0 auto;
    font-size: 1.2rem;
    line-height: 1.65;
    color: var(--ink-soft);
    text-align: center;
}
.convictions-body p { margin: 0 0 1.5rem; }
.convictions-body p:last-child {
    font-family: var(--display);
    font-style: italic;
    font-size: 1.35rem;
    color: var(--ink);
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--hairline);
}

/* ============================================================
   CONTACT (template-emitted band) + general contact module
   ============================================================ */
.contact-band {
    text-align: center;
}
.contact-band h2 { margin: 0 0 1.25rem; }
.contact-body {
    max-width: 38rem;
    margin: 0 auto 2.5rem;
    font-size: 1.1rem;
    line-height: 1.65;
    color: var(--ink-soft);
}
.contact-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================
   FOOTER (template-emitted, deep blue band)
   ============================================================ */
.footer {
    padding: 3.5rem 0 2.5rem;
    color: var(--paper);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}
.footer h4,
.footer .wdimod_tit {
    font-family: var(--body);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--gold-soft);
    margin: 0 0 1rem;
    font-weight: 600;
}
.footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer li { margin-bottom: 0.5rem; }
.footer a {
    color: rgba(248, 246, 240, 0.85);
    text-decoration: none;
    font-size: 0.93rem;
    transition: color 0.2s ease;
}
.footer a:hover { color: var(--gold-soft); }
.footer-rule {
    border: none;
    border-top: 1px solid rgba(248, 246, 240, 0.18);
    margin: 0 0 1.5rem;
}
.footer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: rgba(248, 246, 240, 0.55);
}

/* ============================================================
   SIDEBARS — left and right columns inside the content row
   .content-inner is a sub-grid that arranges left/main/right
   based on which positions have published modules. Layout is
   selected via :has() — see dev notes §16.
   ============================================================ */
.content-inner {
    --sidebar-correction: 0px;
    display: grid;
    grid-template-columns: 1fr; /* fallback: just main */
    gap: 3rem;
    align-items: start;
}
/* Left only — main is offset right of viewport center, so .band
   sections need to shift LEFT more to reach the viewport edge. */
.content-inner:has(.left-col):not(:has(.right-col)) {
    grid-template-columns: 16rem 1fr;
    --sidebar-correction: 9.5rem; /* (16rem sidebar + 3rem gap) / 2 */
}
/* Right only — mirror: main offset left, bands shift right. */
.content-inner:not(:has(.left-col)):has(.right-col) {
    grid-template-columns: 1fr 16rem;
    --sidebar-correction: -9.5rem;
}
/* Both sidebars (equal-sized) — main stays centered, no correction. */
.content-inner:has(.left-col):has(.right-col) {
    grid-template-columns: 16rem 1fr 16rem;
}
.content-inner > * { min-width: 0; }

/* Sticky sidebars on tall pages — sit comfortably while scrolling */
.left-col, .right-col {
    position: sticky;
    top: 1.5rem;
    align-self: start;
}

/* ---- Sidebar module styling --------------------------------- */
.left-col .moduletable + .moduletable,
.right-col .moduletable + .moduletable {
    margin-top: 2.5rem;
}
.left-col .wdimod_tit,
.right-col .wdimod_tit {
    font-family: var(--body);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--gold);
    margin: 0 0 1rem;
    font-weight: 600;
}

/* Menu lists inside sidebars (mod_menu output) */
.left-col ul.mod-menu,
.left-col ul.nav,
.left-col ul,
.right-col ul.mod-menu,
.right-col ul.nav,
.right-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.left-col li,
.right-col li {
    margin: 0;
    border-bottom: 1px solid var(--hairline);
}
.left-col li:last-child,
.right-col li:last-child { border-bottom: none; }
.left-col a,
.right-col a {
    display: block;
    padding: 0.7rem 0;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.35;
    transition: color 0.2s ease, padding-left 0.2s ease;
}
.left-col a:hover,
.right-col a:hover {
    color: var(--blue);
    padding-left: 0.25rem;
}
.left-col .current > a,
.left-col .active > a,
.left-col li.current,
.left-col li.active > a,
.right-col .current > a,
.right-col .active > a {
    color: var(--blue);
    font-weight: 500;
}

/* Nested menu items (children of a parent menu item) */
.left-col li ul,
.right-col li ul {
    padding-left: 0.75rem;
    padding-bottom: 0.5rem;
    border-left: 2px solid var(--hairline);
    margin-left: 0.25rem;
}
.left-col li li,
.right-col li li {
    border-bottom: none;
}
.left-col li li a,
.right-col li li a {
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: var(--ink-mute);
}

/* ============================================================
   MODULE CHROME STYLES
   ============================================================ */
.wdimod_in,
.wdimm_in {
    /* Module wrapper — no default styling. Targeted per-position. */
}

/* Standard Joomla output (com_content, com_contact, etc.) ----- */
.com-content-article__body > * + * { margin-top: 1rem; }
.com-content-article__body > h2,
.com-content-article__body > h3 { margin-top: 2.5rem; }

/* Lead paragraph (Joomla applies .lead to the article intro) */
.lead {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--ink-soft);
    margin: 0 auto 2rem;
    max-width: 38rem;
    text-align: center;
}

/* Override com_contact image sizing trap (dev notes §15) */
.com-contact__thumbnail img {
    max-width: 300px;
    width: 100%;
    height: auto;
}

/* Breadcrumbs — Joomla's mod_breadcrumbs outputs a <ul> with <li>
   items that are block-level by default. Flatten to horizontal flex
   and add a › separator between items. */
.breadcrumbs {
    padding: 1rem 0;
    font-size: 0.9rem;
    color: var(--ink-mute);
}
.breadcrumbs ul,
.breadcrumbs ol,
.breadcrumbs .breadcrumb,
.breadcrumbs .mod-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0;
    align-items: center;
}
.breadcrumbs li {
    display: inline-flex;
    align-items: center;
    margin: 0;
    border: 0;
}
.breadcrumbs li + li::before {
    content: '›';
    margin: 0 0.6rem;
    color: var(--ink-mute);
    font-size: 1rem;
    line-height: 1;
}
.breadcrumbs a { color: var(--ink-soft); text-decoration: none; }
.breadcrumbs a:hover { color: var(--blue); }
.breadcrumbs .active,
.breadcrumbs li:last-child {
    color: var(--ink);
}

/* System messages */
#system-message-container { margin: 1rem 0; }

/* ============================================================
   HAMBURGER BUTTON (mobile only — visibility in responsive.css)
   Three lines that animate into an × when .is-open.
   ============================================================ */
.hamburger {
    display: none; /* shown at <=900px in responsive.css */
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.hamburger:hover { background: rgba(42, 38, 32, 0.06); }
.hamburger:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--ink);
    border-radius: 1px;
    transition: transform 0.25s ease, opacity 0.2s ease;
    transform-origin: center;
}
.hamburger.is-open .hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open .hamburger-line:nth-child(2) { opacity: 0; }
.hamburger.is-open .hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   MOBILE DRAWER (off-canvas)
   Display:none on desktop, position:fixed on mobile. Slides in
   from the right with a backdrop scrim.
   ============================================================ */
.mobile-drawer { display: none; } /* desktop: hidden entirely */

@media (max-width: 900px) {
    .mobile-drawer {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1000;
        pointer-events: none;
    }
    .mobile-drawer[aria-hidden="false"] {
        pointer-events: auto;
    }

    .mobile-drawer__backdrop {
        position: absolute;
        inset: 0;
        background: rgba(42, 38, 32, 0.55);
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .mobile-drawer[aria-hidden="false"] .mobile-drawer__backdrop {
        opacity: 1;
    }

    .mobile-drawer__panel {
        position: absolute;
        top: 0;
        right: 0;
        height: 100%;
        width: 85%;
        max-width: 360px;
        background: var(--paper);
        overflow-y: auto;
        overscroll-behavior: contain;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        padding: 4rem 1.75rem 2rem;
        box-shadow: -2px 0 16px rgba(0, 0, 0, 0.15);
    }
    .mobile-drawer[aria-hidden="false"] .mobile-drawer__panel {
        transform: translateX(0);
    }

    .mobile-drawer__close {
        position: absolute;
        top: 0.75rem;
        right: 1rem;
        width: 44px;
        height: 44px;
        background: none;
        border: 0;
        font-family: var(--display);
        font-size: 2.25rem;
        color: var(--ink);
        cursor: pointer;
        line-height: 1;
        padding: 0;
        border-radius: 4px;
        transition: background 0.2s ease;
    }
    .mobile-drawer__close:hover { background: rgba(42, 38, 32, 0.06); }
    .mobile-drawer__close:focus-visible {
        outline: 2px solid var(--blue);
        outline-offset: 2px;
    }

    .mobile-drawer__section + .mobile-drawer__section {
        margin-top: 1.75rem;
        padding-top: 1.75rem;
        border-top: 1px solid var(--hairline);
    }

    /* Module titles inside drawer (gold small-caps eyebrow) */
    .mobile-drawer .wdimod_tit,
    .mobile-drawer .wdimm_tit {
        font-family: var(--body);
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.16em;
        color: var(--gold);
        margin: 0 0 0.75rem;
        font-weight: 600;
    }

    /* Nav lists inside drawer */
    .mobile-drawer ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    .mobile-drawer li {
        margin: 0;
        border-bottom: 1px solid var(--hairline);
    }
    .mobile-drawer li:last-child {
        border-bottom: none;
    }
    .mobile-drawer a {
        display: block;
        padding: 0.85rem 0;
        color: var(--ink-soft);
        text-decoration: none;
        font-size: 1.05rem;
        line-height: 1.35;
        transition: color 0.2s ease, padding-left 0.2s ease;
    }
    .mobile-drawer a:hover,
    .mobile-drawer .current > a,
    .mobile-drawer .active > a {
        color: var(--blue);
        padding-left: 0.25rem;
    }

    /* Prevent background scrolling when drawer is open */
    body.drawer-open {
        overflow: hidden;
    }
}
