/* ══════════════════════════════════════════════
   FOLHAS — Common Styles
   Reset, variables, typography, utilities
   ══════════════════════════════════════════════ */

/* ── Web Fonts (local) ────────────────────────── */
@font-face {
  font-family: 'General Sans';
  src: url("../fonts/GeneralSans-Regular.87c6504d66ed.woff") format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'General Sans';
  src: url("../fonts/GeneralSans-Medium.ea8ca00a4e68.woff") format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'General Sans';
  src: url("../fonts/GeneralSans-Bold.c1627359dfa2.woff") format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'OPTITomasoBold-Extended';
  src: url("../fonts/OPTITomasoBold-Extended.e67fcc40582d.woff") format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Reset ────────────────────────────────────── */
html {
  font-size: 16px; /* rem base — keeps 1rem = 16px */
}

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

/* ── CSS Variables ────────────────────────────── */
:root {
  /* Colors */
  --green: #21a178;
  --orange: #eb7824;
  --cream: #fcdebf;
  --black: #000000;
  --white: #ffffff;
  --gray-light: #e8e8e8;
  --gray: #d4d4d4;
  --gray-dark: #666666;
  --red: #e53e3e;

  /* Typography */
  --font-heading: 'OPTITomasoBold-Extended', Georgia, 'Times New Roman', serif;
  --font-body: 'General Sans', 'Helvetica Neue', Arial, sans-serif;

  /* Layout */
  --page-max-width: 1920px;
  --side-padding: 1.25rem;
  --content-width: 100%;

  /* Cards */
  --card-height: auto;
  --card-thumb: 7.5rem;
  --card-radius: 1rem;
  --card-gap: 1rem;
  --card-border: 3px solid var(--black);

  /* Spacing */
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 1.5rem;
  --space-3xl: 2rem;
  --space-4xl: 3.5rem;
  --space-section: 2.5rem;

  /* Typography scale */
  --text-xs: 0.6875rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.5625rem;
  --text-3xl: 1.125rem;
  --text-4xl: 1.25rem;
  --text-5xl: 1.5rem;
  --text-6xl: 2rem;

  /* Borders — stay in px for crisp lines */
  --border-width: 3px;
  --border-width-thin: 2px;
  --border-width-divider: 1px;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;

  /* Transitions */
  --transition-fast: 0.2s;
  --transition-normal: 0.3s;

  /* Z-index scale */
  --z-dropdown: 100;
  --z-modal: 500;
  --z-mobile-nav: 900;
  --z-search-modal: 1000;
  --z-skip-link: 2000;

  /* Extra spacing & sizing */
  --space-xs: 0.5rem;
  --radius-pill: 1.375rem;
  --radius-tag: 1.125rem;
  --tracking: 0.5px;
  --tracking-wide: 1px;
  --outline-offset: 2px;

  /* Button heights */
  --btn-height-lg: 3.5rem;
  --btn-height-md: 3rem;
  --btn-height-sm: 2.75rem;
  --btn-height-xs: 2.25rem;

  /* Icon sizes */
  --icon-sm: 1.5rem;
  --icon-md: 1.75rem;
  --icon-lg: 1.875rem;
  --icon-touch: 2.75rem;
  --icon-xl: 3.4375rem;

  /* Overlays */
  --overlay-light: rgba(255, 255, 255, 0.95);
  --overlay-subtle: rgba(255, 255, 255, 0.25);
  --overlay-border: rgba(255, 255, 255, 0.3);
}

/* ── Base ─────────────────────────────────────── */
body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--black);
  max-width: var(--page-max-width);
  margin: 0 auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

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

/* ── Typography ───────────────────────────────── */
.page-title {
  font-family: var(--font-heading);
  font-size: var(--text-6xl);
  font-weight: 700;
  color: var(--green);
}

.section-title {
  font-family: var(--font-heading);
  font-size: var(--text-5xl);
  font-weight: 700;
  color: var(--black);
}

.body-text {
  font-family: var(--font-body);
  font-size: var(--text-3xl);
  font-weight: 500;
  color: var(--black);
  line-height: 1.4;
}

.body-text-sm {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--black);
  line-height: 1.5;
}

/* ── Section Layout ───────────────────────────── */
.section {
  padding: var(--space-section) var(--side-padding) 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.section-divider {
  border: none;
  border-top: var(--border-width) solid var(--black);
  margin-bottom: var(--space-xl);
}

/* ── Accessibility ────────────────────────────── */
.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: var(--side-padding);
  z-index: var(--z-skip-link);
  padding: var(--space-sm) var(--space-lg);
  background: var(--green);
  color: var(--white);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 700;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* ── Focus Visible ────────────────────────────── */
:focus-visible {
  outline: var(--border-width) solid var(--green);
  outline-offset: var(--outline-offset);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: var(--border-width) solid var(--green);
  outline-offset: var(--outline-offset);
}

/* Remove default outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* ── Background Image Utilities ──────────────── */
.bg-cover,
.bg-contain {
  background-position: center;
  background-repeat: no-repeat;
}

.bg-cover  { background-size: cover; }
.bg-contain { background-size: contain; }

/* ── Scroll lock for modals ───────────────────── */
body.scroll-lock {
  overflow: hidden;
}

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

/* ── Print ────────────────────────────────────── */
@media print {
  .header,
  .footer,
  .mobile-nav,
  .search-modal,
  .nav-dropdown,
  .skip-link,
  .btn-filter,
  .btn-block {
    display: none;
  }

  .card,
  .partner-card {
    break-inside: avoid;
  }

  .hero,
  .hero-category {
    min-height: auto;
    height: auto;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
}

/* ══════════════════════════════════════════════
   Responsive Breakpoints
   ══════════════════════════════════════════════ */

/* ── Tablet+ (≥768px) ────────────────────────── */
@media (min-width: 768px) {
  :root {
    --side-padding: 3.75rem;
    --content-width: 1640px;
    --card-height: 15.25rem;
    --card-thumb: 15.25rem;
    --card-radius: 1.5625rem;
    --space-section: 3.75rem;
    --space-3xl: 3rem;
    --space-2xl: 2.5rem;
    --text-lg: 1.25rem;
    --text-3xl: 1.375rem;
    --text-4xl: 1.625rem;
    --text-5xl: 2rem;
    --text-6xl: 3rem;
  }
}

/* ── Desktop+ (≥1200px) ─────────────────────── */
@media (min-width: 1200px) {
  :root {
    --side-padding: 8.75rem;
    --space-section: 5rem;
    --text-3xl: 1.6875rem;
    --text-4xl: 1.875rem;
    --text-5xl: 2.5rem;
    --text-6xl: 3.75rem;
  }
}
