/* =====================================================================
   Coastal Hearts charity events: shared stylesheet for every page
   ===================================================================== */

   :root {
    --ink: #12343b;         /* main text */
    --teal: #1b6f72;        /* links, highlights */
    --teal-dark: #0e4a4d;   /* header, hero, footer */
    --sea: #e6f2f1;         /* light backgrounds */
    --sun: #f4b63f;         /* main buttons */
    --heart: #d94f5c;       /* fundraising progress */
    --muted: #5a6e73;       /* secondary text */
    --line: #d5e3e3;        /* dividers */
    --bg: #fafcfc;
    --white: #ffffff;
  
    --font-display: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
    --font-body: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  }
  
  * { box-sizing: border-box; }
  
  body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
  }
  
  h1, h2, h3 {
    font-family: var(--font-display);
    line-height: 1.15;
    margin: 0 0 0.5em;
  }
  h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
  h3 { font-size: 1.3rem; }
  
  p { margin: 0 0 1em; }
  a { color: var(--teal); }
  img { max-width: 100%; display: block; }
  
  :focus-visible {
    outline: 3px solid var(--sun);
    outline-offset: 3px;
  }
  
  .container {
    width: min(1100px, 100% - 2.5rem);
    margin-inline: auto;
  }
  
  /* ---------------------------------------------------------------------
     Navigation
     --------------------------------------------------------------------- */
  .site-header {
    background: var(--teal-dark);
    position: sticky;
    top: 0;
    z-index: 10;
  }
  .nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 64px;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--white);
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    white-space: nowrap;
  }
  .brand-mark { width: 30px; height: 30px; }
  .brand-mark path { fill: var(--heart); }
  .brand-mark .brand-wave {
    fill: none;
    stroke: var(--white);
    stroke-width: 2;
    stroke-linecap: round;
  }
  .nav-links {
    display: flex;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .nav-links a {
    display: block;
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    color: #d8ebea;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
  }
  .nav-links a:hover { color: var(--white); background: rgba(255, 255, 255, 0.08); }
  .nav-links a[aria-current="page"] {
    color: var(--white);
    box-shadow: inset 0 -3px 0 var(--sun);
    border-radius: 0;
  }
  
  /* ---------------------------------------------------------------------
     Buttons
     --------------------------------------------------------------------- */
  .btn {
    display: inline-block;
    padding: 0.8rem 1.4rem;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
  }
  .btn-primary { background: var(--sun); color: var(--ink); }
  .btn-primary:hover { background: #f7c55f; }
  .btn-ghost { border-color: rgba(255, 255, 255, 0.55); color: var(--white); }
  .btn-ghost:hover { border-color: var(--white); }
  
  /* ---------------------------------------------------------------------
     Hero (home page)
     --------------------------------------------------------------------- */
  .hero {
    position: relative;
    background: var(--teal-dark);
    color: var(--white);
    padding: 4.5rem 0 6rem;
  }
  .hero-inner { max-width: 1100px; }
  .hero-kicker {
    color: var(--sun);
    font-weight: 600;
    margin-bottom: 1rem;
  }
  .hero h1 {
    font-size: clamp(2.2rem, 5.2vw, 3.7rem);
    max-width: 17ch;
    letter-spacing: -0.01em;
  }
  .hero-text {
    max-width: 58ch;
    color: #d8ebea;
    font-size: 1.15rem;
    margin-bottom: 2rem;
  }
  .hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
  .hero-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 60px;
  }
  .hero-wave path { fill: var(--bg); }
  
  /* ---------------------------------------------------------------------
     Sections
     --------------------------------------------------------------------- */
  .section { padding: 3.5rem 0; }
  .section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
  }
  .section-note { color: var(--muted); margin: 0; }
  
  /* ---------------------------------------------------------------------
     Event list (shared by Home and Search)
     A date-led list, like a tide chart, rather than a grid of cards.
     --------------------------------------------------------------------- */
  .event-list { border-top: 2px solid var(--ink); }
  
  .event-row {
    display: grid;
    grid-template-columns: 76px 150px 1fr 210px;
    gap: 1.5rem;
    align-items: start;
    padding: 1.5rem 0.75rem;
    border-bottom: 1px solid var(--line);
    color: inherit;
    text-decoration: none;
  }
  .event-row:hover { background: var(--sea); }
  .event-row:hover .event-name { color: var(--teal); }
  
  .event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.05;
    padding-top: 0.2rem;
  }
  .event-day {
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--teal);
  }
  .event-month { font-weight: 600; font-size: 1.05rem; }
  .event-weekday { color: var(--muted); font-size: 0.9rem; margin-top: 0.2rem; }
  
  .event-thumb {
    width: 150px;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    overflow: hidden;
    background: var(--sea);
  }
  .event-thumb img { width: 100%; height: 100%; object-fit: cover; }
  
  .image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.5rem;
    color: var(--teal);
    font-family: var(--font-display);
    font-weight: 600;
    background: var(--sea);
    border: 1px solid var(--line);
  }
  
  .event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
  }
  .event-category { color: var(--teal); font-weight: 600; }
  .status {
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
  }
  .status-upcoming { background: var(--sea); color: var(--teal-dark); }
  .status-past { background: #eceff0; color: var(--muted); }
  
  .event-name { font-size: 1.35rem; margin-bottom: 0.3rem; }
  .event-where { color: var(--muted); margin-bottom: 0.4rem; font-size: 0.97rem; }
  .event-summary { margin: 0; max-width: 60ch; }
  
  .event-side { display: flex; flex-direction: column; gap: 0.45rem; }
  .event-price {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    margin: 0;
  }
  .event-price small {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--muted);
  }
  .event-cta {
    font-weight: 600;
    color: var(--teal);
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  
  .event-row.is-past { opacity: 0.7; }
  
  /* ---------------------------------------------------------------------
     Fundraising progress bar (shared)
     --------------------------------------------------------------------- */
  .progress {
    height: 8px;
    background: var(--line);
    border-radius: 999px;
    overflow: hidden;
  }
  .progress-bar {
    height: 100%;
    background: var(--heart);
    border-radius: 999px;
  }
  .progress-text { margin: 0; font-size: 0.9rem; color: var(--muted); }
  
  /* ---------------------------------------------------------------------
     Messages (loading, empty, error)
     --------------------------------------------------------------------- */
  .message {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    background: var(--sea);
  }
  .message-error {
    background: #fdecee;
    color: #8a2230;
    border-left: 4px solid var(--heart);
  }
  
  /* ---------------------------------------------------------------------
     About and contact (home page)
     --------------------------------------------------------------------- */
  .about { background: var(--sea); }
  .about-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 3rem;
    align-items: start;
  }
  .about-inner p { max-width: 62ch; }
  .contact-card {
    font-style: normal;
    background: var(--white);
    border-radius: 10px;
    padding: 1.5rem 1.75rem;
    border: 1px solid var(--line);
  }
  .contact-card dl { margin: 0; }
  .contact-card dt { color: var(--muted); font-size: 0.9rem; margin-top: 0.75rem; }
  .contact-card dt:first-child { margin-top: 0; }
  .contact-card dd { margin: 0; font-weight: 600; }
  
  /* ---------------------------------------------------------------------
     Footer
     --------------------------------------------------------------------- */
  .site-footer {
    background: var(--teal-dark);
    color: #d8ebea;
    padding: 2rem 0;
  }
  .site-footer p { margin: 0 0 0.4rem; }
  .footer-small { font-size: 0.85rem; opacity: 0.8; }
  
  /* ---------------------------------------------------------------------
     Mobile layout
     --------------------------------------------------------------------- */
  @media (max-width: 820px) {
    .event-row {
      grid-template-columns: 60px 1fr;
      grid-template-areas:
        "date body"
        "date side";
      gap: 0.75rem 1rem;
    }
    .event-date { grid-area: date; }
    .event-body { grid-area: body; }
    .event-side { grid-area: side; max-width: 320px; }
    .event-thumb { display: none; }
    .event-day { font-size: 2rem; }
    .about-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  }
  
  @media (max-width: 480px) {
    .brand { font-size: 1.05rem; }
    .nav-links a { padding: 0.5rem 0.55rem; }
    .hero { padding: 3rem 0 5rem; }
  }
  
  @media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; }
  }
  
  html { scroll-behavior: smooth; scroll-padding-top: 80px; }
  
  /* ---------------------------------------------------------------------
     Page header (inner pages: Search, Event details)
     --------------------------------------------------------------------- */
  .page-header {
    background: var(--teal-dark);
    color: var(--white);
    padding: 2.5rem 0 2.25rem;
  }
  .page-header h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 0.3rem; }
  .page-header p { color: #d8ebea; margin: 0; max-width: 60ch; }
  
  /* ---------------------------------------------------------------------
     Search form
     --------------------------------------------------------------------- */
  .search-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 1rem 1.25rem;
    align-items: end;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.5rem;
  }
  .field { display: flex; flex-direction: column; gap: 0.35rem; }
  .field label { font-weight: 600; }
  .field input,
  .field select {
    font: inherit;
    color: var(--ink);
    padding: 0.65rem 0.75rem;
    border: 1px solid #b9cccc;
    border-radius: 6px;
    background: var(--white);
    min-height: 46px;
  }
  .field input:focus,
  .field select:focus { border-color: var(--teal); }
  .form-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
  .btn-outline {
    background: var(--white);
    border-color: var(--teal);
    color: var(--teal);
  }
  .btn-outline:hover { background: var(--sea); }
  
  .results-head { margin-top: 2.5rem; }
  
  @media (max-width: 900px) {
    .search-form { grid-template-columns: 1fr 1fr; }
    .form-actions { grid-column: 1 / -1; }
  }
  @media (max-width: 560px) {
    .search-form { grid-template-columns: 1fr; padding: 1.25rem; }
  }
  
  /* ---------------------------------------------------------------------
     Keep the footer at the bottom of the window on short pages
     --------------------------------------------------------------------- */
  body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  main { flex: 1; }
  
  /* ---------------------------------------------------------------------
     Event details page
     --------------------------------------------------------------------- */
  .event-header { padding-top: 1.75rem; }
  .back-link {
    display: inline-block;
    color: #d8ebea;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 1.25rem;
  }
  .back-link:hover { color: var(--white); text-decoration: underline; }
  .event-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 0.6rem;
  }
  .event-category-light { color: var(--sun); font-weight: 600; }
  .event-header h1 { max-width: 22ch; }
  
  .event-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 3rem;
    align-items: start;
  }
  .event-main p { max-width: 65ch; }
  .event-main h3 { margin-top: 2rem; }
  .event-hero-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 2rem;
  }
  .past-notice { margin-top: 0; margin-bottom: 1.5rem; }
  
  .detail-list {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 0.6rem 1rem;
    margin: 0;
  }
  .detail-list dt { color: var(--muted); }
  .detail-list dd { margin: 0; font-weight: 600; }
  
  .event-aside {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 88px;
  }
  .ticket-card,
  .goal-card,
  .organiser-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.4rem 1.5rem;
  }
  .ticket-card { border-top: 4px solid var(--sun); }
  .goal-card { border-top: 4px solid var(--heart); }
  .organiser-card p { margin: 0 0 0.3rem; }
  .ticket-label {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
  }
  .ticket-price {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
  }
  .ticket-note { color: var(--muted); font-size: 0.95rem; }
  .btn-block { width: 100%; }
  .btn:disabled {
    background: #e4e9ea;
    color: var(--muted);
    cursor: not-allowed;
  }
  
  .goal-raised {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin: 0 0 0.6rem;
  }
  .goal-raised span { font-size: 1.9rem; font-weight: 700; color: var(--heart); }
  .progress-large { height: 14px; }
  .goal-numbers {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0.5rem 0 0.25rem;
  }
  .goal-remaining { font-weight: 600; margin: 0; }
  .organiser-name { font-weight: 600; }
  
  #event-message .btn { margin-top: 0.5rem; }
  
  /* Register modal (uses the HTML <dialog> element) */
  .modal {
    border: none;
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: calc(100% - 2rem);
    color: var(--ink);
  }
  .modal::backdrop { background: rgba(14, 74, 77, 0.55); }
  .modal h2 { font-size: 1.5rem; }
  
  @media (max-width: 900px) {
    .event-detail { grid-template-columns: 1fr; gap: 2rem; }
    .event-aside { position: static; order: -1; }
  }

/* =====================================================================
   A3 (Sidarth): Registration page, registrations list, weather
   ===================================================================== */
.register-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
.register-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.75rem;
}
.register-form h2 { margin-bottom: 0.25rem; }
.field input[type="tel"],
.field input[type="number"] { font: inherit; }
.total-line { font-size: 1.15rem; margin: 0.25rem 0 0; }
.total-line strong { font-family: var(--font-display); font-size: 1.5rem; color: var(--heart); }
.register-form .message { margin: 0; }
.error-list { margin: 0; padding-left: 1.2rem; }
.event-summary h3 { margin: 0.25rem 0 1rem; }
.event-summary .detail-list { margin: 0; }

.success-card {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 4px solid var(--teal);
  border-radius: 10px;
  padding: 2.25rem 2rem;
}
.success-total { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--heart); }

/* Register link styled as a disabled button for past events */
.btn.is-disabled {
  background: #e4e9ea;
  color: var(--muted);
  cursor: not-allowed;
  pointer-events: none;
}

/* Registrations list on the Event page */
.registrations-section { margin-top: 2.5rem; }
.registrations-section .section-head { margin-bottom: 0.75rem; }
.registrations-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.registrations-table th,
.registrations-table td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.registrations-table th { background: var(--sea); font-weight: 600; font-size: 0.95rem; }
.registrations-table tr:last-child td { border-bottom: none; }
.registrations-table td:nth-child(2),
.registrations-table th:nth-child(2) { text-align: center; }

/* Weather forecast on the Event page */
.weather-section { margin-top: 2rem; }
.weather-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--sea);
  border-radius: 10px;
  padding: 1.1rem 1.4rem;
}
.weather-icon { font-size: 2.8rem; line-height: 1; }
.weather-text p { margin: 0; }
.weather-desc { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; }
.weather-temps { font-weight: 600; }
.weather-day { color: var(--muted); font-size: 0.95rem; }

@media (max-width: 900px) {
  .register-layout { grid-template-columns: 1fr; }
  .event-summary { order: -1; }
}
@media (max-width: 560px) {
  .registrations-table th,
  .registrations-table td { padding: 0.55rem 0.6rem; font-size: 0.95rem; }
}
a.btn-block { text-align: center; }
.register-layout[hidden], .success-card[hidden], .weather-section[hidden] { display: none; }
