/* ============================================================
   THE EDINBURGH DISCIPLINARIAN — Site Stylesheet
   Aesthetic: Warm, light, calm, trustworthy. Safe and sunlit.
   Layout idea: Edinburgh's closes and wynds — a quiet lane
   running beside the main thoroughfare, not a dead-centred column.
   Mobile-first. Fluid layout.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500&display=swap');

/* --- Variables --- */
:root {
  --bg:          #FDFCF9;   /* warm white page background */
  --surface:     #F5F0E8;   /* cards, panels — soft cream */
  --surface-alt: #EDE8DF;   /* slightly deeper cream for hover states */
  --border:      #DDD6CA;   /* warm light border */
  --accent:      #7A8C6E;   /* sage green — calm, trustworthy */
  --accent-mute: #5E6E55;   /* deeper sage — hover/active */
  --accent-warm: #B07355;   /* warm terracotta — secondary accent */
  --text:        #2E2A25;   /* dark warm brown — main body text */
  --text-mute:   #6B6158;   /* medium warm grey — secondary text */
  --text-faint:  #9E9489;   /* light warm grey — labels, timestamps */
  --white:       #FDFCF9;   /* used where true white is needed */
  --reading-w:   70ch;
  --content-w:   1200px;
  --rail-w:      200px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-sans:   'Open Sans', system-ui, sans-serif;
  --radius:      16px;
  --radius-sm:   10px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Page shell: header / main / footer as independent grid rows.
   Footer can never overlap content — rows size to their own content,
   not to a shrinkable flex sibling. */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.85;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

@media (min-width: 640px) {
  body { font-size: 17px; }
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-mute); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-warm); }

:focus-visible {
  outline: 2px solid var(--accent-warm);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- Header --- */
header {
  border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253,252,249,0.96);
  backdrop-filter: blur(8px);
}

@media (min-width: 640px) {
  header { padding: 0 2rem; }
}

.header-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

@media (min-width: 900px) {
  .header-inner { height: 70px; }
}

.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.site-logo img {
  height: 36px;
  width: auto;
  /* Make the logo dark for the light header background */
  filter: brightness(0) opacity(0.75);
}

@media (min-width: 640px) {
  .site-logo img { height: 42px; }
}

/* --- Hamburger (mobile) --- */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--text-mute);
  transition: all 0.3s;
  border-radius: 2px;
}

/* --- Nav: mobile first (hidden, toggled open) --- */
nav {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 1.5rem;
  gap: 1.25rem;
  z-index: 99;
  box-shadow: 0 8px 24px rgba(46,42,37,0.08);
}

nav.open { display: flex; }

/* --- Nav: desktop (always visible, inline) --- */
@media (min-width: 768px) {
  nav {
    display: flex;
    flex-direction: row;
    position: static;
    background: transparent;
    border: none;
    padding: 0;
    gap: 2rem;
    align-items: center;
    box-shadow: none;
  }

  .nav-toggle { display: none; }
}

nav a {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--text-mute);
  text-decoration: none;
  transition: color 0.2s;
  padding-bottom: 2px;
  border-bottom: 1.5px solid transparent;
}

nav a:hover,
nav a.active {
  color: var(--accent-mute);
  border-bottom-color: var(--accent);
}

/* --- Main (grid row 2, fills remaining space) --- */
main {
  width: 100%;
  min-width: 0;
}

/* --- Fullscreen Hero (home page only) --- */
.hero-fullscreen {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 480px;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center 40%;
  overflow: hidden;
}

@media (max-width: 640px) {
  .hero-fullscreen {
    background-position: 60% 40%;
  }
}

/* Light wash overlay — soft and airy rather than dark and dramatic */
.hero-fullscreen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(253,252,249,0.78) 0%,
    rgba(245,240,232,0.48) 55%,
    rgba(245,240,232,0.18) 100%
  );
}

.hero-fullscreen-inner {
  position: relative;
  z-index: 1;
  padding: 2rem 1.5rem;
  max-width: min(640px, 90vw);
  margin-left: 1.5rem;
}

@media (min-width: 640px) {
  .hero-fullscreen-inner { margin-left: max(2.5rem, 5vw); }
}

@media (min-width: 1100px) {
  .hero-fullscreen-inner { margin-left: max(5rem, 8vw); }
}

.hero-tag {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-mute);
  margin-bottom: 1.25rem;
  font-weight: 600;
  font-family: var(--font-sans);
}

.hero-fullscreen-inner h1 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.hero-fullscreen-inner .hero-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  color: var(--text-mute);
}

/* --- Home grid (bento layout with intentional size variation) --- */
.home-grid {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 4rem 1.25rem 5.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .home-grid { padding: 4.5rem 2rem 6rem; }
}

@media (min-width: 1000px) {
  .home-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "offer offer"
      "experience image"
      "need need"
      "discretion why";
    width: 90%;
    padding: 5rem 0 7rem;
    gap: 1.75rem;
  }

  .home-card-offer      { grid-area: offer; }
  .home-card-experience { grid-area: experience; }
  .home-card-image      { grid-area: image; }
  .home-card-need       { grid-area: need; }
  .home-card-discretion { grid-area: discretion; }
  .home-card-why        { grid-area: why; }
}

@media (min-width: 1100px) {
  .home-grid {
    width: 80%;
    padding: 6rem 0 8rem;
  }
}

.home-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5em;
}

@media (min-width: 640px) {
  .home-card { padding: 3em; }
}

@media (min-width: 1000px) {
  .home-card-offer,
  .home-card-need {
    padding: 3em 3.5em;
  }
}

.home-card h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.45rem;
}

@media (min-width: 640px) {
  .home-card h2 { font-size: 1.6rem; }
}

.home-card p:last-child { margin-bottom: 0; }

.home-card-image {
  display: none;
}

@media (min-width: 1000px) {
  .home-card-image {
    display: flex;
    padding: 0;
    min-height: 260px;
    background: none;
    border: none;
    align-items: center;
    justify-content: center;
  }
}

.home-card-image img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: var(--radius);
}


/* --- Page Hero (inner pages) --- */
.page-hero {
  position: relative;
  height: 40vh;
  min-height: 220px;
  max-height: 480px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

/* Soft light-to-transparent overlay — keeps image airy */
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(253,252,249,0.08) 0%,
    rgba(245,240,232,0.72) 100%
  );
}

.page-hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 1.75rem 1.25rem;
}

@media (min-width: 640px) {
  .page-hero-inner {
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 2.5rem 2rem;
  }
}

@media (min-width: 1100px) {
  .page-hero-inner { padding: 3rem 3rem; }
}

.page-hero-inner h1 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.08;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.page-hero-inner .subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-mute);
}

/* --- Page shell: rail + content (inner pages) ---
   An asymmetric layout instead of a dead-centred column: a slim
   "close" runs beside the main text with a vertical thread and a
   small utility — a nod to the closes and wynds hidden beside
   Edinburgh's main streets. */
.page-shell {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 3.5rem 1.25rem 6rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 640px) {
  .page-shell { padding: 4.5rem 2rem 7rem; }
}

@media (min-width: 1000px) {
  .page-shell {
    grid-template-columns: var(--rail-w) minmax(0, var(--reading-w));
    column-gap: 3.5rem;
    align-items: start;
  }
}

.page-rail {
  position: relative;
  padding-left: 1.25rem;
  order: -1;
}

.page-rail::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.35rem;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  opacity: 0.55;
}

@media (min-width: 1000px) {
  .page-rail { position: sticky; top: 6rem; align-self: start; }
}

.page-rail-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-mute);
  margin-bottom: 0.9rem;
}

.page-rail-note {
  font-size: 0.9rem;
  color: var(--text-mute);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.page-rail-note:last-child { margin-bottom: 0; }

.page-rail-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.page-rail-links a {
  font-size: 0.86rem;
  color: var(--text-mute);
  line-height: 1.4;
}

.page-rail-links a:hover { color: var(--accent-warm); }

.page-content-main { min-width: 0; }

/* --- Blog post main (reading width, with rail for meta) --- */
main.blog-post .page-shell {
  grid-template-columns: 1fr;
}

@media (min-width: 1000px) {
  main.blog-post .page-shell {
    grid-template-columns: var(--rail-w) minmax(0, var(--reading-w));
  }
}

/* --- Blog index main (wide) --- */
main.wide {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 3.5rem 1.25rem 6rem;
}

@media (min-width: 640px) {
  main.wide { padding: 4.5rem 2rem 7rem; }
}

/* --- Page header (text-only, blog posts) --- */
.page-header {
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.12;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.page-header .subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text-mute);
}

/* --- Typography --- */
h2 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 1.55rem;
  color: var(--text);
  margin: 2.75rem 0 1rem;
  line-height: 1.28;
  scroll-margin-top: 5.5rem;
}

@media (min-width: 640px) {
  h2 { font-size: 1.75rem; }
}

h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--accent-mute);
  margin: 2.25rem 0 0.6rem;
}

p { margin-bottom: 1.35rem; }
p:last-child { margin-bottom: 0; }

blockquote {
  border-left: 3px solid var(--accent);
  padding: 1.25rem 1.75rem;
  margin: 2.5rem 0;
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-mute);
}

/* --- Divider --- */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3.5rem 0;
}

/* --- Blog Index --- */
.blog-intro { margin-bottom: 3.5rem; }

.blog-social {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 3.5rem;
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-wrap: wrap;
}

@media (min-width: 640px) {
  .blog-social { padding: 1.75rem 2rem; }
}

.blog-social a {
  opacity: 0.75;
  transition: opacity 0.2s;
}

.blog-social a:hover { opacity: 1; }

.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

@media (min-width: 560px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.25rem;
  }
}

.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow 0.25s, transform 0.25s;
  overflow: hidden;
}

.blog-card:hover {
  box-shadow: 0 8px 32px rgba(46,42,37,0.10);
  transform: translateY(-4px);
}

.blog-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  filter: saturate(0.85) brightness(1.02);
  transition: filter 0.3s;
}

@media (min-width: 640px) {
  .blog-card-image { height: 200px; }
}

.blog-card:hover .blog-card-image { filter: saturate(1) brightness(1.04); }

.blog-card-body { padding: 1.5rem; }

@media (min-width: 640px) {
  .blog-card-body { padding: 1.75rem; }
}

.blog-card-date {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.blog-card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 0.75rem;
  display: block;
  text-decoration: none;
  transition: color 0.2s;
}

.blog-card-title:hover { color: var(--accent-mute); }

.blog-card-excerpt {
  font-size: 0.88rem;
  color: var(--text-mute);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.read-more {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-mute);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}

.read-more:hover { color: var(--accent-warm); border-color: var(--accent-warm); }

/* --- Blog Post --- */
.post-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 500;
}

.post-meta .post-date { color: var(--accent-mute); }

.post-hero-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  margin-bottom: 2.75rem;
  border-radius: var(--radius);
  filter: saturate(0.9) brightness(1.02);
}

.post-body { line-height: 1.9; }
.post-body p { margin-bottom: 1.5rem; }
.post-body h2 { margin-top: 3.25rem; }
.post-body em { font-family: var(--font-display); font-size: 1.05em; }

.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 4.5rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--border);
  gap: 1rem;
}

.post-nav a {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-mute);
  transition: color 0.2s;
  font-weight: 500;
}

.post-nav a:hover { color: var(--accent-mute); }

/* --- FAQ --- */
.faq-item {
  margin-bottom: 2.75rem;
  padding-bottom: 2.75rem;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 5.5rem;
}

.faq-item:last-child { border-bottom: none; }

.faq-question {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.85rem;
  line-height: 1.35;
}

.faq-answer { color: var(--text); }

/* --- Testimonials --- */
.testimonial {
  margin-bottom: 2.75rem;
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

@media (min-width: 640px) {
  .testimonial { padding: 2.25rem; }
}

.testimonial-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.06rem;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.testimonial-text p { margin-bottom: 1rem; }

.testimonial-attr {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-mute);
  font-weight: 500;
}

/* --- Contact --- */
.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

@media (min-width: 640px) {
  .contact-methods { gap: 1.5rem; }
}

.contact-method {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: box-shadow 0.2s, border-color 0.2s;
}

@media (min-width: 640px) {
  .contact-method {
    padding: 1.4rem 1.75rem;
    gap: 1.25rem;
  }
}

.contact-method:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(122,140,110,0.12);
}

.contact-method-label {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  min-width: 70px;
  font-weight: 500;
}

@media (min-width: 640px) {
  .contact-method-label { min-width: 80px; }
}

.contact-method-value { color: var(--text); }
.contact-method-value a { color: var(--accent-mute); }
.contact-method-value a:hover { color: var(--accent-warm); }

/* --- Footer --- */
footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 1.25rem;
  background: var(--surface);
}

@media (min-width: 640px) {
  footer { padding: 2.25rem 2rem; }
}

.footer-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-faint);
}

.footer-links {
  display: flex;
  gap: 1.75rem;
}

.footer-links a {
  font-size: 0.78rem;
  color: var(--text-faint);
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent-mute); }

/* --- Utility --- */
.text-accent { color: var(--accent-mute); }
.text-mute   { color: var(--text-mute); }
.italic      { font-style: italic; font-family: var(--font-display); }
