/*
Theme Name:        Project Sunrise
Theme URI:         https://projectsunrise.org.au
Author:            Project Sunrise Team
Author URI:        https://projectsunrise.org.au
Description:       A culturally responsive, purpose-built WordPress theme for Project Sunrise — supporting young people across Aboriginal and Torres Strait Islander communities with holistic health, mental wellness, and cultural connection.
Version:           1.0.0
Requires at least: 6.0
Tested up to:      6.5
Requires PHP:      8.0
License:           GNU General Public License v2 or later
License URI:       http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       sunrise
Tags:              custom-menu, custom-logo, featured-images, full-width-template, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready, accessibility-ready, woocommerce
*/

/* ==========================================================================
   CSS CUSTOM PROPERTIES — Design Tokens
   ========================================================================== */

:root {
  /* --- Colour Palette --- */
  --color-deep-forest:    #1A3C34;
  --color-sunrise-gold:   #D4891A;
  --color-accessible-gold:#8B6914;
  --color-warm-cream:     #FDF7EE;
  --color-light-moss:     #EDF4F1;
  --color-dark-footer:    #0F1F1A;

  /* Functional aliases */
  --color-primary:        var(--color-deep-forest);
  --color-accent:         var(--color-sunrise-gold);
  --color-accent-dark:    var(--color-accessible-gold);
  --color-background:     var(--color-warm-cream);
  --color-surface:        var(--color-light-moss);
  --color-footer-bg:      var(--color-dark-footer);

  /* Text colours */
  --color-text-primary:   #1A1A1A;
  --color-text-secondary: #4A4A4A;
  --color-text-muted:     #767676;
  --color-text-light:     #FAFAFA;
  --color-text-on-dark:   var(--color-warm-cream);

  /* Border colours */
  --color-border:         #D9E5E2;
  --color-border-dark:    #2E5048;

  /* State colours */
  --color-success:        #2D7A44;
  --color-error:          #C0392B;
  --color-warning:        #E67E22;
  --color-info:           #2980B9;

  /* --- Typography --- */
  --font-display:         'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body:            'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-ui:              'Outfit', 'Inter', sans-serif;

  /* Font sizes — fluid type scale */
  --text-xs:    0.75rem;    /* 12px */
  --text-sm:    0.875rem;   /* 14px */
  --text-base:  1rem;       /* 16px */
  --text-md:    1.125rem;   /* 18px */
  --text-lg:    1.25rem;    /* 20px */
  --text-xl:    1.5rem;     /* 24px */
  --text-2xl:   1.875rem;   /* 30px */
  --text-3xl:   2.25rem;    /* 36px */
  --text-4xl:   3rem;       /* 48px */
  --text-5xl:   3.75rem;    /* 60px */
  --text-6xl:   4.5rem;     /* 72px */

  /* Font weights */
  --weight-light:    300;
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  /* Line heights */
  --leading-tight:  1.25;
  --leading-snug:   1.375;
  --leading-normal: 1.5;
  --leading-relaxed:1.625;
  --leading-loose:  2;

  /* Letter spacing */
  --tracking-tight:  -0.025em;
  --tracking-normal:  0;
  --tracking-wide:    0.025em;
  --tracking-wider:   0.05em;
  --tracking-widest:  0.1em;

  /* --- Spacing --- */
  --space-1:   0.25rem;   /* 4px */
  --space-2:   0.5rem;    /* 8px */
  --space-3:   0.75rem;   /* 12px */
  --space-4:   1rem;      /* 16px */
  --space-5:   1.25rem;   /* 20px */
  --space-6:   1.5rem;    /* 24px */
  --space-8:   2rem;      /* 32px */
  --space-10:  2.5rem;    /* 40px */
  --space-12:  3rem;      /* 48px */
  --space-16:  4rem;      /* 64px */
  --space-20:  5rem;      /* 80px */
  --space-24:  6rem;      /* 96px */
  --space-32:  8rem;      /* 128px */

  /* Section padding */
  --section-pad-y:    var(--space-20);
  --section-pad-x:    var(--space-8);

  /* --- Layout --- */
  --container-max:    1280px;
  --container-wide:   1440px;
  --container-narrow: 768px;
  --container-pad:    clamp(1rem, 5vw, 3rem);

  /* --- Borders --- */
  --radius-sm:   0.25rem;
  --radius-md:   0.5rem;
  --radius-lg:   1rem;
  --radius-xl:   1.5rem;
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-sm:  0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md:  0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg:  0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl:  0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-card: 0 2px 12px 0 rgb(26 60 52 / 0.08);
  --shadow-card-hover: 0 8px 32px 0 rgb(26 60 52 / 0.16);

  /* --- Transitions --- */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;
  --transition-spring: 350ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* --- Z-index scale --- */
  --z-below:    -1;
  --z-base:      0;
  --z-raised:   10;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  300;
  --z-modal:    400;
  --z-toast:    500;

  /* --- Header --- */
  --header-height:         80px;
  --header-height-mobile:  64px;
}

/* ==========================================================================
   MODERN CSS RESET (Andy Bell / adapted)
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
  height: 100%;
}

body {
  min-height: 100%;
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-primary);
  background-color: var(--color-background);
  overflow-x: hidden;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

ul[role="list"], ol[role="list"] {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-deep-forest);
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ==========================================================================
   TYPOGRAPHY SCALE
   ========================================================================== */

.type-display-xl {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, var(--text-6xl));
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.type-display-lg {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, var(--text-5xl));
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

.type-display-md {
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 4vw, var(--text-4xl));
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
}

.type-heading-lg {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, var(--text-3xl));
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
}

.type-heading-md {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.5vw, var(--text-2xl));
  font-weight: var(--weight-semibold);
}

.type-heading-sm {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
}

.type-label {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

.type-body-lg {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
}

.type-body {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

.type-body-sm {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

/* Prose — long-form body text */
.prose {
  max-width: 68ch;
  color: var(--color-text-secondary);
}
.prose > * + * {
  margin-top: 1.25em;
}
.prose h2 {
  font-size: var(--text-2xl);
  margin-top: 2em;
  margin-bottom: 0.75em;
}
.prose h3 {
  font-size: var(--text-xl);
  margin-top: 1.75em;
  margin-bottom: 0.5em;
}
.prose p {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
}
.prose a {
  color: var(--color-accessible-gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose a:hover {
  color: var(--color-sunrise-gold);
}
.prose ul {
  list-style: disc;
  padding-left: 1.5rem;
}
.prose ol {
  list-style: decimal;
  padding-left: 1.5rem;
}
.prose li {
  margin-top: 0.5em;
  line-height: var(--leading-relaxed);
}
.prose blockquote {
  border-left: 4px solid var(--color-sunrise-gold);
  padding-left: 1.5rem;
  font-style: italic;
  color: var(--color-text-secondary);
}
.prose strong {
  color: var(--color-text-primary);
  font-weight: var(--weight-semibold);
}
.prose code {
  font-family: 'Courier New', monospace;
  font-size: 0.875em;
  background: var(--color-light-moss);
  padding: 0.125em 0.375em;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   LAYOUT UTILITIES
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-block: var(--section-pad-y);
}

.section--sm {
  padding-block: var(--space-12);
}

.section--lg {
  padding-block: clamp(4rem, 10vw, 8rem);
}

.grid {
  display: grid;
  gap: var(--space-8);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.gap-10 { gap: var(--space-10); }
.gap-12 { gap: var(--space-12); }

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* ==========================================================================
   COLOUR UTILITIES
   ========================================================================== */

.bg-deep-forest    { background-color: var(--color-deep-forest); }
.bg-warm-cream     { background-color: var(--color-warm-cream); }
.bg-light-moss     { background-color: var(--color-light-moss); }
.bg-dark-footer    { background-color: var(--color-dark-footer); }
.bg-sunrise-gold   { background-color: var(--color-sunrise-gold); }
.bg-white          { background-color: #ffffff; }

.text-forest       { color: var(--color-deep-forest); }
.text-gold         { color: var(--color-sunrise-gold); }
.text-gold-dark    { color: var(--color-accessible-gold); }
.text-cream        { color: var(--color-warm-cream); }
.text-muted        { color: var(--color-text-muted); }
.text-white        { color: #ffffff; }

/* ==========================================================================
   BUTTON SYSTEM
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: none;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition-base),
              color var(--transition-base),
              border-color var(--transition-base),
              box-shadow var(--transition-base),
              transform var(--transition-fast);
  white-space: nowrap;
  line-height: 1;
  position: relative;
  overflow: hidden;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.btn:active {
  transform: translateY(1px);
}

/* Primary — gold fill */
.btn-primary {
  background-color: var(--color-sunrise-gold);
  color: #ffffff;
  border-color: var(--color-sunrise-gold);
}
.btn-primary:hover {
  background-color: #c07a10;
  border-color: #c07a10;
  color: #ffffff;
  box-shadow: 0 4px 16px rgb(212 137 26 / 0.35);
}

/* Secondary — outline forest */
.btn-secondary {
  background-color: transparent;
  color: var(--color-deep-forest);
  border-color: var(--color-deep-forest);
}
.btn-secondary:hover {
  background-color: var(--color-deep-forest);
  color: var(--color-warm-cream);
}

/* Ghost — outline gold */
.btn-ghost {
  background-color: transparent;
  color: var(--color-sunrise-gold);
  border-color: var(--color-sunrise-gold);
}
.btn-ghost:hover {
  background-color: var(--color-sunrise-gold);
  color: #ffffff;
}

/* White — for dark backgrounds */
.btn-white {
  background-color: #ffffff;
  color: var(--color-deep-forest);
  border-color: #ffffff;
}
.btn-white:hover {
  background-color: var(--color-warm-cream);
  color: var(--color-deep-forest);
}

/* Sizes */
.btn-sm {
  font-size: var(--text-xs);
  padding: 0.5rem 1.25rem;
}

.btn-lg {
  font-size: var(--text-md);
  padding: 1rem 2.5rem;
}

/* ==========================================================================
   CARD COMPONENT
   ========================================================================== */

.card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
}

.card__image {
  aspect-ratio: 4/3;
  overflow: hidden;
}
.card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.card:hover .card__image img {
  transform: scale(1.04);
}

.card__body {
  padding: var(--space-6);
}

.card__tag {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-accessible-gold);
  margin-bottom: var(--space-3);
}

.card__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-deep-forest);
  margin-bottom: var(--space-3);
  line-height: var(--leading-snug);
}

.card__excerpt {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
}

/* ==========================================================================
   BADGE / TAG
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  padding: 0.25rem 0.875rem;
  border-radius: var(--radius-full);
}

.badge-forest {
  background-color: var(--color-light-moss);
  color: var(--color-deep-forest);
}

.badge-gold {
  background-color: #FEF3E2;
  color: var(--color-accessible-gold);
}

/* ==========================================================================
   SECTION HEADERS
   ========================================================================== */

.section-header {
  margin-bottom: var(--space-12);
}

.section-header--center {
  text-align: center;
  max-width: 680px;
  margin-inline: auto;
  margin-bottom: var(--space-12);
}

.section-eyebrow {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-accessible-gold);
  margin-bottom: var(--space-3);
  display: block;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, var(--text-4xl));
  font-weight: var(--weight-bold);
  color: var(--color-deep-forest);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 60ch;
}

.section-header--center .section-subtitle {
  margin-inline: auto;
}

/* ==========================================================================
   DIVIDERS
   ========================================================================== */

.divider {
  width: 60px;
  height: 3px;
  background: var(--color-sunrise-gold);
  border-radius: var(--radius-full);
  margin-block: var(--space-4);
}

.divider--center {
  margin-inline: auto;
}

/* ==========================================================================
   SKIP LINK (ACCESSIBILITY)
   ========================================================================== */

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-toast);
  background: var(--color-deep-forest);
  color: var(--color-warm-cream);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: var(--space-4);
}

/* ==========================================================================
   SCREEN-READER ONLY
   ========================================================================== */

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

/* ==========================================================================
   ALIGNMENTS (WordPress)
   ========================================================================== */

.alignnone  { margin: var(--space-4) 0; }
.aligncenter { display: block; margin: var(--space-6) auto; text-align: center; }
.alignright  { float: right; margin: var(--space-4) 0 var(--space-4) var(--space-6); }
.alignleft   { float: left;  margin: var(--space-4) var(--space-6) var(--space-4) 0; }
.alignwide   { width: 100%; max-width: 100%; }
.alignfull   { width: 100vw; max-width: 100vw; margin-inline: calc(-50vw + 50%); }

/* ==========================================================================
   RESPONSIVE HELPERS
   ========================================================================== */

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .hide-mobile { display: none !important; }

  :root {
    --section-pad-y: var(--space-12);
  }
}

@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 390px) {
  .container {
    padding-inline: var(--space-4);
  }
  :root {
    --section-pad-y: var(--space-10);
  }
}
