/* =========================================================
   YSL Consulting inc. — main stylesheet
   Mobile-first. Edit the variables below to retheme the site.
   ========================================================= */

/* ---------- Fonts (self-hosted, latin subset; SIL Open Font License) ---------- */
@font-face {
  font-family: 'Damion';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/damion-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/playfair-display-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/source-sans-pro-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/source-sans-pro-700-latin.woff2") format("woff2");
}

:root {
  /* Colours (taken from the original site) */
  --color-primary: #0075c1;          /* brand blue: Services band, buttons, links */
  --color-primary-dark: #004271;
  --color-primary-light: #008fea;    /* rule under "Services" */
  --color-heading: #151515;
  --color-text: #575757;
  --color-white: #fff;
  --color-alt-bg: #f5f5f5;           /* Contact section */
  --color-footer-bg: #161616;
  --color-footer-text: #a9a9a9;
  --color-rule: #e2e2e2;
  --color-border: #dadada;

  /* Blue tint over the header photo (darkened from the original 25% so the
     white headline stays readable on the light parts of the photo) */
  --hero-overlay: linear-gradient(rgba(0, 66, 113, .45), rgba(0, 66, 113, .45));

  /* Header height (the original was the full screen, 100vh) */
  --hero-height: 70vh;
  --hero-min-height: 460px;

  /* Typography */
  --font-logo: 'Damion', Georgia, serif;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Sans Pro', Arial, sans-serif;

  /* Layout */
  --container: 1160px;
  --gutter: 24px;
  --section-pad: 56px;

  /* Type scale (matches the original theme; bumped at 768/1280/1536px below) */
  --fs-logo: 36px;
  --fs-tagline: 46px;
  --fs-section-title: 37px;
  --fs-lead: 25px;        /* Welcome paragraph text */
  --fs-card-title: 25px;  /* service / team / contact headings */
  --fs-text: 18px;        /* regular body copy */
  --fs-small: 16px;       /* buttons, footer */
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-white);
}

img { display: block; max-width: 100%; height: auto; }
picture { display: block; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0 0 1.5em; }
p:last-child { margin-bottom: 0; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: max(var(--hero-height), var(--hero-min-height));
  padding: 24px var(--gutter) 56px;
  text-align: center;
  color: var(--color-white);
  background-color: var(--color-primary-dark);
  /* phones: 1280px photo; WebP where supported, JPEG otherwise */
  background-image: var(--hero-overlay), url("../assets/img/hero-1280.jpg");
  background-image: var(--hero-overlay), image-set(
    url("../assets/img/hero-1280.webp") type("image/webp"),
    url("../assets/img/hero-1280.jpg") type("image/jpeg"));
  background-size: cover;
  background-position: center;
}

.hero__logo {
  font-family: var(--font-logo);
  font-size: var(--fs-logo);
  line-height: 1.2;
  color: var(--color-white);
}
.hero__logo:hover { text-decoration: none; }

/* centres the tagline and button vertically in the space below the logo */
.hero__content { margin: auto 0; }

.hero__tagline {
  font-family: var(--font-heading);
  font-size: var(--fs-tagline);
  line-height: 1.2;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}

.hero__cta { margin-top: 32px; }

/* ---------- Sections ---------- */
.section { padding: var(--section-pad) 0; }

.section--primary {
  background: var(--color-primary);
  color: var(--color-white);
}

.section--alt { background: var(--color-alt-bg); }

.section__title {
  font-family: var(--font-heading);
  font-size: var(--fs-section-title);
  line-height: 1.25;
  text-align: center;
  margin-bottom: 40px;
}
/* short horizontal rule under section titles */
.section__title::after {
  content: "";
  display: block;
  width: 50px;
  height: 1px;
  margin: 24px auto 0;
  background: var(--color-rule);
}
.section--primary .section__title::after { background: var(--color-primary-light); }
.section__title--accent { color: var(--color-primary); }

/* ---------- Split layout (Welcome / Contact) ---------- */
.split {
  display: grid;
  gap: 40px;
}
.split__media img { width: 100%; }

.welcome__title {
  font-family: var(--font-heading);
  font-size: var(--fs-section-title);
  line-height: 1.25;
  color: var(--color-heading);
  margin-bottom: 16px;
}
.welcome .split__body { font-size: var(--fs-lead); line-height: 1.5; }

/* ---------- Cards (Services / About) ---------- */
.cards {
  display: grid;
  gap: 48px;
}

.card { text-align: center; }

.card__img {
  width: 100%;
  max-width: 338px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 24px;
}

.card__title {
  font-family: var(--font-body);
  font-size: var(--fs-card-title);
  line-height: 1.25;
  color: var(--color-heading);
  margin-bottom: 24px;
}
.section--primary .card__title { color: var(--color-white); }

.card__text { font-size: var(--fs-text); line-height: 1.5; }
.card--team .card__text { color: var(--color-text); }

.section--primary .card__text p { margin-bottom: 1em; }
.section--primary .card__text p:last-child { margin-bottom: 0; }

/* "Show More / Show Less" toggle (enabled by main.js) */
.expandable.is-collapsible { position: relative; overflow: hidden; }
.expandable.is-collapsed {
  max-height: calc(1.5em * 9);
  -webkit-mask-image: linear-gradient(to bottom, #000 75%, transparent);
          mask-image: linear-gradient(to bottom, #000 75%, transparent);
}

.expand-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: var(--fs-text);
  cursor: pointer;
}
.expand-toggle:hover { text-decoration: underline; }
.expand-toggle svg { width: 1em; height: 1em; }

/* ---------- Contact ---------- */
.contact__intro { font-size: var(--fs-text); line-height: 1.5; margin-bottom: 40px; }

.contact__name {
  font-family: var(--font-body);
  font-size: var(--fs-card-title);
  line-height: 1.25;
  color: var(--color-heading);
  margin-bottom: 24px;
}

.contact__links { font-size: var(--fs-text); margin-bottom: 16px; }
.contact__social { margin-bottom: 40px; }

/* ---------- LinkedIn links ---------- */
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-text);
}
.social-link svg { width: 20px; height: 20px; flex: none; }
.card--team .card__text { margin-bottom: 0; }
.card--team .social-link { margin-top: 16px; }

/* text for screen readers only */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.btn {
  display: inline-block;
  padding: 16px 32px;
  border: 0;
  border-radius: 4px;
  background: var(--color-primary);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: .071em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn:hover { background: var(--color-primary-dark); text-decoration: none; }

/* white button for use on the blue header photo */
.btn--light {
  background: var(--color-white);
  color: var(--color-primary);
}
.btn--light:hover { background: var(--color-alt-bg); color: var(--color-primary-dark); }
.btn--light:focus-visible { outline-color: var(--color-white); }
.btn:focus-visible,
.btn-link:focus-visible,
.expand-toggle:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.section--primary .expand-toggle:focus-visible { outline-color: var(--color-white); }

.contact-form__title {
  font-family: var(--font-body);
  font-size: var(--fs-card-title);
  color: var(--color-heading);
  margin-bottom: 24px;
}

.field { display: block; margin-bottom: 16px; }
.field__label {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}
.field input,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-white);
  color: var(--color-heading);
  font: inherit;
  font-size: 16px;
}
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--color-primary); }
.field textarea { resize: vertical; min-height: 120px; }

.contact-form__controls {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 8px;
}

.btn-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-primary);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}
.btn-link:hover { text-decoration: underline; }

/* ---------- 404 page ---------- */
.hero--compact {
  min-height: 0;
  padding: 24px var(--gutter);
}

/* keep the footer at the bottom of the window on short pages */
.page-404 {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.page-404 main { flex: 1; }

.not-found { text-align: center; }

.not-found__code {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 96px;
  line-height: 1;
  color: var(--color-rule);
}

.not-found__text {
  max-width: 560px;
  margin: 0 auto 24px;
  font-size: var(--fs-text);
}

.not-found__actions { margin: 32px 0 40px; }

/* ---------- Footer ---------- */
.footer {
  padding: 56px 0;
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  font-size: var(--fs-small);
  text-align: center;
}

/* original logo beside the copyright, on a white card so the dark blue reads on the dark footer */
.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.footer__logo {
  flex: none;
  width: 68px;
  height: auto;
  padding: 5px 7px;
  border-radius: 4px;
  background: var(--color-white);
  box-sizing: content-box;
}

/* =========================================================
   Tablet and up
   ========================================================= */
@media (min-width: 768px) {
  :root {
    --fs-logo: 40px;
    --fs-tagline: 55px;
    --fs-section-title: 44px;
  }

  /* tablets and desktops: full-size 1920px header photo */
  .hero {
    background-image: var(--hero-overlay), url("../assets/img/hero.jpg");
    background-image: var(--hero-overlay), image-set(
      url("../assets/img/hero-1920.webp") type("image/webp"),
      url("../assets/img/hero.jpg") type("image/jpeg"));
  }

  .split { grid-template-columns: 1fr 1fr; gap: 48px; }
  .welcome .split__body { padding-top: 24px; }

  .cards--2 { grid-template-columns: repeat(2, minmax(0, 338px)); justify-content: center; gap: 48px; }
  .footer { text-align: left; }
  .footer__inner { flex-direction: row; }
}

/* =========================================================
   Desktop
   ========================================================= */
@media (min-width: 1024px) {
  .cards--3 { grid-template-columns: repeat(3, 1fr); gap: 48px; }
}

@media (min-width: 1280px) {
  :root {
    --fs-tagline: 71px;
    --fs-section-title: 51px;
  }
}

/* Large screens */
@media (min-width: 1536px) {
  :root {
    --fs-logo: 44px;
    --fs-tagline: 74px;
    --fs-section-title: 55px;
    --fs-lead: 28px;
    --fs-card-title: 28px;
    --fs-text: 21px;
    --fs-small: 18px;
  }
}
