/* ==========================================================================
   BuyingCost.com.au — Modern Australian Design System
   Mobile-first, CSS custom properties, no framework
   ========================================================================== */

/* 1. Google Fonts Import
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&family=Source+Sans+3:wght@400;600&display=swap');

/* 2. Custom Properties
   ========================================================================== */
:root {
  /* Colour tokens */
  --color-forest: #2c3e2d;
  --color-eucalyptus: #5a7d5e;
  --color-leaf: #4a6a4d;
  --color-sage: #7a8a7b;
  --color-sand: #f7f3ed;
  --color-sand-dark: #e8e0d4;
  --color-sand-light: #eee8dc;
  --color-white: #ffffff;
  --color-eucalyptus-tint: rgba(90, 125, 94, 0.08);
  --color-eucalyptus-light: rgba(90, 125, 94, 0.1);
  --color-border: #d4cfc5;

  /* Typography tokens */
  --font-serif: 'Libre Baskerville', Georgia, serif;
  --font-sans: 'Source Sans 3', -apple-system, sans-serif;
  --text-h1: clamp(1.75rem, 1.2rem + 2.5vw, 2.5rem);
  --text-h2: clamp(1.25rem, 1rem + 1.5vw, 1.75rem);
  --text-hero: clamp(2rem, 1.5rem + 3vw, 3rem);
  --text-body: clamp(0.9375rem, 0.875rem + 0.3vw, 1.0625rem);

  /* Spacing tokens */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-section: clamp(3rem, 2rem + 4vw, 6rem);

  /* Radius tokens */
  --radius-input: 8px;
  --radius-card: 10px;
  --radius-btn: 8px;
  --radius-disclaimer: 6px;
}

/* 3. Reset / Base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  color: var(--color-forest);
  background: var(--color-sand);
  line-height: 1.6;
}

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

/* 4. Typography
   ========================================================================== */
h1 {
  font-family: var(--font-serif);
  font-size: var(--text-h1);
  font-weight: 700;
  color: var(--color-forest);
  line-height: 1.3;
}

h2 {
  font-family: var(--font-serif);
  font-size: var(--text-h2);
  font-weight: 700;
  color: var(--color-forest);
}

h3,
h4,
h5,
h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--color-forest);
  line-height: 1.35;
}

.hero-number {
  font-family: var(--font-serif);
  font-size: var(--text-hero);
  font-weight: 700;
  color: var(--color-forest);
  line-height: 1.2;
}

.label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-eucalyptus);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.citation {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--color-sage);
}

/* 5. Layout
   ========================================================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

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

/* 6. Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-sand);
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border);
  transition: padding 0.2s ease, box-shadow 0.2s ease;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

.site-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-forest);
  text-decoration: none;
}

.site-name:hover {
  color: var(--color-eucalyptus);
}

.site-tagline {
  font-size: 0.8rem;
  color: var(--color-eucalyptus);
  display: none;
  margin-left: var(--space-sm);
}

@media (min-width: 768px) {
  .site-tagline {
    display: block;
  }
}

.site-header__brand {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
}

.nav {
  display: flex;
  gap: var(--space-md);
  font-size: 0.875rem;
  list-style: none;
}

.nav a,
.nav-link {
  color: var(--color-leaf);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav a:hover,
.nav-link:hover {
  color: var(--color-eucalyptus);
}

.nav-link.active {
  color: var(--color-eucalyptus);
  font-weight: 600;
}

/* Compact scroll state — applied via JS */
.site-header--compact {
  padding-top: 8px;
  padding-bottom: 8px;
  box-shadow: 0 1px 6px rgba(44, 62, 45, 0.08);
  height: 48px;
}

.site-header--compact .site-tagline {
  display: none;
}

/* 7. Disclaimer Banner
   ========================================================================== */
.disclaimer {
  background: var(--color-sand-light);
  padding: 10px 12px;
  border-radius: var(--radius-disclaimer);
  margin-bottom: var(--space-md);
  font-size: 11px;
  color: var(--color-sage);
  line-height: 1.5;
}

/* 8. Calculator Layout
   ========================================================================== */
.calc-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.calc-inputs {
  flex: 1;
}

.calc-results {
  flex: 1;
  background: var(--color-eucalyptus-tint);
  border-radius: var(--radius-card);
  padding: var(--space-md);
}

@media (min-width: 1024px) {
  .calc-wrapper {
    flex-direction: row;
  }
}

/* 9. Calculator Inputs
   ========================================================================== */
.calc-field {
  margin-bottom: var(--space-sm);
}

.calc-field__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-eucalyptus);
  margin-bottom: var(--space-xs);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.calc-field__input,
.calc-field__select {
  width: 100%;
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-input);
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--color-forest);
  transition: border-color 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.calc-field__input:focus,
.calc-field__select:focus {
  border-color: var(--color-eucalyptus);
  outline: none;
  box-shadow: 0 0 0 3px rgba(90, 125, 94, 0.12);
}

.calc-field__select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a7d5e' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* 10. Calculator Results
   ========================================================================== */
.calc-results__section {
  margin-bottom: var(--space-md);
}

.calc-results__total {
  font-family: var(--font-serif);
  font-size: var(--text-hero);
  font-weight: 700;
  color: var(--color-forest);
  line-height: 1.2;
}

.calc-results__line {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border);
}

.calc-results__line:last-child {
  border-bottom: none;
}

.calc-results__line-label {
  color: var(--color-leaf);
}

.calc-results__line-value {
  font-weight: 600;
  color: var(--color-forest);
}

/* 11. Key Numbers Grid
   ========================================================================== */
.key-numbers {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .key-numbers {
    grid-template-columns: 1fr 1fr;
  }
}

.key-number-card {
  background: var(--color-eucalyptus-tint);
  border-radius: var(--radius-card);
  padding: var(--space-md);
}

@media (min-width: 768px) {
  .key-number-card {
    padding: var(--space-lg);
  }
}

.key-number-card__label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-eucalyptus);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
}

.key-number-card__value {
  font-family: var(--font-serif);
  font-size: var(--text-hero);
  font-weight: 700;
  color: var(--color-forest);
  line-height: 1.2;
}

.key-number-card__subtitle {
  font-size: 13px;
  color: var(--color-leaf);
  margin-top: var(--space-xs);
}

/* 12. Ad Slots
   ========================================================================== */
.ad-slot {
  background: var(--color-sand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--space-lg) 0;
  border-radius: var(--radius-card);
  overflow: hidden;
}

.ad-slot__label {
  font-size: 10px;
  color: var(--color-sage);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ad-slot--leaderboard {
  min-height: 50px;
  width: 100%;
}

@media (min-width: 768px) {
  .ad-slot--leaderboard {
    min-height: 90px;
  }
}

.ad-slot--rectangle {
  min-height: 250px;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

/* 13. Suburb Grid
   ========================================================================== */
.suburb-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .suburb-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .suburb-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.suburb-card {
  background: var(--color-white);
  border-radius: var(--radius-card);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  text-decoration: none;
  color: var(--color-forest);
  display: block;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.suburb-card:hover {
  border-color: var(--color-eucalyptus);
  box-shadow: 0 2px 12px rgba(44, 62, 45, 0.08);
}

.suburb-card__name {
  font-family: var(--font-serif);
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.suburb-card__meta {
  font-size: 13px;
  color: var(--color-sage);
}

/* 14. Buttons
   ========================================================================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-eucalyptus);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-btn);
  padding: 12px 24px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s ease;
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--color-eucalyptus);
  border: 2px solid var(--color-eucalyptus);
  border-radius: var(--radius-btn);
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
}

.btn-secondary:hover {
  background: var(--color-eucalyptus-tint);
}

/* 15. Assumptions Panel
   ========================================================================== */
.assumptions {
  margin-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.assumptions-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  cursor: pointer;
  font-weight: 600;
  color: var(--color-eucalyptus);
  user-select: none;
  list-style: none;
  border: none;
  background: none;
  width: 100%;
  font-family: var(--font-sans);
  font-size: var(--text-body);
}

.assumptions-toggle::after {
  content: "▼";
  font-size: 10px;
  transition: transform 0.2s ease;
  display: inline-block;
}

.assumptions.expanded .assumptions-toggle::after {
  transform: rotate(180deg);
}

.assumptions__content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.assumptions.expanded .assumptions__content {
  max-height: 500px;
}

/* 16. Breadcrumbs
   ========================================================================== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 13px;
  color: var(--color-sage);
  margin-bottom: var(--space-md);
  list-style: none;
  align-items: center;
}

.breadcrumb a {
  color: var(--color-eucalyptus);
  text-decoration: none;
  transition: color 0.15s ease;
}

.breadcrumb a:hover {
  color: var(--color-leaf);
  text-decoration: underline;
}

.breadcrumb__separator {
  color: var(--color-sage);
  user-select: none;
}

.breadcrumb__separator::before {
  content: "›";
}

/* 17. Postcode Found
   ========================================================================== */
.postcode-found {
  padding: 10px 14px;
  background: var(--color-eucalyptus-light);
  border-radius: var(--radius-input);
  margin-top: var(--space-sm);
  display: none;
}

.postcode-found.visible {
  display: block;
}

.postcode-found__name {
  font-weight: 600;
  color: var(--color-eucalyptus);
  font-size: 12px;
}

.postcode-found__meta {
  font-size: 12px;
  color: var(--color-sage);
}

/* 18. Footer
   ========================================================================== */
.site-footer {
  background: var(--color-sand-dark);
  padding: var(--space-xl) 0;
  margin-top: var(--space-section);
}

.site-footer__disclaimer {
  font-size: 11px;
  color: var(--color-sage);
  margin-bottom: var(--space-md);
  line-height: 1.6;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: 14px;
  list-style: none;
}

.site-footer__nav a {
  color: var(--color-leaf);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-footer__nav a:hover {
  color: var(--color-eucalyptus);
}

.site-footer__copy {
  font-size: 12px;
  color: var(--color-sage);
  margin-top: var(--space-lg);
}

/* 19. Mobile Sticky Results
   ========================================================================== */
.calc-results-sticky {
  display: none;
}

@media (max-width: 767px) {
  .calc-results-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--color-white);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    padding: var(--space-sm) var(--space-md);
    display: flex;
    justify-content: space-around;
  }

  body.has-sticky-results {
    padding-bottom: 72px;
  }
}

.calc-results-sticky__item {
  text-align: center;
}

.calc-results-sticky__label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  color: var(--color-eucalyptus);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: block;
}

.calc-results-sticky__value {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-forest);
  display: block;
}

/* 20. Rate Sources
   ========================================================================== */
.rate-sources {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.rate-sources__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-eucalyptus);
  margin-bottom: var(--space-sm);
}

.rate-sources__item {
  font-size: 12px;
  color: var(--color-sage);
  margin-bottom: 4px;
}

.rate-sources__item a {
  color: var(--color-eucalyptus);
  text-decoration: none;
  transition: text-decoration 0.15s ease;
}

.rate-sources__item a:hover {
  text-decoration: underline;
}

/* 21. Guide-specific
   ========================================================================== */
.guide-content {
  max-width: 720px;
}

.guide-content h2 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

.guide-content p {
  margin-bottom: var(--space-md);
}

.guide-content ul,
.guide-content ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

.guide-content li {
  margin-bottom: var(--space-xs);
}

.toc {
  background: var(--color-sand-light);
  border-radius: var(--radius-card);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
}

.toc__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-forest);
  margin-bottom: var(--space-sm);
}

.toc__link {
  display: block;
  padding: 4px 0;
  color: var(--color-eucalyptus);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s ease;
}

.toc__link:hover {
  color: var(--color-leaf);
  text-decoration: underline;
}
