/* =========================================================================
   La Fábrica · tokens.css
   --------------------------------------------------------------------------
   Design tokens for "La Fábrica" — a family-run artisanal turrón maker and
   summer terrace restaurant in Naval (Huesca, Aragón, Spain).

   The system carries a single brand umbrella with two geographic identities:
     · Pirineo Aragonés  → turrón ecommerce  (warm Albero / Dorado)
     · Somontano         → summer terrace    (Verde Sombra / sage)

   Authored as production-ready vanilla CSS. No frameworks, no preprocessors.
   Every choice is annotated so future maintainers can defend or evolve it.
   ========================================================================= */

/* --- Typography import -----------------------------------------------------
   Cormorant Garamond — display & headings.
     Chosen for its editorial, slightly archaic warmth. Old-style serifs with
     gentle bracket terminals echo the hand-cut lettering on Spanish food
     packaging and the Mudéjar craftsmanship the logo references. It is
     decidedly NOT clinical and pairs naturally with cursive script logotypes.
   Manrope — UI & body copy.
     A humanist geometric sans with open apertures and generous x-height.
     Holds up at 17–18px for the 40–70 audience and stays legible on small
     screens without feeling SaaS-y. Avoids Inter / Roboto / system fonts.
   --------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Manrope:wght@400;500;600;700&display=swap');

/* --- Reset (minimal, warm-defaults) --------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

/* =========================================================================
   :root — Design Tokens
   ========================================================================= */
:root {
  /* --- Raw palette ------------------------------------------------------- */
  /* The four mandatory anchor colors. Never rename these.
     Spanish names are preserved as part of the brand vocabulary.            */
  --palette-albero: #e1aa4c; /* Honey / wheat / warm sun on stone     */
  --palette-blanco: #ffffff; /* Clean white, the primary canvas       */
  --palette-dorado: #8d714c; /* Aged wood, leather, roasted almond    */
  --palette-rojo: #a30813; /* Logo red — sacred, used sparingly     */

  /* Albero tints & shades — derived for hovers, highlights, washes.
     Computed by mixing #E1AA4C toward white / black at 8–40% intervals.   */
  --palette-albero-50: #fdf7ea; /* whisper wash for selected rows      */
  --palette-albero-100: #faedcf; /* hover/selected backgrounds          */
  --palette-albero-200: #f2d699; /* gentle borders, focus rings         */
  --palette-albero-300: #ebc272; /* mid hover for primary CTAs          */
  --palette-albero-500: #e1aa4c; /* = albero base                       */
  --palette-albero-600: #c68f33; /* hover/active for primary buttons    */
  --palette-albero-700: #9b6e22; /* deep accent on cream                */

  /* Dorado scale — earthy warm gold for secondary text & borders.         */
  --palette-dorado-100: #efe6d7;
  --palette-dorado-200: #d9c7a8;
  --palette-dorado-400: #b89978;
  --palette-dorado-500: #8d714c; /* = dorado base                       */
  --palette-dorado-700: #5e4a30;
  --palette-dorado-900: #3a2d1c;

  /* Rojo — used only at full strength + a darker pressed state.            */
  --palette-rojo-base: #a30813;
  --palette-rojo-pressed: #7e0510;

  /* Verde Sombra — the Somontano green, derived from the terrace photos:
     vine leaves, pine-poplar valley, rosemary & olive in evening light.
     Muted, dusty, never neon. Sits comfortably beside Albero.              */
  --palette-verde-50: #f1f2ea;
  --palette-verde-100: #dfe3d2;
  --palette-verde-200: #bcc5a4;
  --palette-verde-400: #82906a;
  --palette-verde-500: #5f6e48; /* primary sage / Somontano accent     */
  --palette-verde-700: #3f4b2d;
  --palette-verde-900: #232b17; /* deep evening canopy                 */

  /* Warm neutrals — every grey leans beige/taupe. No cold #888s anywhere.  */
  --palette-tinta: #2a1f14; /* warm near-black for body text         */
  --palette-cafe: #4a3a28; /* secondary warm dark                   */
  --palette-piedra: #6b5c4a; /* warm grey-brown ("stone")             */
  --palette-arena: #a89580; /* warm muted ("sand")                   */
  --palette-cal: #e8e0d2; /* "lime wash" — soft warm divider       */
  --palette-crema: #faf6ee; /* cream wash for warm section bgs       */
  --palette-papel: #fbf8f2; /* paper-warm tint, lighter than crema   */

  /* Status — kept warm. We reuse the palette where possible.               */
  --palette-success: #6b8a4e;
  --palette-warning: #c68f33; /* = albero-600                           */
  --palette-danger: var(--palette-rojo-base);

  /* --- Semantic color roles ---------------------------------------------
     UIs reference these, NEVER raw palette tokens. Keeps theming honest.  */

  /* Surfaces */
  --color-bg: var(--palette-blanco); /* main canvas (always white) */
  --color-surface: var(--palette-blanco); /* cards & panels             */
  --color-surface-cream: var(--palette-crema); /* warm section backdrop      */
  --color-surface-paper: var(--palette-papel); /* faintest warm tint         */
  --color-surface-sage: var(--palette-verde-50); /* restaurant section bg      */
  --color-surface-dark: #1e1610; /* deep warm brown hero/footer*/
  --color-surface-forest: var(--palette-verde-900); /* restaurant dark hero       */

  /* Text */
  --color-text: var(--palette-tinta); /* body & default text        */
  --color-text-strong: #150e08; /* headings on light          */
  --color-text-muted: var(--palette-piedra); /* secondary, captions        */
  --color-text-quiet: var(--palette-arena); /* tertiary / metadata        */
  --color-text-on-dark: #f4ecdd; /* warm cream on dark surf    */
  --color-text-on-dark-muted: #bfae94; /* secondary on dark          */
  --color-text-link: var(--palette-dorado-700);

  /* Borders & dividers */
  --color-border: var(--palette-cal); /* default hairline           */
  --color-border-strong: var(--palette-dorado-200);
  --color-border-dark: rgba(244, 236, 221, 0.14);

  /* Accents */
  --color-primary: var(--palette-albero); /* turrón / brand accent */
  --color-primary-hover: var(--palette-albero-600);
  --color-primary-soft: var(--palette-albero-100);

  --color-accent: var(--palette-rojo-base); /* high-impact only      */
  --color-accent-hover: var(--palette-rojo-pressed);

  --color-secondary: var(--palette-dorado-500); /* heritage gold         */
  --color-secondary-hover: var(--palette-dorado-700);

  --color-restaurant: var(--palette-verde-500); /* Somontano sage        */
  --color-restaurant-hover: var(--palette-verde-700);
  --color-restaurant-soft: var(--palette-verde-50);

  /* Focus */
  --color-focus-ring: var(--palette-albero-300);

  /* --- Typography -------------------------------------------------------- */
  --font-display: 'Cormorant Garamond', 'Hoefler Text', 'Garamond', 'Times New Roman', serif;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Type scale — modular ratio ~1.2 (minor third).
     Body anchored at 17px on desktop / 16.5 on mobile (older audience).   */
  --text-xs: 0.75rem; /* 12 px — micro labels, legal                */
  --text-sm: 0.875rem; /* 14 px — meta, captions                     */
  --text-base: 1.0625rem; /* 17 px — body default                       */
  --text-md: 1.1875rem; /* 19 px — lead paragraph                     */
  --text-lg: 1.375rem; /* 22 px — sub-heading                        */
  --text-xl: 1.75rem; /* 28 px — h4 / card title                    */
  --text-2xl: 2.25rem; /* 36 px — h3                                 */
  --text-3xl: 3rem; /* 48 px — h2                                 */
  --text-4xl: 4rem; /* 64 px — h1 / hero                          */
  --text-5xl: 5.5rem; /* 88 px — display                            */

  /* Weights — Cormorant carries elegance at 500/600; bold can feel chunky */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Line heights — generous for readability of older audience.            */
  --leading-tight: 1.1; /* large headlines                           */
  --leading-snug: 1.25; /* sub-heads                                 */
  --leading-normal: 1.55; /* body                                      */
  --leading-relaxed: 1.7; /* long-form prose & older-eye comfort       */

  /* Letter-spacing — eyebrows/labels carry slight tracking.               */
  --tracking-tight: -0.015em;
  --tracking-normal: 0;
  --tracking-wide: 0.06em;
  --tracking-wider: 0.16em; /* uppercase eyebrow labels                 */

  /* --- Spacing — 4px base, ramped to 80px+ ------------------------------ */
  --space-0: 0;
  --space-1: 0.25rem; /*  4 px */
  --space-2: 0.5rem; /*  8 px */
  --space-3: 0.75rem; /* 12 px */
  --space-4: 1rem; /* 16 px */
  --space-5: 1.25rem; /* 20 px */
  --space-6: 1.5rem; /* 24 px */
  --space-8: 2rem; /* 32 px */
  --space-10: 2.5rem; /* 40 px */
  --space-12: 3rem; /* 48 px */
  --space-16: 4rem; /* 64 px */
  --space-20: 5rem; /* 80 px */
  --space-24: 6rem; /* 96 px */
  --space-32: 8rem; /*128 px */

  /* --- Radius — minimal, intentional. Anything more says "SaaS app". --- */
  --radius-none: 0;
  --radius-xs: 2px; /* default for inputs, tags                 */
  --radius-sm: 3px; /* buttons, cards                            */
  --radius-md: 4px; /* maximum for rectangular surfaces          */
  --radius-pill: 999px; /* ONLY for season pills, avatar chips       */
  --radius-circle: 50%; /* avatars, medallion frames                 */

  /* --- Shadows — warm-toned, never blue/grey ---------------------------
     Built from the dorado/cafe browns so shadows feel like they belong on
     stone and aged wood, not on a phone display.                          */
  --shadow-xs: 0 1px 2px rgba(74, 58, 40, 0.06);
  --shadow-sm: 0 2px 4px rgba(74, 58, 40, 0.08), 0 1px 2px rgba(74, 58, 40, 0.04);
  --shadow-md: 0 6px 14px rgba(74, 58, 40, 0.1), 0 2px 4px rgba(74, 58, 40, 0.05);
  --shadow-lg: 0 14px 32px rgba(42, 31, 20, 0.14), 0 4px 8px rgba(74, 58, 40, 0.06);
  --shadow-xl: 0 24px 56px rgba(42, 31, 20, 0.18), 0 8px 16px rgba(74, 58, 40, 0.08);

  /* Lift — used by cards on hover. Slight color creep into dorado.        */
  --shadow-lift: 0 18px 36px rgba(141, 113, 76, 0.16), 0 4px 10px rgba(42, 31, 20, 0.08);

  /* Focus ring */
  --shadow-focus: 0 0 0 3px var(--color-focus-ring);

  /* --- Transitions ------------------------------------------------------ */
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);

  --duration-fast: 140ms;
  --duration-base: 220ms;
  --duration-slow: 360ms;

  --transition-base: all var(--duration-base) var(--ease-standard);
  --transition-color:
    color var(--duration-base) var(--ease-standard),
    background-color var(--duration-base) var(--ease-standard),
    border-color var(--duration-base) var(--ease-standard);
  --transition-lift:
    transform var(--duration-slow) var(--ease-out), box-shadow var(--duration-slow) var(--ease-out);

  /* --- Z-index scale ---------------------------------------------------- */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-nav: 300;
  --z-overlay: 800;
  --z-modal: 900;
  --z-toast: 1000;

  /* --- Layout ----------------------------------------------------------- */
  --layout-max: 1240px; /* main container cap                   */
  --layout-narrow: 760px; /* long-form prose width                */
  --layout-wide: 1440px; /* edge-to-edge sections                */
  --nav-height: 72px;
  --nav-height-mobile: 60px;
  --footer-pad-y: var(--space-20);

  /* --- Section theme defaults (overridden by .section--* below) -------- */
  --section-bg: var(--color-bg);
  --section-fg: var(--color-text);
  --section-muted: var(--color-text-muted);
  --section-border: var(--color-border);
}

/* =========================================================================
   Body defaults
   ========================================================================= */
body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Selection — warm, never default-blue. */
::selection {
  background: var(--palette-albero-200);
  color: var(--color-text-strong);
}

/* Default focus visibility — applies to anything not overridden later. */
:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-xs);
}

/* Display headings use Cormorant; UI titles in body sans, by component. */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  color: var(--color-text-strong);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h1 {
  font-size: var(--text-4xl);
}
h2 {
  font-size: var(--text-3xl);
}
h3 {
  font-size: var(--text-2xl);
  line-height: var(--leading-snug);
}
h4 {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
}

h5,
h6 {
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  color: var(--color-text-strong);
  line-height: var(--leading-snug);
}
h5 {
  font-size: var(--text-lg);
}
h6 {
  font-size: var(--text-base);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

p {
  line-height: var(--leading-relaxed);
  text-wrap: pretty;
}

strong {
  font-weight: var(--weight-semibold);
  color: var(--color-text-strong);
}

/* Reduced motion — honor system preference. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Mobile type adjustments — bring hero down so it fits comfortably. */
@media (max-width: 720px) {
  :root {
    --text-4xl: 2.75rem; /* 44 px */
    --text-3xl: 2.125rem; /* 34 px */
    --text-2xl: 1.75rem; /* 28 px */
    --text-xl: 1.375rem; /* 22 px */
    --nav-height: var(--nav-height-mobile);
  }
}
