/*
Theme Name: GeneratePress Child – MATCH-D
Description: Child theme for match-d.com.au. Carries all MATCH-D customisations (UWA brand styling, utility bar, footer citation, legacy redirects) so GeneratePress updates can never wipe them.
Template: generatepress
Version: 1.2.0
*/

/* ============================================================
   MATCH-D site styles — UWA brand (Blue #003087 / Gold #DAAA00)
   Single consolidated stylesheet. Replaces the old layered
   Customizer "Additional CSS" (teal design + UWA override + patches).
   Fonts (Merriweather + Montserrat) are enqueued in functions.php.
   ============================================================ */

:root {
  --uwa-blue: #003087;
  --uwa-blue-dark: #00226A;
  --uwa-gold: #DAAA00;
  --uwa-gold-light: #FDD26E;
  --uwa-black: #000000;
  --uwa-white: #FFFFFF;
}

/* ---------- Typography ----------
   !important only where GeneratePress's dynamic inline CSS sets
   the same property and would otherwise win. */
body,
.site-container,
.entry-content,
.main-navigation {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  color: var(--uwa-black);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
h1, h2, h3, h4, h5, h6,
.site-title, .entry-title {
  font-family: 'Merriweather', Georgia, serif !important;
  color: var(--uwa-blue) !important;
}
h1, h2, h3, h4, h5 { letter-spacing: -0.01em; }
.site-title { margin-bottom: 0; }
.site-title a { color: var(--uwa-blue) !important; }

/* Keep the MATCH-D wordmark on one line */
.site-title, .site-title a,
.main-title, .main-title a {
  white-space: nowrap;
  hyphens: none;
  word-break: keep-all;
  overflow-wrap: normal;
}

/* Tagline as part of the brand lockup */
.site-description {
  font-family: 'Merriweather', Georgia, serif !important;
  font-style: italic;
  color: var(--uwa-blue) !important;
  font-size: 1.05em;
  font-weight: 400;
  line-height: 1.35;
  margin-top: 0.2em;
  white-space: normal;
  max-width: 380px;
}
.site-branding { max-width: 38%; }

/* Body links */
.entry-content a:not(.matchd-btn):not(.matchd-card-cta) { color: var(--uwa-blue); }

/* ---------- Header ---------- */
.site-header { padding-top: 1em; padding-bottom: 1em; }
/* Site navigation lives in the blue utility bar; hide GP's header nav */
.site-header .main-navigation { display: none !important; }
.site-header .inside-header { justify-content: space-between; }
.site-content { padding-top: 0; }
.home .entry-title,
.home.page .entry-title { display: none; }

/* ---------- Utility bar (markup output by functions.php) ---------- */
.matchd-top-bar {
  background: var(--uwa-blue);
  border-bottom: 1px solid rgba(255,255,255,0.18);
  color: var(--uwa-white);
}
.matchd-top-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.1em 1.25em;
}
.matchd-utility-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: flex-end;
  gap: 0.75em;
  flex-wrap: wrap;
}
/* min-height 44px = WCAG touch-target size; this is the primary nav */
.matchd-utility-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.55em;
  color: var(--uwa-white);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.matchd-utility-nav a:hover { color: var(--uwa-gold); }

/* ---------- Hero band (homepage) ---------- */
.matchd-hero {
  background: var(--uwa-blue);
  color: var(--uwa-white);
  padding: 4em 1.5em 4.5em;
  margin: 0 -1em 2.5em;
  text-align: center;
}
/* Full-bleed when the hero is the first block in the content */
.entry-content > .matchd-hero:first-child {
  margin-top: -1em;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-left: max(1.5em, 5vw);
  padding-right: max(1.5em, 5vw);
}
.matchd-hero h1 {
  color: var(--uwa-white) !important;
  font-size: clamp(1.9em, 4vw, 3em);
  margin: 0 0 0.4em;
  font-weight: 700;
  line-height: 1.15;
}
.matchd-hero h2 { color: var(--uwa-white) !important; }
.matchd-hero p { color: rgba(255,255,255,0.92); }
.matchd-hero p.lede {
  font-size: clamp(1.05em, 1.5vw, 1.25em);
  max-width: 38em;
  margin: 0 auto 1.5em;
  line-height: 1.55;
}

/* ---------- Buttons ---------- */
.matchd-cta-row {
  display: flex;
  gap: 0.75em;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5em;
}
.matchd-btn {
  display: inline-block;
  padding: 0.85em 1.6em;
  border-radius: 0;
  font-weight: 600;
  font-size: 1em;
  line-height: 1.2;
  text-decoration: none;
  transition: all 0.15s ease;
}
.matchd-btn-primary {
  background: var(--uwa-gold);
  color: var(--uwa-black);
}
.matchd-btn-primary:hover {
  background: var(--uwa-gold-light);
  color: var(--uwa-black);
  transform: translateY(-1px);
}
.matchd-btn-secondary {
  background: transparent;
  border: 2px solid var(--uwa-white);
  color: var(--uwa-white);
}
.matchd-btn-secondary:hover {
  background: rgba(255,255,255,0.15);
  color: var(--uwa-white);
}

/* ---------- Intro block (homepage) ---------- */
.matchd-intro {
  max-width: 44em;
  margin: 2em auto 3em;
  text-align: center;
  font-size: 1.1em;
  line-height: 1.65;
  color: #374151;
}
.matchd-intro h2 { font-size: 1.5em; margin: 0 0 0.6em; }

/* ---------- Stage cards (homepage) ---------- */
.matchd-stage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25em;
  margin: 2em 0 3em;
}
/* 4th card (All Stages) spans the full row */
.matchd-stage-grid > .matchd-stage-card:nth-child(4) { grid-column: 1 / -1; }
.matchd-stage-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--uwa-white);
  border: 1px solid #e5e7eb;
  border-top: 4px solid var(--uwa-blue);
  border-radius: 0;
  padding: 1.5em 1.25em;
  color: inherit;
  transition: all 0.18s ease;
}
.matchd-stage-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -10px rgba(0,0,0,0.15);
  border-top-color: var(--uwa-gold);
}
.matchd-stage-card h3 {
  margin: 0 0 0.4em;
  font-size: 1.15em;
  font-weight: 700;
}
.matchd-stage-card p {
  margin: 0 0 1em;
  font-size: 0.95em;
  color: #4b5563;
  line-height: 1.5;
}
.matchd-stage-card .matchd-card-cta {
  margin-top: auto;
  color: var(--uwa-blue);
  font-weight: 600;
  font-size: 0.9em;
  text-decoration: none;
}
/* Stretch the card link over the whole card */
.matchd-stage-card .matchd-card-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
.matchd-stage-card:hover .matchd-card-cta { color: var(--uwa-blue-dark); }

/* ---------- Audience strip (homepage) ---------- */
.matchd-audience {
  background: #f5f8ff;
  border-radius: 0;
  padding: 2em 1.5em;
  margin: 3em 0;
  text-align: center;
}
.matchd-audience h2 { margin: 0 0 0.8em; font-size: 1.3em; }
.matchd-audience-list {
  display: flex;
  gap: 2em;
  justify-content: center;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 1em 0 0;
}
.matchd-audience-list li { font-weight: 600; color: var(--uwa-blue); }

/* ---------- Evidence box ---------- */
.matchd-evidence {
  background: #fafaf9;
  border-left: 4px solid var(--uwa-gold);
  border-radius: 0;
  padding: 1.25em 1.5em;
  margin: 2em 0;
  font-size: 0.95em;
  color: #44403c;
  line-height: 1.6;
}
.matchd-evidence strong { color: var(--uwa-blue); }

/* ============================================================
   Criteria pages & MATCH-D Tool — recommendation boxes
   ============================================================ */
.matchd-box {
  border-radius: 0;
  padding: 1.25em 1.5em 0.5em;
  margin: 1em 0 2em;
  border-left: 5px solid;
}
.matchd-recommended { background: #e8f5e9; border-left-color: #43a047; }
.matchd-not-recommended { background: #ffebee; border-left-color: #e53935; }
.matchd-box > p:first-child { margin-top: 0; }
.matchd-recommended > p:first-child::before { content: "✓ "; color: #2e7d32; font-weight: 700; }
.matchd-not-recommended > p:first-child::before { content: "✕ "; color: #c62828; font-weight: 700; }

/* ---------- Native <details> accordions ---------- */
.matchd-accordion { border-top: 1px solid #d0d0d0; margin: 0; }
.matchd-box > details.matchd-accordion:last-of-type { border-bottom: 1px solid #d0d0d0; }
.matchd-accordion > summary {
  cursor: pointer;
  padding: 0.85em 1em 0.85em 2.2em;
  background: rgba(255,255,255,0.55);
  font-weight: 700;
  list-style: none;
  position: relative;
  user-select: none;
  outline: none;
}
.matchd-accordion > summary::-webkit-details-marker { display: none; }
.matchd-accordion > summary::before {
  content: "▸";
  position: absolute;
  left: 0.9em;
  top: 0.85em;
  transition: transform 0.15s ease;
  display: inline-block;
}
.matchd-accordion[open] > summary::before { transform: rotate(90deg); }
.matchd-accordion > summary:hover { background: rgba(255,255,255,0.85); }
.matchd-accordion-body { padding: 0.5em 1.25em 1em; }
.matchd-accordion-body ul { margin: 0.25em 0 0.5em 1.25em; }

/* ---------- Stage-comparison columns (inside accordions) ---------- */
.matchd-cols-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1em;
  margin: 0.75em 0;
}
.matchd-cols-3 > div {
  padding: 0.6em 0.9em;
  background: rgba(255,255,255,0.55);
  border-radius: 4px;
  border-top: 3px solid var(--uwa-blue);
}

/* ============================================================
   Interactive Checklist (page 400) & MATCH-D Tool (page 410)
   These pages bring their own banner; hide the WP title.
   ============================================================ */
.page-id-400 .entry-header,
.page-id-400 .entry-title,
.page-id-410 .entry-header,
.page-id-410 .entry-title { display: none; }
.page-id-400 .inside-article,
.page-id-410 .inside-article { padding: 0; }
.page-id-400 .matchd-cl { margin: 0 -30px; }

/* Counter the global blue-heading rule inside the checklist banner */
.matchd-cl .matchd-cl-banner h1 { color: #ffffff !important; }
.matchd-cl .matchd-cl-banner .lede { color: rgba(255,255,255,0.92) !important; }
.matchd-cl .matchd-cl-banner .crumb { color: var(--uwa-gold-light) !important; }

/* ---------- Mobile (≤700px) ---------- */
@media (max-width: 700px) {
  .site-branding { max-width: 100%; }
  .site-description { max-width: 100%; font-size: 0.95em; }

  .matchd-utility-nav ul {
    justify-content: center;
    row-gap: 0.1em;
    column-gap: 0.4em;
  }
  .matchd-utility-nav a {
    padding: 0 0.45em;
    font-size: 0.92em;
  }

  .matchd-stage-grid { grid-template-columns: 1fr; }
  .matchd-cols-3 { grid-template-columns: 1fr; }

  /* Checklist breakout margin would overflow narrow viewports */
  .page-id-400 .matchd-cl { margin: 0; }

  /* Banners: stay inside the viewport, no clipped words */
  .matchd-hero,
  .matchd-cl-banner,
  .matchd-tool-banner {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 1.25em !important;
    padding-right: 1.25em !important;
    box-sizing: border-box;
    max-width: 100%;
  }
  .matchd-hero h1, .matchd-hero h2, .matchd-hero p,
  .matchd-cl-banner h1, .matchd-cl-banner .lede,
  .matchd-tool-banner h1, .matchd-tool-banner h2,
  .matchd-tool-banner p, .matchd-tool-banner .lede {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: manual;
  }
}
