/* ==========================================================================
   Matsuri Barcelona — Base design system
   Reset, typography, buttons, chips, cards. Tokens come from tokens.css.
   ========================================================================== */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

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

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

h1, h2, h3, h4, h5, h6, p {
  margin: 0;
}

/* Respect reduced-motion preference across the whole theme. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------ Layout ---------------------------------- */
.container {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--content-pad-pc);
}

@media (max-width: 782px) {
  .container {
    padding-inline: var(--content-pad-sp);
  }
}

.section {
  padding-block: 96px;
}

@media (max-width: 782px) {
  .section {
    padding-block: 56px;
  }
}

.section--ink {
  background: var(--ink);
  color: var(--paper);
}

/* ---------------------------- Typography --------------------------------- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--vermillion);
}

/* Figma keeps every small-label kicker vermillion on both light AND dark
   (ink) sections — "EL FESTIVAL", "PARTICIPA", "NO TE LO PIERDAS", etc.
   are all #c0282e regardless of background, so there's no ink-section
   override here (a previous amber override was a guess, not confirmed). */

/* Figma's major headings were originally set in Outfit Light (300), not a
   bold display weight — confirmed via get_design_context on the hero H1,
   the "Colabora con el Matsuri" H2, and several section titles. Changed to
   a bold (900) display weight for every page title (.h1/h1) site-wide,
   per the user, 2026-11-03 — .h2/h2 stays Light here; it's bolded only on
   the homepage, via assets/css/front-page.css (which loads only there). */
.h1,
h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(2.4rem, 1.6rem + 3.2vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.h2,
h2 {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.h3,
h3 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.75rem);
  line-height: 1.2;
}

.h4,
h4 {
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.3;
}

.body-lg {
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink-78);
}

.body,
p {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink-78);
}

.body-sm {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink-65);
}

.section--ink .body-lg,
.section--ink .body,
.section--ink p,
.section--ink .body-sm {
  color: var(--ink-body-text);
}

.jp-accent {
  font-family: var(--font-jp);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 48px;
}

.section-head .h2 {
  margin: 0;
}

/* ------------------------------- Buttons --------------------------------- */
.btn {
  --btn-bg: var(--ink);
  --btn-bg-hover: #372d69;
  --btn-bg-active: #131026;
  --btn-fg: var(--paper);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border: 1px solid transparent;
  /* No pill/round buttons anywhere in this theme — every button, on any
     background, uses the same tight corner radius. */
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--transition-fast), border-color var(--transition-fast),
    color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn:hover {
  background: var(--btn-bg-hover);
  transform: translateY(-1px);
}

.btn:active {
  background: var(--btn-bg-active);
  transform: translateY(0);
}

.btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.btn--sm {
  padding: 13px 24px;
  font-size: 0.8125rem;
}

/* Small uppercase CTA — used for the short "→" links/buttons scattered
   through the design (VER PRECIOS Y COMPRAR, VER MAPA INTERACTIVO,
   SOLICITA TU STANDS). Figma renders these with a tight 4px corner
   radius and a smaller Medium-weight label, not the pill/SemiBold
   treatment used by the solid CTA buttons (Colabora blocks, header
   ENTRADAS) — this modifier overrides geometry + weight to match. */
.btn--caps {
  border-radius: var(--radius-xs);
  padding: 16px 30px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Ink — default, used on light/paper backgrounds as the primary action. */
.btn--ink {
  --btn-bg: var(--ink);
  --btn-bg-hover: #372d69;
  --btn-bg-active: #131026;
  --btn-fg: var(--paper);
}

/* Vermillion — high-emphasis CTA (tickets, submit). */
.btn--vermillion {
  --btn-bg: var(--vermillion);
  --btn-bg-hover: #aa2024;
  --btn-bg-active: #891a1b;
  --btn-fg: var(--white);
}

/* Amber — used on dark/ink sections as the primary action. */
.btn--amber {
  --btn-bg: var(--amber);
  --btn-bg-hover: #bd7818;
  --btn-bg-active: #a86a14;
  --btn-fg: var(--ink);
}

/* White, borderless — Colabora's intro-banner "Voluntariado" access block
   (Figma 81:513) on the dark .content-intro banner: a solid white pill,
   no border. Visually close to the ink-section .btn--outline flip below,
   but that one has a 1.5px ink border per Figma's Participa section
   (84:495) — a separate instance with its own spec — so this needed its
   own modifier rather than reusing/overriding .btn--outline. */
.btn--white-plain {
  --btn-bg: var(--white);
  --btn-bg-hover: var(--paper);
  --btn-bg-active: var(--paper);
  --btn-fg: var(--ink);
}

/* Outline — secondary action; transparent fill, inherits ink or paper per context. */
.btn--outline {
  background: transparent;
  border-color: var(--ink-22);
  color: var(--ink);
}

.btn--outline:hover {
  background: var(--ink-06);
  border-color: var(--ink-35);
  transform: translateY(-1px);
}

.btn--outline:active {
  background: var(--ink-10);
  transform: translateY(0);
}

/* On ink sections the outline button flips to a solid white pill with an
   ink border/text (Figma "Voluntariado" block), matching the same full
   pill radius as the other two buttons in that row — confirmed directly
   against the live Figma file (all three buttons read as the same
   shape there, overriding an earlier per-node reading that had this
   one as a smaller 8px radius). */
.section--ink .btn--outline {
  background: var(--white);
  border-width: 1.5px;
  border-color: var(--ink);
  color: var(--ink);
}

.section--ink .btn--outline:hover {
  background: var(--paper);
  border-color: var(--ink);
}

/* A disabled ticket CTA (see matsuri_ticket_cta() in inc/template-tags.php)
   needs to read as genuinely off, not just a dimmed version of whatever
   color variant it was — .btn--vermillion etc. only set the --btn-bg/
   --btn-fg custom properties, so setting background/color directly here
   (higher specificity than a single modifier class) overrides any of
   them uniformly. Uses an opaque mid-gray + off-white text (not an
   ink-alpha token) so it stays legible as "off" on both light/paper
   sections AND dark/ink ones (header, ticket-reminder, hero) alike —
   an alpha-based gray would nearly vanish against a dark background. */
.btn[disabled] {
  background: #857f74;
  color: var(--paper);
  border-color: transparent;
  opacity: 1;
  cursor: not-allowed;
  box-shadow: none;
  transform: none !important;
}

.btn[disabled]:hover,
.btn[disabled]:active {
  background: #857f74;
  color: var(--paper);
  transform: none !important;
}

/* -------------------------------- Chips ----------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--ink-08);
  color: var(--ink-70);
}

.chip--amber {
  background: rgba(206, 134, 29, 0.16);
  color: #8a5f22;
}

.section--ink .chip--amber {
  background: rgba(206, 134, 29, 0.16);
  color: var(--amber);
}

.chip--outline {
  background: transparent;
  border: 1px solid var(--ink-22);
  color: var(--ink-65);
}

.section--ink .chip--outline {
  border-color: var(--paper-55);
  color: var(--paper-78);
}

/* -------------------------------- Cards ------------------------------------ */
.card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-med), transform var(--transition-med);
}

.card:hover,
.card:focus-within {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
}

.card__photo {
  aspect-ratio: 312 / 220;
  width: 100%;
}

.card__body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card__title {
  font-weight: 500;
  font-size: 1.125rem;
}

.card__meta {
  font-size: 0.8125rem;
  color: var(--ink-55);
}

/* Highlights grid card (Homepage "Descubre el Festival") — full rules
   (photo-on-top + text-panel-below) live in front-page.css, since the
   card's internal structure is specific to that one section. */

/* -------------------------------- Divider ---------------------------------- */
.divider {
  height: 1px;
  background: var(--ink-10);
  border: 0;
}

.section--ink .divider {
  background: var(--paper-55);
  opacity: 0.2;
}

/* --------------------------- Form controls (base) --------------------------- */
label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 8px;
}

.field-hint {
  font-size: 0.8125rem;
  color: var(--ink-55);
  margin-top: 6px;
}

input[type='text'],
input[type='email'],
input[type='tel'],
input[type='url'],
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--ink-18);
  border-radius: var(--radius-sm);
  background: var(--white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input[type='text']:focus,
input[type='email']:focus,
input[type='tel']:focus,
input[type='url']:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--vermillion);
  box-shadow: 0 0 0 3px rgba(192, 40, 46, 0.14);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* Generic fallback list (index.php) — blog/search/archive placeholder. */
.fallback-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.fallback-list__item {
  padding-bottom: 32px;
  border-bottom: 1px solid var(--ink-10);
}

.fallback-list__item h2 a:hover {
  color: var(--vermillion);
}

/* Screen-reader-only utility. */
.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;
}
