/* ==========================================================================
   Legacy Training Services — Single Stylesheet (index + courses)
   ========================================================================== */

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

  /* Brand */
  --accent:#ED5A96;
  --accent-2:#ff86b8;

  --radius:18px;

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

  --container: 1100px;
  --gutter: 92vw;
}

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

html, body{
  width:100%;
  overflow-x:hidden;
}

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;
}

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

a{ color:inherit; }

.container{
  width:min(var(--container), var(--gutter));
  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;
}

.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);
}

.site-nav a.nav-active{
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color:#fff;
  border:1px solid transparent;
  box-shadow: 0 10px 24px rgba(237,90,150,.18);
}
.site-nav a.nav-active:hover{ filter: brightness(0.98); }

.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;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  transition: transform .14s ease, filter .14s ease, box-shadow .14s ease;
}

.btn:active{ transform: translateY(1px); }
.btn:disabled{ cursor:not-allowed; }

.btn-primary{
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color:#fff;
  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);
}

.btn-xs{
  padding: 6px 10px;
  border-radius: 11px;
  font-size: .85rem;
  line-height: 1.1;
}

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

.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);
}

.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{
  margin:0;
  color:var(--muted);
  font-size:1.05rem;
  max-width:62ch;
}

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

.hero-right{
  display:flex;
  align-items:center;
  justify-content:center;
}

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

/* Courses can use different hero image later */
.hero--courses::before{
  background-image: url("/assets/img/hero.jpg");
}

/* ==========================================================================
   OFFER CARDS (index)
   ========================================================================== */
.offer-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:14px;
  margin-top:16px;
  max-width: 900px;
}

.offer-card{
  border-radius: 18px;
  overflow:hidden;
  border:1px solid rgba(17,24,39,.10);
  background: rgba(255,255,255,.70);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 26px rgba(17,24,39,.10);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
  display:flex;
  flex-direction:column;
  min-height: 220px;
}

.offer-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(17,24,39,.14);
  border-color: rgba(237,90,150,.22);
}

.offer-media{
  width:100%;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(600px 260px at 15% 0%, rgba(237,90,150,.18), transparent 60%),
    radial-gradient(600px 260px at 85% 100%, rgba(237,90,150,.10), transparent 60%),
    rgba(255,255,255,.92);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size:.9rem;
  color:#7a1640;
}

.offer-media img{
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
}

.offer-title{
  margin:12px 12px 4px;
  font-weight:900;
  font-size:1.05rem;
  line-height:1.15;
}

.offer-text{
  margin:0 12px 12px;
  color: rgba(17,24,39,.72);
  font-size:.93rem;
  line-height:1.35;
}

/* ==========================================================================
   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); }

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

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

/* ==========================================================================
   FILTERS / CHIPS
   ========================================================================== */
.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;
}

/* Shared header row (courses page) */
.upcoming-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.upcoming-head .filters{ margin-top:0; }

/* ==========================================================================
   COURSE TILES (index + courses)
   ========================================================================== */
.course-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:14px;
  min-width:0;
}

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

.course-top,
.course-actions{
  padding:12px;
}

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

.course-card .course-title{
  font-size:1rem;
  line-height:1.15;
  margin:6px 0 0;
  min-height: calc(1.15em * 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;
  min-width:0;
}

.course-meta-line{
  margin:0;
  color:var(--muted);
  font-size:.9rem;
  line-height:1.2;
  overflow-wrap:anywhere;
}

.course-actions{
  margin-top:auto;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  min-width:0;
}

.course-actions .btn{
  padding:8px 10px;
  border-radius:12px;
  font-size:.9rem;
}

.course-media{
  width:100%;
  aspect-ratio: 16 / 9;
  background: rgba(255,255,255,.9);
  overflow:hidden;
  border-radius: 16px 16px 0 0;
  min-width:0;
}

.course-thumb{
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
  object-position:center;
  border-radius: 16px 16px 0 0;
}

.course-media--empty{
  border-radius: 16px 16px 0 0;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  background:
    radial-gradient(600px 240px at 15% 0%, rgba(237,90,150,.20), transparent 60%),
    radial-gradient(600px 240px at 85% 100%, rgba(237,90,150,.12), transparent 60%),
    rgba(255,255,255,.92);
}

.course-media-badge{
  font-weight:900;
  letter-spacing:.18em;
  font-size:.85rem;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(237,90,150,.25);
  background: rgba(237,90,150,.10);
  color:#7a1640;
}

/* ==========================================================================
   TABLE (index)
   ========================================================================== */
.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;
  -webkit-overflow-scrolling: touch;
}

.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;
  line-height: 1.2;
}

.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; }

/* Table: small thumbnail next to course title (no row height increase) */
.course-table .ct-course-cell{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.course-table img.ct-thumb{
  width:22px !important;
  height:22px !important;
  max-width:22px !important;
  max-height:22px !important;
  flex:0 0 22px !important;
  border-radius:6px;
  object-fit:cover;
  object-position:center;
  display:block;
}

.course-table .ct-thumb--empty{
  width:22px;
  height:22px;
  flex:0 0 22px;
  border-radius:6px;
  background: rgba(17,24,39,.06);
  border: 1px solid rgba(17,24,39,.10);
}

.course-table .ct-title{
  min-width:0;
  line-height:1.2;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* ==========================================================================
   ERROR BANNER
   ========================================================================== */
.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;
}

/* ==========================================================================
   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: 1100px){
  .course-grid{ grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 980px){
  .course-grid{ grid-template-columns: repeat(2, 1fr); gap:12px; }
  .course-top,
  .course-actions{ padding:10px; }
  .course-actions .btn{ padding:8px 10px; font-size:.9rem; }
}

@media (max-width: 880px){
  .hero-inner{ grid-template-columns: 1fr; }
  .grid-3{ grid-template-columns: 1fr; }
  .offer-grid{ 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; }
}

@media (max-width: 520px){
  .course-grid{ grid-template-columns: 1fr; gap:12px; }
  .course-media{ aspect-ratio: 16 / 10; }

  .course-top,
  .course-actions{ padding:12px; }

  .course-card .course-title{ font-size:1.05rem; }
  .course-meta-line{ font-size:.95rem; }

  .course-actions{
    flex-direction:column;
    align-items:stretch;
  }
  .course-actions .btn{
    width:100%;
    justify-content:center;
  }
}