/* Global shared styles for landing pages */

:root {
  --fn-mint: #88c4bc;
  --fn-neon: #88C4BC;
  --fn-black: #1d1d1b;
  --fn-white: #ffffff;
  --fn-bg: #fcfcfd;
  --fn-text: #1d1d1b;
  --fn-text-muted: rgba(29, 29, 27, 0.72);
  --fn-radius: 10px;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background: var(--fn-bg);
  color: var(--fn-text);
  overflow-x: hidden;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

/* Simple, consistent focus ring */
*:focus-visible {
  outline: 2px solid var(--fn-mint);
  outline-offset: 2px;
}

/* Consistent hero base across all pages */
.hero {
  padding: 8rem 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

@media (max-width: 767px) {
  .hero {
    padding: 30px 0;
  }
}

/* Utility: hide until JS enhancement (optional) */
.js-only {
  display: none;
}

html.js .js-only {
  display: initial;
}

/* === Mobile spacing baseline ===
   Shrinks --fn-space-* tokens used by most landing pages so section
   padding, container padding and gaps tighten on phones/tablets.
   :root:root specificity (0,0,2) beats the per-page inline :root (0,0,1),
   which is required because page <style> blocks load after this file. */
@media (max-width: 768px) {
  :root:root {
    --fn-space-xl: 2rem;     /* 3rem  → 2rem  */
    --fn-space-2xl: 2.5rem;  /* 4rem  → 2.5rem */
    --fn-space-3xl: 3.5rem;  /* 6rem  → 3.5rem */
    --fn-space-4xl: 5rem;    /* 8rem  → 5rem  */
    --section-padding: 3rem; /* pages using this var (robin-landingpage) shrink too */
  }
}

@media (max-width: 480px) {
  :root:root {
    --fn-space-md: 1rem;     /* 1.5rem → 1rem (tightens container side padding to 16px) */
    --fn-space-lg: 1.25rem;  /* 2rem   → 1.25rem */
    --fn-space-xl: 1.5rem;   /* 3rem   → 1.5rem */
    --fn-space-2xl: 2rem;    /* 4rem   → 2rem */
    --fn-space-3xl: 2.5rem;  /* 6rem   → 2.5rem */
    --fn-space-4xl: 3rem;    /* 8rem   → 3rem (hero/section vertical padding) */
    --section-padding: 2.5rem;
  }
}

/* Utility: keep face/subject pinned at the top when an image's aspect
   ratio gets shorter than the source (common on mobile crops). Apply
   to the wrapper div; the inner <img> picks it up. */
.fn-obj-top img,
img.fn-obj-top { object-position: top !important; }
.fn-obj-bottom img,
img.fn-obj-bottom { object-position: bottom !important; }

/* Utility: full-bleed on mobile. Add to any wrapper that should escape
   container padding on ≤768px and stretch edge-to-edge. Strips its
   max-width, side padding, border-radius, and child image radius. */
@media (max-width: 768px) {
  .fn-bleed-mobile {
    max-width: none !important;
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border-radius: 0 !important;
  }
  .fn-bleed-mobile > img,
  .fn-bleed-mobile > picture > img,
  .fn-bleed-mobile > .section-img {
    width: 100% !important;
    height: auto !important;
    border-radius: 0 !important;
    display: block;
  }
}

/* === Mobile spacing — defensive baseline for pages that don't use --fn-space tokens.
   `body …` boosts specificity (0,0,0,2) to beat per-page `section` rules (0,0,0,1).
   Only kicks in below 480px so tablet/desktop are untouched. */
@media (max-width: 480px) {
  body section,
  body .section {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }
  body .container {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Mobile peek slider — add class .grid-4--slider and attribute
   data-slider-autoscroll to any card grid. Below 768px the grid becomes
   a horizontal scroll-snap row with the next card partly visible. JS in
   common.js auto-advances every 4s while the slider is in viewport. */
@media (max-width: 768px) {
  .grid-4--slider {
    display: flex !important;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: var(--fn-space-md, 1.5rem);
    padding: var(--fn-space-xs, 0.5rem) calc(50% - 42.5%);
    margin-left: calc(-1 * var(--fn-space-md, 1.5rem));
    margin-right: calc(-1 * var(--fn-space-md, 1.5rem));
  }
  .grid-4--slider::-webkit-scrollbar { display: none; }
  .grid-4--slider > * {
    flex: 0 0 85%;
    scroll-snap-align: center;
  }
}
