/* ==========================================================================
   Amigo Behaviour — main stylesheet
   Design tokens, base, layout, components, responsive rules.
   ========================================================================== */

:root {
  /* Colour palette */
  --color-bg: #F5F1EC;
  --color-text: #1F1F1F;
  --color-accent: #8B9B7A;
  --color-accent-hover-bg: #7D8B6D;   /* button hover fill — darker sage, still AA-safe under dark text */
  --color-accent-text: #454D3D;        /* sage-family text on light backgrounds — ~7.8:1 contrast */
  --color-taupe: #C9BDB0;
  --color-brown: #3B2F27;
  --color-white: #FFFFFF;

  /* Typography */
  --lh-body: 1.7;

  /* Layout */
  --max-width: 1200px;
  --header-height: 64px;
  --header-height-mobile: 56px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
main section[id] { scroll-margin-top: var(--header-height); }
@media (max-width: 768px) {
  main section[id] { scroll-margin-top: var(--header-height-mobile); }
}
a { color: inherit; }
ul { margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; }

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

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

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--color-accent);
  color: var(--color-white);
  padding: 0.75rem 1.25rem;
  z-index: 200;
  transition: top 0.2s var(--ease);
}
.skip-link:focus {
  top: 1rem;
}

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

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-text);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  line-height: 1.2;
  max-width: 40ch;
  margin-bottom: 2.5rem;
  overflow-wrap: break-word;
  hyphens: auto;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 2.5rem;
}

@media (max-width: 768px) {
  .section-inner { padding: 3rem 1.25rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  border: none;
  padding: 1rem 2rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
  transition: background-color 0.25s var(--ease), transform 0.2s var(--ease);
}

.btn--primary {
  background: var(--color-accent);
  /* Dark text on sage gives ~5.5:1 contrast; white on sage only gives ~3:1. */
  color: var(--color-text);
}
.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--color-accent-hover-bg);
  transform: scale(1.02);
}

/* ---------- Fade-in on scroll ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Header / Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: var(--header-height);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .site-header__inner { height: var(--header-height-mobile); padding: 0 1.25rem; }
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--color-text);
  white-space: nowrap;
}

.primary-nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.primary-nav a {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.5rem 0.1rem;
  position: relative;
}
.primary-nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--color-accent);
  transition: right 0.25s var(--ease);
}
.primary-nav a:hover::after,
.primary-nav a:focus-visible::after,
.primary-nav a[aria-current]::after {
  right: 0;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.lang-toggle__btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem 0.25rem;
  min-height: 44px;
  color: var(--color-taupe);
}
.lang-toggle__btn.is-active {
  color: var(--color-accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .nav-toggle { display: flex; order: 3; }
  .lang-toggle { order: 2; }
  .logo { order: 1; }

  .primary-nav {
    order: 4;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s var(--ease);
  }
  .primary-nav.is-open { max-height: 400px; }
  .primary-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.25rem 1.5rem;
  }
  .primary-nav a {
    display: block;
    padding: 0.85rem 0;
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 640px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

@media (max-width: 480px) {
  .hero { min-height: 460px; }
}

.hero__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.hero__media img {
  /* The hero box is wider than the photo's native aspect ratio, so cover
     always shows the full width (only top/bottom get cropped) and
     object-position has no horizontal effect. Oversizing the image and
     pinning it to the left lets the right-hand (empty sky) portion run
     off the edge instead, shifting the subject away from the text. */
  position: absolute;
  top: 0;
  left: 0;
  width: 113%;
  max-width: none;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(31,31,31,0.25) 0%, rgba(31,31,31,0.55) 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2.5rem 5rem;
  width: 100%;
  color: var(--color-white);
}

@media (max-width: 768px) {
  .hero__content { padding: 0 1.25rem 3rem; }
}

@media (max-width: 480px) {
  /* Headline text wraps to near full width on narrow screens, so the
     horizontal image shift alone isn't enough — reserve a clear strip on
     the right for the subject and push the crop further to match. */
  .hero__content { padding-right: 22%; }
  .hero__media img { width: 165%; }
}

.hero__content h1 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.15;
  max-width: 16ch;
  margin-bottom: 2rem;
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* ==========================================================================
   Dividers
   ========================================================================== */
.divider {
  height: 220px;
  overflow: hidden;
}
.divider img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
@media (max-width: 768px) {
  .divider { height: 140px; }
}

/* ==========================================================================
   Philosophy
   ========================================================================== */
.philosophy__blocks {
  display: flex;
  flex-direction: column;
  gap: 3.75rem;
}

.philosophy__block {
  display: flex;
  align-items: center;
  gap: 4rem;
}
.philosophy__block--reverse {
  flex-direction: row-reverse;
}
.philosophy__image,
.philosophy__text {
  flex: 1 1 50%;
  min-width: 0;
}
.philosophy__image img {
  width: 100%;
  height: auto;
}
.philosophy__text h3 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(1.4rem, 2.5vw, 1.75rem);
  margin-bottom: 1rem;
}
.philosophy__text p {
  font-size: clamp(1rem, 1.5vw, 1.1rem);
  color: var(--color-text);
}

@media (max-width: 768px) {
  .philosophy__block,
  .philosophy__block--reverse {
    flex-direction: column;
    gap: 1.5rem;
  }
}

/* ==========================================================================
   Programmes
   ========================================================================== */
.programmes__note {
  font-weight: 600;
  color: var(--color-accent-text);
  margin-top: -1.5rem;
  margin-bottom: 3rem;
}

.programmes__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  margin-bottom: 4rem;
}

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

.programme-card {
  background: var(--color-white);
  border-radius: 2px;
  box-shadow: 0 4px 18px rgba(31, 31, 31, 0.06);
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.programme-card:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 28px rgba(31, 31, 31, 0.12);
}
.programme-card__image {
  height: 260px;
  overflow: hidden;
}
.programme-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.programme-card__body {
  padding: 1.5rem 1.5rem 1.75rem;
}
.programme-card__body h3 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.programme-card__body > p {
  color: var(--color-text);
  margin-bottom: 1.1rem;
}

.focus-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
}
.focus-list li {
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--color-accent-text);
  background: rgba(139, 155, 122, 0.12);
  padding: 0.3rem 0.6rem;
  border-radius: 2px;
}

.formats-heading {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  margin-bottom: 2rem;
}

.formats__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}
@media (max-width: 768px) {
  .formats__grid { grid-template-columns: 1fr; }
}

.format-card {
  border: 1px solid var(--color-taupe);
  padding: 2rem 1.75rem;
}
.format-card h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.15rem;
  margin: 0.4rem 0 0.75rem;
}
.format-card__price {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  color: var(--color-accent-text);
}
.format-card__unit {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-text);
}
.format-card > p:last-child {
  font-size: 0.95rem;
}

/* ==========================================================================
   Prices
   ========================================================================== */
.formats__grid--prices .format-card__price {
  margin: 0.5rem 0;
}
.prices__note {
  max-width: 60ch;
  margin-top: 2.5rem;
  color: var(--color-accent-text);
  font-size: 0.95rem;
}

/* ==========================================================================
   About
   ========================================================================== */
.about__inner {
  display: flex;
  align-items: flex-start;
  gap: 4rem;
}
.about__image {
  flex: 0 0 auto;
  width: 100%;
  max-width: 400px;
}
.about__image img {
  border-radius: 2px;
  width: 100%;
  height: auto;
}
.about__text {
  flex: 1 1 auto;
  max-width: 700px;
}
.about__text p {
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

@media (max-width: 768px) {
  .about__inner { flex-direction: column; gap: 2rem; }
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact {
  background: var(--color-taupe);
  background: color-mix(in srgb, var(--color-taupe) 35%, var(--color-bg));
}
.contact__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 4rem;
}
@media (max-width: 768px) {
  .contact__inner { grid-template-columns: 1fr; gap: 2.5rem; }
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.5rem;
  margin-top: 2rem;
}
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field--full { grid-column: 1 / -1; }

@media (max-width: 560px) {
  .contact-form { grid-template-columns: 1fr; }
}

.field label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.field input,
.field select,
.field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--color-taupe);
  background: var(--color-white);
  border-radius: 2px;
  min-height: 44px;
}
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  border-color: var(--color-accent);
}
.field textarea { resize: vertical; }

.form-status {
  grid-column: 1 / -1;
  font-weight: 600;
  min-height: 1.5em;
}
.form-status.is-success { color: var(--color-accent-text); }
.form-status.is-error { color: #a3453b; }

.contact__info-col {
  margin-top: 2rem;
}
.contact__info-col p {
  margin-bottom: 1.1rem;
}
.contact__info-col a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--color-brown);
  color: var(--color-bg);
  text-align: center;
  padding: 3rem 1.5rem;
}
.site-footer__copyright {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
.site-footer__tagline {
  font-size: 0.85rem;
  opacity: 0.75;
  max-width: 40ch;
  margin: 0 auto;
}
