/* ==========================================================================
   THEME TOKENS
   ========================================================================== */
:root{
  --bg:#ffffff;
  --surface:#ffffff;
  --text:#111827;        /* near-black */
  --muted:#6b7280;       /* grey */
  --line:rgba(17,24,39,.12);

  /* Pink theme */
  --accent:#ED5A96;      /* legacy pink */
  --accent-2:#ff86b8;    /* lighter pink */

  --radius:18px;
  --shadow: 0 10px 30px rgba(17,24,39,.10);
  --shadow-soft: 0 6px 18px rgba(17,24,39,.08);
}

/* ==========================================================================
   BASE / RESET
   ========================================================================== */
*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height:1.55;
  color:var(--text);
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(237,90,150,.18), transparent 60%),
    radial-gradient(800px 450px at 90% 0%, rgba(237,90,150,.10), transparent 55%),
    var(--bg);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
}

a{color:inherit}
.container{width:min(1100px, 92vw); margin-inline:auto}

/* Accessibility */
.skip-link{
  position:absolute; left:-999px; top:auto;
  width:1px; height:1px; overflow:hidden;
}
.skip-link:focus{
  left:16px; top:16px; width:auto; height:auto;
  padding:10px 12px; border-radius:10px;
  background:var(--surface);
  border:1px solid var(--line);
  box-shadow: var(--shadow-soft);
  z-index:9999;
}

.sr-only{
  position:absolute; width:1px; height:1px;
  padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0;
}

/* ==========================================================================
   HEADER / NAV
   ========================================================================== */
.site-header{
  position:sticky; top:0;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
  z-index:1000;
}

.header-inner{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 0;
  gap:14px;
}

.brand{
  display:flex; align-items:center; gap:14px;
  text-decoration:none;
  min-width: 220px;
}

.brand-logo{
  height:50px;
  width:auto;
  max-width:180px;
  object-fit:contain;
}

.brand-text{display:flex; flex-direction:column}
.brand-name{font-weight:800; letter-spacing:.2px}
.brand-tag{font-size:.9rem; color:var(--muted)}

.site-nav{
  display:flex; align-items:center; gap:18px;
}

.site-nav a{
  text-decoration:none;
  padding:8px 10px;
  border-radius:12px;
  color: var(--text);
}

.site-nav a:hover{
  background: rgba(237,90,150,.10);
}

.nav-toggle{
  display:none;
  border:1px solid var(--line);
  background: rgba(255,255,255,.9);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  box-shadow: var(--shadow-soft);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius:14px;
  border:1px solid var(--line);
  text-decoration:none;
  font-weight:700;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

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

.btn-primary{
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(237,90,150,.22);
}

.btn-primary:hover{ filter: brightness(0.98); }

.btn-ghost{
  background: rgba(255,255,255,.9);
}

/* Extra-small button for table actions */
.btn-xs{
  padding: 6px 10px;
  border-radius: 11px;
  font-size: .85rem;
  line-height: 1.1;
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero{
  position: relative;
  isolation: isolate;
  padding: clamp(34px, 6vw, 72px) 0;
  overflow: hidden;
}

/* Background image layer */
.hero::before{
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url("/assets/img/hero.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.03);
  filter: grayscale(1) contrast(1.05) brightness(1.05);
}

/* Soft “washed” overlay */
.hero::after{
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(255,255,255,.86) 0%, rgba(255,255,255,.70) 55%, rgba(255,255,255,.60) 100%),
    radial-gradient(800px 400px at 20% 0%, rgba(237,90,150,.18), transparent 60%);
}

.hero-inner{
  position: relative;
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: clamp(18px, 4vw, 42px);
  align-items:stretch;
}

.hero-copy h1{
  margin:0 0 10px;
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  line-height:1.08;
  letter-spacing: -.02em;
}

.lead{
  color:var(--muted);
  font-size:1.05rem;
  max-width: 62ch;
}

.hero-cta{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin:18px 0 8px;
}

/* Right-side fixed slot so hero height does NOT change */
.hero-right{
  position: relative;
  min-height: 260px;          /* fixed slot height */
  max-height: 260px;
  border-radius: var(--radius);
}

/* both panels sit in the same slot */
.hero-right-panel{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;

  opacity: 1;
  transform: translateY(0);
  transition: opacity .22s ease, transform .22s ease;
}

/* Accreditation image */
.hero-accreditations-img{
  width: min(20vw, 240px);
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Question form panel (hidden by default) */
.hero-right-form{
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.hero-right.is-question-open .hero-right-logo{
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

.hero-right.is-question-open .hero-right-form{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Form card styling inside slot */
.question-card{
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-soft);
  padding: 14px;
  display:flex;
  flex-direction:column;
}

.question-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 10px;
}

.question-title{
  font-weight: 900;
  letter-spacing: .2px;
}

.question-sub{
  color: var(--muted);
  font-size: .95rem;
  margin-top: 2px;
}

.question-close{
  border: 1px solid var(--line);
  background: rgba(255,255,255,.9);
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}
.question-close:hover{ background: rgba(237,90,150,.10); }

/* Make form fit inside fixed height */
.question-form{
  display:flex;
  flex-direction:column;
  gap: 10px;
  height: 100%;
}

.form-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field{ display:flex; flex-direction:column; gap:6px; }
.field-full{ grid-column: 1 / -1; }

.field-label{
  font-weight: 800;
  font-size: .92rem;
}

.field-input{
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,.96);
  font: inherit;
  outline: none;
}

.field-input:focus{
  border-color: rgba(237,90,150,.45);
  box-shadow: 0 0 0 4px rgba(237,90,150,.14);
}

.field-textarea{
  resize: none;              /* keep layout stable */
  min-height: 92px;
  height: 92px;
}

.question-actions{
  margin-top:auto;           /* pushes buttons to bottom */
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* ==========================================================================
   SECTIONS / CARDS
   ========================================================================== */
.section{ padding: 18px 0 58px; }

.grid-3{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card{
  border:1px solid var(--line);
  background: rgba(255,255,255,.90);
  border-radius: var(--radius);
  padding:16px;
  box-shadow: var(--shadow-soft);
}

.card h2{ margin: 0 0 8px; font-size: 1.1rem; }
.card p{ margin:0; color:var(--muted); }

.muted{ color:var(--muted); }

/* ==========================================================================
   COURSES (tiles + filters + groupings)
   ========================================================================== */
.page-hero{ padding: clamp(26px, 4.5vw, 48px) 0 10px; }

.filters{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:16px;
}

.chip{
  display:inline-flex;
  align-items:center;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.92);
  color: var(--text);
  text-decoration:none;
  box-shadow: var(--shadow-soft);
  font-weight:650;
  font-size:.92rem;
  gap:10px;
}

.chip:hover{ background: rgba(237,90,150,.10); }

.chip-label{ font-weight:800; }

.chip-input{
  border:0;
  outline:0;
  background:transparent;
  font:inherit;
  min-width:220px;
}

.h2-section{ margin:0 0 10px; }
.p-section{ margin:0 0 16px; }

.month-block{ margin: 0 0 18px; }
.month-title{ margin: 0 0 10px; font-size: 1.05rem; }

.course-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.course-card{
  border:1px solid var(--line);
  background: rgba(255,255,255,.92);
  border-radius: var(--radius);
  padding:16px;
  box-shadow: var(--shadow-soft);
  display:flex;
  flex-direction:column;
  gap:12px;
}

.course-top{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.course-card .course-title{
  line-height: 1.2;
  margin: 8px 0 0;
  min-height: calc(1.2em * 2);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.course-meta-stack{
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.course-meta-line{
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.25;
}

.course-actions{
  margin-top:auto;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.error-banner{
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(220,38,38,.25);
  background: rgba(220,38,38,.08);
  color: #7f1d1d;
  box-shadow: var(--shadow-soft);
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* ==========================================================================
   TABLE LIST (homepage "More upcoming dates")
   ========================================================================== */
.course-table-wrap{
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-soft);
  overflow-x: auto;
}

.course-table{
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.course-table thead th{
  text-align: left;
  font-weight: 800;
  padding: 14px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.course-table tbody td{
  padding: 12px 14px;
  border-bottom: 1px solid rgba(17,24,39,.10);
  vertical-align: middle;
}

.course-table tbody tr:last-child td{ border-bottom: 0; }

.ct-course{ width: 44%; }
.ct-date{ width: 16%; white-space: nowrap; }
.ct-venue{ width: 14%; white-space: nowrap; }
.ct-avail{ width: 14%; white-space: nowrap; }
.ct-price{ width: 8%; white-space: nowrap; }
.ct-action{ width: 10%; white-space: nowrap; }

.table-title{ margin-top: 22px; }
.table-cta{ margin-top: 14px; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer{
  border-top:1px solid var(--line);
  background: rgba(255,255,255,.88);
  padding: 26px 0 18px;
}

.footer-inner{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:18px;
}

.footer-links{ display:flex; gap:14px; flex-wrap:wrap; }

.footer-links a{
  color:var(--muted);
  text-decoration:none;
  padding:6px 8px;
  border-radius:10px;
}

.footer-links a:hover{
  color:var(--text);
  background: rgba(237,90,150,.10);
}

.footer-bottom{ padding-top:10px; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 980px){
  .course-grid{ grid-template-columns: 1fr; }
}

@media (max-width: 880px){
  .hero-inner{ grid-template-columns: 1fr; }
  .grid-3{ grid-template-columns: 1fr; }

  .nav-toggle{ display:inline-flex; }

  .site-nav{
    display:none;
    position:absolute;
    right: min(4vw, 18px);
    top: 70px;
    flex-direction:column;
    align-items:stretch;
    gap:8px;
    padding:12px;
    border:1px solid var(--line);
    border-radius: 16px;
    background: rgba(255,255,255,.96);
    width: min(320px, 92vw);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open{ display:flex; }

  /* On mobile we allow the slot to grow naturally */
  .hero-right{
    min-height: 260px;
    max-height: none;
  }

  .form-grid{ grid-template-columns: 1fr; }
}