/*
 * ye-site.css — Young Engineers Cork City site chrome
 * Palette from corkcity.youngengineers.ie: Young Engineers blue, the logo's
 * green / orange / yellow as accents, grey ink, Open Sans.
 * Components follow the Music Squad site (same class names) so fixes carry across.
 */

:root {
    --blue:    #0097DC;   /* brand blue — surfaces, links, accents */
    --blue-dk: #0077B6;   /* buttons: white text passes contrast on this, not on --blue */
    --navy:    #0B3B5C;   /* headings */
    --ink:     #3A4248;   /* body text */
    --muted:   #5F6B73;
    --green:   #95C11F;
    --orange:  #F39200;
    --yellow:  #FFCC00;
    --tint:    #EEF7FC;
    --tint-2:  #E3F2FA;
    --line:    #D6E8F2;
    --paper:   #ffffff;
}

* { box-sizing: border-box; }
/* The `hidden` attribute must win over component display rules (.btn, .pagehead-meta …),
   or JS-revealed elements show up empty before they're filled. */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }
body {
    font-family: 'Open Sans', Arial, sans-serif;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--blue-dk); }

/* ── Pill buttons ── */
.btn {
    display: inline-block; border: none; cursor: pointer;
    font-family: inherit; font-size: 15px; font-weight: 700;
    padding: 14px 30px; border-radius: 999px; text-decoration: none;
    transition: transform .12s ease, background .15s ease, color .15s ease;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--blue-dk); color: #fff; }
.btn--primary:hover { background: var(--navy); }
.btn--accent  { background: var(--yellow); color: var(--navy); }
.btn--accent:hover { background: #F5BD00; }
.btn--ghost   { background: transparent; color: var(--blue-dk); box-shadow: inset 0 0 0 2.5px var(--blue-dk); }
.btn--ghost:hover { background: var(--blue-dk); color: #fff; }
.btn--sm { font-size: 13.5px; padding: 10px 22px; }

/* ── Header ── */
.site-header {
    position: sticky; top: 0; z-index: 900;
    background: #fff; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
    gap: 18px; padding: 12px 32px;
}
.logo a { display: block; line-height: 0; }
.logo img { height: 46px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 24px; }
.site-nav a { color: var(--navy); text-decoration: none; font-size: 15px; font-weight: 600; }
.site-nav a:hover, .site-nav a.is-current { color: var(--blue); }
.site-nav a.btn { color: #fff; }
.site-nav a.btn:hover { color: #fff; }

/* Logo colour bar under the header */
.colour-bar { height: 5px; background: linear-gradient(90deg, #E30613 0 25%, var(--yellow) 25% 50%, var(--green) 50% 75%, var(--blue) 75% 100%); }

/* ── Hero ── */
.hero { background: var(--tint); padding: 56px 32px 60px; overflow: hidden; }
.hero .container { display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px; align-items: center; }
.hero .eyebrow, .pagehead .eyebrow, .eyebrow {
    display: inline-block; text-transform: uppercase; letter-spacing: .18em;
    font-size: 12px; font-weight: 700; color: var(--blue); margin-bottom: 12px;
}
.hero h1 { font-size: clamp(30px, 4.6vw, 48px); line-height: 1.12; font-weight: 800; color: var(--navy); margin: 0 0 18px; }
.hero h1 em { font-style: normal; color: var(--blue); }
.hero p { font-size: clamp(16px, 2vw, 19px); color: var(--ink); margin: 0 0 28px; max-width: 560px; }
.hero .hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .hero-img img { width: 100%; max-width: 520px; margin: 0 auto; }

/* ── Stats band ── */
.stats { background: var(--blue); color: #fff; padding: 28px 32px; }
.stats .container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; text-align: center; }
.stats .big { font-size: 30px; font-weight: 800; line-height: 1.1; }
.stats p { margin: 4px 0 0; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .9; }

/* small page hero for inner pages */
.pagehead { background: var(--tint); padding: 46px 32px 50px; text-align: center; border-bottom: 1px solid var(--line); }
.pagehead h1 { font-size: clamp(28px, 4.4vw, 42px); font-weight: 800; margin: 0 0 12px; color: var(--navy); line-height: 1.15; }
.pagehead p { font-size: 17px; color: var(--ink); max-width: 640px; margin: 0 auto; }
.pagehead p.pagehead-meta {
    margin: 18px auto 0; display: inline-block;
    background: var(--blue-dk); color: #fff;
    font-size: 13px; font-weight: 700; padding: 9px 22px; border-radius: 999px;
}

/* ── Sections ── */
.section { padding: 64px 32px; }
.section--tint { background: var(--tint); }
.container { max-width: 1100px; margin: 0 auto; }
.container--narrow { max-width: 800px; }
.section h2 {
    font-size: clamp(25px, 3.4vw, 36px); font-weight: 800;
    text-align: center; margin: 0 0 12px; color: var(--navy); line-height: 1.2;
}
.section .lead { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto; font-size: 17px; }

/* ── Programme cards ── */
.format-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; margin-top: 40px; }
.format-card {
    background: #fff; border: 2px solid var(--line); border-radius: 22px; overflow: hidden;
    display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
    transition: transform .14s, box-shadow .14s, border-color .14s;
}
a.format-card:hover { transform: translateY(-3px); border-color: var(--blue); box-shadow: 0 12px 28px rgba(0,119,182,.14); }
.format-card .fc-img { background: var(--tint); padding: 18px; }
.format-card .fc-img img { height: 200px; width: 100%; object-fit: contain; }
.format-card .fc-body { padding: 24px 26px 26px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.format-card .kind { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); }
.format-card h3 { margin: 0; font-size: 22px; font-weight: 800; color: var(--navy); }
.format-card p { margin: 0; color: var(--muted); font-size: 15px; }
.format-card .meta { margin-top: auto; padding-top: 14px; font-size: 14px; font-weight: 700; color: var(--navy); border-top: 2px solid var(--line); }
.format-card .go { font-size: 14px; font-weight: 700; color: var(--blue-dk); }

/* ── Age groups on a programme page ── */
.group-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 30px; }
.group-card { background: #fff; border-radius: 16px; padding: 18px 20px; border-top: 5px solid var(--blue); }
.group-card:nth-child(4n+2) { border-top-color: var(--green); }
.group-card:nth-child(4n+3) { border-top-color: var(--orange); }
.group-card:nth-child(4n+4) { border-top-color: var(--yellow); }
.group-card h4 { margin: 0 0 4px; font-size: 17px; font-weight: 800; color: var(--navy); }
.group-card p { margin: 0; font-size: 14px; color: var(--muted); }

.programme-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; align-items: center; }
.programme-hero img { max-width: 440px; margin: 0 auto; }
.programme-hero .copy p { font-size: 16.5px; }

/* ── Map + location list ── */
.map-layout { display: grid; grid-template-columns: 1.45fr 1fr; gap: 24px; margin-top: 40px; align-items: stretch; }
.map-layout--single { grid-template-columns: 1fr; max-width: 820px; margin-left: auto; margin-right: auto; }
#ye-map {
    height: 440px; border-radius: 24px; overflow: hidden;
    background: var(--tint); box-shadow: 0 10px 34px rgba(0,119,182,.12);
}
.map-layout--single #ye-map { height: 380px; }
.school-list { display: flex; flex-direction: column; gap: 10px; max-height: 440px; overflow-y: auto; padding-right: 4px; }
.school-item {
    text-align: left; width: 100%; cursor: pointer; font-family: inherit; color: var(--ink);
    background: #fff; border: 2px solid var(--line); border-radius: 16px;
    padding: 16px 18px; transition: border-color .15s, background .15s, transform .12s;
}
.school-item:hover { border-color: var(--blue); transform: translateY(-1px); }
.school-item.is-active { border-color: var(--blue); background: var(--tint); }
.school-item h4 { margin: 0 0 3px; font-size: 16px; font-weight: 800; color: var(--navy); }
.school-item p { margin: 0; font-size: 13.5px; color: var(--muted); }
.school-item .go { display: inline-block; margin-top: 8px; font-size: 13.5px; font-weight: 700; color: var(--blue-dk); }

/* Leaflet pin + popup */
.ye-pin { width: 30px; height: 38px; position: relative; }
.ye-pin::before {
    content: ''; position: absolute; left: 50%; bottom: 2px;
    width: 26px; height: 26px; margin-left: -13px;
    background: var(--blue); border: 3.5px solid #fff;
    border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
    box-shadow: 0 3px 8px rgba(0,0,0,.35); box-sizing: border-box;
}
.leaflet-popup-content-wrapper { border-radius: 16px !important; padding: 4px !important; }
.leaflet-popup-content { margin: 14px 16px !important; font-family: 'Open Sans', Arial, sans-serif !important; }
.ye-pop h4 { margin: 0 0 4px; font-size: 16px; font-weight: 800; color: var(--navy); }
.ye-pop p  { margin: 0 0 10px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.ye-pop a  {
    display: block; margin-top: 6px; text-align: center;
    background: var(--blue-dk); color: #fff !important;
    text-decoration: none; font-weight: 700; font-size: 13px;
    padding: 8px 18px; border-radius: 999px;
}
.ye-pop .none { color: var(--muted); font-style: italic; margin: 0; }

/* ── Place / programme picker cards ── */
.place-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 34px; }
.place-card {
    background: #fff; border: 2px solid var(--line); border-radius: 20px;
    padding: 24px; text-decoration: none; color: var(--ink);
    display: flex; flex-direction: column; gap: 4px;
    transition: transform .14s, border-color .14s, box-shadow .14s;
}
.place-card:hover { transform: translateY(-3px); border-color: var(--blue); box-shadow: 0 12px 28px rgba(0,119,182,.14); }
.place-card .kind { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); }
.place-card h4 { margin: 0; font-size: 18px; font-weight: 800; color: var(--navy); }
.place-card p  { margin: 0; font-size: 14px; color: var(--muted); }
.place-card .go { margin-top: 12px; font-size: 14px; font-weight: 700; color: var(--blue-dk); }

/* ── Split feature band ── */
.split { display: grid; grid-template-columns: 1fr 1fr; }
.split > div { padding: 60px 48px; display: flex; flex-direction: column; justify-content: center; }
.split .pane-blue { background: var(--blue-dk); color: #fff; }
.split .pane-blue h2 { color: #fff; }
.split .pane-blue p { color: #E3F2FA; }
.split .pane-tint { background: var(--tint-2); }
.split h2 { text-align: left; margin: 0 0 14px; font-size: clamp(24px, 3vw, 32px); font-weight: 800; color: var(--navy); }
.split p { margin: 0 0 22px; font-size: 16.5px; }
.split .cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Widget wrapper ── */
.widget-wrap { background: #fff; border-radius: 24px; padding: 30px; box-shadow: 0 10px 34px rgba(0,119,182,.08); }
.widget-wrap--bare { background: transparent; box-shadow: none; padding: 0; }
.widget-wrap--wide { max-width: 1180px; margin: 0 auto; }

/* Booking context strip ("You're booking: … at …") */
.booking-context {
    display: none; max-width: 800px; margin: 0 auto 22px; background: #fff;
    border: 2px solid var(--line); border-left: 6px solid var(--green);
    border-radius: 16px; padding: 14px 20px; font-size: 15px; color: var(--ink);
}
.booking-context.is-shown { display: block; }
.booking-context strong { color: var(--navy); }

/* ── Footer ── */
.site-footer { background: var(--tint); border-top: 1px solid var(--line); color: var(--muted); padding: 48px 32px; text-align: center; }
.site-footer img { height: 50px; margin: 0 auto 16px; }
.site-footer a { color: var(--blue-dk); font-weight: 600; }
.site-footer .links { margin: 10px 0 0; }
.site-footer .network { max-width: 560px; margin: 16px auto 0; font-size: 13.5px; }
.site-footer .powered { font-size: 12.5px; opacity: .75; margin-top: 16px; }

/* ── Not found ── */
.empty-state { text-align: center; padding: 30px 0; }
.empty-state p { color: var(--muted); }

/* ── Responsive ── */
@media (max-width: 900px) {
    .hero .container, .programme-hero { grid-template-columns: 1fr; }
    .hero .hero-img { order: -1; }
    .hero .hero-img img { max-width: 340px; }
    .stats .container { grid-template-columns: repeat(2, 1fr); }
    .map-layout { grid-template-columns: 1fr; }
    #ye-map { height: 340px; }
    .school-list { max-height: none; }
    .split { grid-template-columns: 1fr; }
    .split > div { padding: 44px 28px; }
}
@media (max-width: 680px) {
    .site-header { padding: 10px 16px; flex-wrap: wrap; gap: 8px; justify-content: center; }
    .site-nav { gap: 14px; flex-wrap: wrap; justify-content: center; }
    .site-nav a { font-size: 14px; }
    .logo img { height: 38px; }
    .section { padding: 44px 16px; }
    .hero { padding: 34px 18px 44px; }
    .pagehead { padding: 36px 18px 40px; }
    .widget-wrap { padding: 14px; border-radius: 18px; }
}

/* One programme on its own: lay the card out sideways instead of stretching
   a portrait card across the whole container. */
.format-grid:has(> .format-card:only-child) { grid-template-columns: 1fr; max-width: 940px; margin-left: auto; margin-right: auto; }
.format-card:only-child { flex-direction: row; }
.format-card:only-child .fc-img { flex: 0 0 38%; display: flex; align-items: center; }
.format-card:only-child .fc-img img { height: 240px; }
@media (max-width: 720px) {
    .format-card:only-child { flex-direction: column; }
    .format-card:only-child .fc-img img { height: 190px; }
}

/* ════════════════════════════════════════════════════════════════════════
   Booking portal (2026-11-29): the site is for booking and managing bookings;
   the main website does the marketing. Components below replace the old hero,
   stats band and programme cards on the landing page.
   ════════════════════════════════════════════════════════════════════════ */

.site-nav a.ext { color: var(--muted); font-weight: 600; font-size: 14px; }
.site-nav a.ext:hover { color: var(--blue); }

/* ── Portal header: title + three actions ── */
.portal-head { background: var(--tint); padding: 44px 32px 50px; border-bottom: 1px solid var(--line); }
.portal-head .container { text-align: center; }
.portal-head h1 { font-size: clamp(30px, 4.4vw, 44px); font-weight: 800; color: var(--navy); margin: 0 0 12px; line-height: 1.12; }
.portal-head > .container > p { font-size: 17px; max-width: 640px; margin: 0 auto; }

.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 34px; text-align: left; }
.action-card {
    background: #fff; border: 2px solid var(--line); border-radius: 20px; padding: 24px 24px 22px;
    text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 6px;
    transition: transform .14s, border-color .14s, box-shadow .14s;
}
.action-card:hover { transform: translateY(-3px); border-color: var(--blue); box-shadow: 0 12px 28px rgba(0,119,182,.14); }
.action-card h3 { margin: 6px 0 0; font-size: 20px; font-weight: 800; color: var(--navy); }
.action-card p { margin: 0; font-size: 14.5px; color: var(--muted); }
.action-card .go { margin-top: auto; padding-top: 10px; font-size: 14px; font-weight: 700; color: var(--blue-dk); }
.ac-icon {
    width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 800; color: #fff; line-height: 1;
}
.ac-icon--blue { background: var(--blue-dk); }
.ac-icon--green { background: #6E9417; }    /* darker than --green so the white glyph reads */
.ac-icon--orange { background: #C46F00; }   /* darker than --orange, same reason */

/* ── "Open for booking" cards ── */
.open-list { display: flex; flex-direction: column; gap: 18px; margin-top: 34px; }
.open-card {
    background: #fff; border: 2px solid var(--line); border-left: 6px solid var(--blue);
    border-radius: 20px; padding: 24px 28px;
    display: grid; grid-template-columns: 1fr auto; gap: 18px 28px; align-items: center;
}
.open-card .kind { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); }
.open-card h3 { margin: 4px 0 4px; font-size: 22px; font-weight: 800; color: var(--navy); }
.open-card .oc-dates { margin: 0; font-weight: 700; color: var(--ink); }
.open-card .oc-venue { margin: 4px 0 0; font-size: 14.5px; }
.open-card .oc-venue a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--muted); }
.open-card .oc-venue a:hover { color: var(--blue-dk); border-color: var(--blue-dk); }
.oc-groups { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.oc-groups li {
    background: var(--tint); border-radius: 12px; padding: 8px 12px; font-size: 13.5px;
    display: inline-flex; gap: 8px; align-items: baseline;
}
.oc-groups strong { color: var(--navy); }
.oc-groups span { color: var(--muted); }
.oc-groups em { font-style: normal; font-weight: 700; color: var(--blue-dk); }
.open-card .oc-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.open-card .oc-link { font-size: 14px; font-weight: 700; color: var(--blue-dk); }

/* ── Programme detail extras ── */
.group-card .price { margin-top: 6px; font-weight: 700; color: var(--blue-dk); }
.cta-center { text-align: center; margin: 30px 0 0; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── How booking works ── */
.steps { list-style: none; padding: 0; margin: 34px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.steps li { background: #fff; border-radius: 18px; padding: 22px; }
.steps .n {
    display: inline-flex; width: 34px; height: 34px; border-radius: 50%; align-items: center; justify-content: center;
    background: var(--blue-dk); color: #fff; font-weight: 800; margin-bottom: 10px;
}
.steps h4 { margin: 0 0 4px; font-size: 16.5px; font-weight: 800; color: var(--navy); }
.steps p { margin: 0; font-size: 14.5px; color: var(--muted); }

.help { text-align: center; }

@media (max-width: 900px) {
    .action-grid { grid-template-columns: 1fr; }
    .steps { grid-template-columns: repeat(2, 1fr); }
    .open-card { grid-template-columns: 1fr; }
    .open-card .oc-actions { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 520px) {
    .steps { grid-template-columns: 1fr; }
    .open-card { padding: 20px; }
}

/* ── Live class rows (ye-pages.js) ── */
.open-card { display: block; }
.open-card .oc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.open-card .oc-head h3 { margin: 4px 0 2px; }
.class-rows { list-style: none; padding: 0; margin: 16px 0 0; border-top: 1px solid var(--line); }
.class-rows li {
    display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.6fr) 70px 120px 130px;
    gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line);
}
.class-rows .cr-name { font-weight: 700; color: var(--navy); }
.class-rows .cr-when { font-size: 14px; color: var(--muted); }
.class-rows .cr-price { font-weight: 800; color: var(--navy); text-align: right; }
.class-rows .cr-avail { font-size: 13px; font-weight: 700; color: #3F7D20; }
.class-rows .is-last .cr-avail { color: #B35F00; }
.class-rows .is-full .cr-avail { color: #B3261E; }
.class-rows .cr-book { text-align: right; }
.class-rows .btn--sm { padding: 9px 20px; }
.loading { color: var(--muted); text-align: center; padding: 18px 0; }
a.school-item { display: block; text-decoration: none; }
#ye-venue-list:empty { display: none; }

@media (max-width: 760px) {
    .open-card .oc-head { flex-direction: column; gap: 6px; }
    .class-rows li { grid-template-columns: 1fr auto; grid-template-areas: "name price" "when when" "avail book"; row-gap: 4px; }
    .class-rows .cr-name { grid-area: name; }
    .class-rows .cr-when { grid-area: when; }
    .class-rows .cr-price { grid-area: price; }
    .class-rows .cr-avail { grid-area: avail; }
    .class-rows .cr-book { grid-area: book; }
}
