/*
Theme Name:        Alex Marroig
Theme URI:         https://alexmarroig.com
Author:            Alex Marroig
Author URI:        https://alexmarroig.com
Description:       Custom standalone classic theme for Alex Marroig — Asesoría Inmobiliaria y Legal en Palma de Mallorca. Editorial, brand-led; pages built with PHP templates + ACF Pro + plain CSS. No page builder, no block theme, no Site Editor.
Version:           0.1.0
Requires at least: 6.5
Tested up to:      7.0
Requires PHP:      8.1
License:           GPL-2.0-or-later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       alexmarroig
*/

/* =============================================================
   :root design tokens — brand palette, typography, spacing.
   Values ported 1-to-1 from docs/mockups/styles.css; renamed
   per .claude/skills/alexmarroig-css-system (no accents in
   custom property names, 8pt spacing grid with --space-N,
   t-shirt sizes for type, --container-padding, mobile-first).
   ============================================================= */

:root {
  /* ---------- Brand palette (brandbook p.41 + crema clara extension) ---------- */
  --color-mares-claro:   #DEDBCC;   /* warm sand — primary background */
  --color-tierra-oscura: #34322A;   /* primary text + dark sections */
  --color-arcilla:       #834030;   /* primary accent + CTAs */
  --color-arcilla-hover: #6B3527;   /* darker arcilla — :hover state for primary CTA (from mockup) */
  --color-duna:          #CCA183;   /* secondary accent */
  --color-crema-clara:   #F5F1E8;   /* airier alternate background */
  --color-white:         #FFFFFF;

  /* ---------- Semantic aliases ---------- */
  --bg-page:      var(--color-mares-claro);
  --bg-soft:      var(--color-crema-clara);
  --bg-dark:      var(--color-tierra-oscura);
  --text-primary: var(--color-tierra-oscura);
  --text-on-dark: var(--color-mares-claro);
  --accent:       var(--color-arcilla);
  --accent-hover: var(--color-arcilla-hover);
  --accent-soft:  var(--color-duna);
  --rule:         rgba(52, 50, 42, 0.18);

  /* ---------- Type families ---------- */
  --font-display: 'Funnel Display', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body:    'Lora', Georgia, 'Times New Roman', serif;

  /* ---------- Type scale (mockup values preserved; t-shirt names) ---------- */
  --fs-xs:   0.75rem;                              /* 12px — labels, eyebrows */
  --fs-sm:   0.8125rem;                            /* 13px — small text */
  --fs-base: 1.0625rem;                            /* 17px — body */
  --fs-lg:   1.1875rem;                            /* 19px — lead */
  --fs-xl:   1.375rem;                             /* 22px — small headings (h4, step titles) */
  --fs-2xl:  clamp(1.375rem, 2vw, 1.75rem);        /* 22→28px — h3 (fluid) */
  --fs-3xl:  clamp(2rem, 3.6vw, 3rem);             /* 32→48px — h2 (fluid) */
  --fs-5xl:  clamp(2.5rem, 5.5vw, 5rem);           /* 40→80px — h1 (fluid) */

  /* ---------- Line heights ---------- */
  --lh-tight:   1.1;
  --lh-snug:    1.3;
  --lh-normal:  1.5;
  --lh-relaxed: 1.65;

  /* ---------- Spacing (8pt grid; mockup values, t-shirt names) ---------- */
  --space-1:  0.25rem;   /*   4px */
  --space-2:  0.5rem;    /*   8px */
  --space-3:  0.75rem;   /*  12px */
  --space-4:  1rem;      /*  16px */
  --space-6:  1.5rem;    /*  24px */
  --space-8:  2rem;      /*  32px */
  --space-12: 3rem;      /*  48px */
  --space-16: 4rem;      /*  64px */
  --space-24: 6rem;      /*  96px */
  --space-32: 8rem;      /* 128px */

  /* ---------- Layout ---------- */
  --container-max:     1280px;
  --container-padding: clamp(1.5rem, 6vw, 6rem);
  --header-h:          88px;
  --header-h-shrunk:   64px;

  /* ---------- Breakpoints (reference only; used in media queries) ---------- */
  --bp-tablet:  768px;
  --bp-desktop: 1024px;
  --bp-wide:    1440px;

  /* ---------- Radii (editorial, square-ish) ---------- */
  --radius-sm: 2px;
  --radius-md: 4px;

  /* ---------- Transitions ---------- */
  --transition-fast:   150ms ease;
  --transition-normal: 250ms ease;
}

/* =============================================================
   Minimal reset.
   ============================================================= */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button, input, select, textarea { font: inherit; color: inherit; }

/* Skip-link kept off-screen until focused (a11y). */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--bg-dark);
  color: var(--text-on-dark);
}
.skip-link:focus { left: var(--space-4); top: var(--space-4); }

/* Screen-reader-only utility. */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px; width: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  word-wrap: normal !important;
}

/* =============================================================
   Base typography.
   ============================================================= */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-6);
  letter-spacing: -0.01em;
  line-height: var(--lh-tight);
}
h1 { font-size: var(--fs-5xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); font-weight: 600; line-height: var(--lh-snug); }
h4 { font-size: var(--fs-xl);  font-weight: 500; line-height: var(--lh-snug); }
h5 { font-size: var(--fs-lg);  font-weight: 500; }
h6 { font-size: var(--fs-base); font-weight: 500; }

p { margin: 0 0 var(--space-6); max-width: 65ch; }

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
a:hover,
a:focus-visible { color: var(--accent); border-color: var(--accent); }

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

/* =============================================================
   Layout helpers (used by every page).
   ============================================================= */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.section {
  padding-top: clamp(var(--space-12), 8vw, var(--space-24));
  padding-bottom: clamp(var(--space-12), 8vw, var(--space-24));
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 500;
  /* Explicit line-height so the visual height stays constant whether
     the .eyebrow class is applied to a <p>, an <h1>, or an <h2> —
     hN tags carry a much tighter default line-height that would
     otherwise compress the box. */
  line-height: var(--lh-relaxed);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--space-4);
  padding-bottom: 6px;
  border-bottom: 1px solid currentColor;
}

/* Display text — typography of a heading, semantics of a paragraph.
   Use on <p> elements that look like the H2 they used to be, but no
   longer act as a heading for SEO / a11y outline (e.g. editorial
   "lede" titles inside narrative / image+text / services blocks).
   Each block can override font-size via its own BEM class. */
.display-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-3xl);          /* default = former h2 size */
  letter-spacing: -0.01em;
  line-height: var(--lh-tight);
  color: var(--text-primary);
  margin: 0 0 var(--space-6);
  max-width: none;
}

.lead {
  font-family: var(--font-body);
  font-size: var(--fs-lg);
  line-height: var(--lh-normal);
  max-width: 60ch;
}

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