/* ==========================================================================
   Coffee Show 2027 — styles
   Design tokens live in :root. Swap the images in assets/img (see README
   there); font is Onest (Google Fonts), loaded in index.html <head>.
   ========================================================================== */

:root {
  /* Colors */
  --red: #E2001B;
   --red-Footer: #D91828;
  --red-dark: #6e0a10;
  --red-dark2: #8A0102;
  --near-black: #1a0a0a;
  --black: #000;
  --orange: #f26b21;
  --orange-dark: #c94f10;
  --white: #ffffff;
  --grey-text: #777474;
  --grey-light: #f2f2f2;

  /* Type */
  --font-display: 'Onest', 'Arial Black', sans-serif;
  --font-body: 'Onest', Arial, sans-serif;

  /* Layout */
  --max-width: 1400px;
  --middle-width: 1100px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
/* The decorative beans/lips use negative offsets and poke past the viewport.
   overflow-x on body alone isn't reliable on mobile, so set it on html too;
   `clip` (hidden as fallback) avoids creating a scroll container. */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  overflow-x: clip;
}
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--near-black);
  background: var(--white);
  overflow-x: hidden;
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
a { text-decoration: none; color: inherit; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.eyebrow {
  color: #fff;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
}

.eyebrow-black {
  color: black;
  font-size: clamp(0.7rem, 5vw, 1rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 10px 25px;
  border-radius: 999px;
  font-weight: 700;
  font-size: clamp(0.7rem, 5vw, 1rem);
  text-transform: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn--orange {
  background: var(--orange);
  color: var(--white);
  box-shadow: 0 5px 0 var(--orange-dark);
}
.btn--orange:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--orange-dark);
}
.btn--orange:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--orange-dark);
}

/* ---------- Image placeholder / fallback handling (see js/main.js) ---------- */
.img-wrap { position: relative; }
.img-wrap img { width: 100%; height: auto; }

.img-wrap--logo.img-missing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.12);
  border: 1px dashed rgba(255,255,255,0.5);
  border-radius: var(--radius-md);
  font-weight: 800;
  font-family: var(--font-display);
  text-align: center;
  white-space: nowrap;
}
/* On light backgrounds (sponsors, organizers) the missing-logo box needs dark text */
.sponsors .img-missing,
.organizers .img-missing {
  background: var(--grey-light);
  border-color: #ccc;
  color: var(--near-black);
}

.img-wrap--photo.img-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: 12px;
  background: #2a2a2a;
  border: 1px dashed rgba(255,255,255,0.4);
  border-radius: var(--radius-md);
  color: var(--white);
  font-size: 0.85rem;
  text-align: center;
}

.img-wrap.img-missing img { display: none; }

/* Decorative images with no .img-wrap (hero/program lips, portafilter) just disappear */
img.img-missing { display: none; }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  background: var(--near-black);
  overflow: hidden;
  padding: 20px 0 20px;
  height: 100%;
}
.hero__bg {
  position: absolute;
  inset: 0;
  background: url("../assets/img/Hero1-mobile.jpg") no-repeat;
  background-position: center;
  background-size: cover;
  z-index: 0;
}

.hero__lips {
  position: absolute;
  right: -50px;
  top: 12%;
  width: 180px;
  z-index: 1;
  pointer-events: none;
}
.hero__lips.img-missing { display: none; }

/* Mobile: poster layout. Sponsor top-left, edition top-right, the cup lives in
   the bg image (empty 1fr row), then logo / dates / button, and a bottom row
   with tagline left + buenplan right. .hero__side and .hero__content are
   unwrapped (display: contents) so every piece is a direct grid item. */
.hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr auto auto auto auto;
  grid-template-areas:
    "sponsor edition"
    "cup     cup"
    "logo    logo"
    "dates   dates"
    "cta     cta"
    "tagline buenplan";
  align-items: center;
  column-gap: 18px;
  row-gap: 12px;
  text-align: center;
  min-height: 700px;
}
.hero__side,
.hero__content { display: contents; }

.hero__sponsor { grid-area: sponsor; justify-self: start; }
.hero__edition { grid-area: edition; justify-self: end; }
.hero__logo { grid-area: logo; justify-self: center; }
.hero__dates { grid-area: dates; }
.hero__content .btn { grid-area: cta; justify-self: center; margin-bottom: 20px; }
.hero__side .hero__tagline { grid-area: tagline; text-align: left; }
.hero__buenplan { grid-area: buenplan; justify-self: end; }

.hero__content { color: var(--white); }

.hero__sponsor {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero__sponsor-logo { width: 190px; }

.hero__edition {
  color: var(--white);
  font-size: 0.53rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 700;
}

.hero__logo { width: min(240px, 80vw); margin: 6px 0; }
.hero__logo img { font-size: 1.5rem; }

.hero__dates {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.8rem, 6vw, 3.5rem);
  line-height: 1.1;
  margin-top: 16px;
}
.hero__venue {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 4vw, 2.7rem);
  letter-spacing: 0.05em;
  margin-bottom: 25px;
}

.hero__buenplan { width: min(130px, 34vw); }

.hero__tagline {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--white);
  font-size: 0.50rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 700;
}

@media (min-width: 768px) {
  .hero { height: 760px; padding: 42px 0 42px; }
  .hero__bg { background-image: url("../assets/img/Hero1.jpg"); }
  .hero__logo { width: min(320px, 80vw); margin: 6px 0; }
  .hero__edition { display: none; }
  .hero__sponsor-logo { width: 312px; }
  .hero__buenplan { width: 200px; margin-top: 32px; }
  .hero__content .btn { margin-bottom: 0; }
  .hero__inner {
    display: flex;
    min-height: 0;
    /* Fill the hero's full content-box height (not just what the right
       column's content needs) so the left column's top/bottom % below can
       be measured against the whole bg image, not a shorter shrink-wrapped
       box — otherwise "below the cup" drifts onto the cup itself. */
    height: 100%;
    flex-direction: row;
    align-items: stretch;
    text-align: left;
    gap: 48px;
    max-width: var(--middle-width);
  }
  /* Left column: the cup lives in the bg image, so sponsor logo + tagline are
     pinned on top of it (approximate cup position, tune the top/bottom %
     once checked against real viewport widths). */
  .hero__side {
    /* Undo the mobile display:contents trick — it needs a real box here so
       position/flex actually apply to it and not to .hero__inner instead. */
    display: block;
    position: relative;
    /* Fixed share of the row (not flex:1) so it can't get squeezed down by
       .hero__content's own content — its width has to track roughly where
       the cup sits in the bg image, not shrink to whatever's left over. */
    flex: 0 0 45%;
  }
  .hero__side .hero__sponsor {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
  }
  .hero__side .hero__tagline {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: 100%;
  }
  .hero__content {
    display: flex;
    flex-direction: column;
    flex: 1;
    align-items: center;
    gap: 45px;
  }
  
  .hero__lips { width: 300px; top: auto; right: -40px; bottom: -30px; }
  .hero__tagline { font-size: 0.75rem; }
}

/* ==========================================================================
   CATEGORY STRIP
   ========================================================================== */
.strip {
  position: relative;
  background: var(--black);
  padding: 16px 20px;
  overflow: visible;
}
.strip__text {
  text-align: center;
  color: var(--white);
  font-size: clamp(0.3rem, 5vw, 0.9rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}
.strip__text .dot { color: var(--white); margin: 0 6px; }

.strip__kiss {
  position: absolute;
  right: -60px;
  top: -30px;
  width: 90px;
  z-index: 2;
  pointer-events: none;
}
.strip__kiss.img-missing { display: none; }

@media (min-width: 768px) {
  .strip__kiss { right: -34px; width: 130px; top: -60px; }
}

/* ==========================================================================
   PROGRAM
   ========================================================================== */
.program {
  position: relative;
  padding: 64px 0;
  overflow: hidden;
}

.program__watermark {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(4rem, 20vw, 12rem);
  color: var(--grey-light);
  white-space: nowrap;
  z-index: 0;
  user-select: none;
}

.program__inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.program__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2rem);
  line-height: 1;
}

.program__subtitle {
  max-width: 640px;
  margin: 16px auto 0;
  color: var(--grey-text);
  font-size: 0.9rem;
  line-height: 1.2;
}

.program__lips {
  display: none;
}

.program__days {
  background-image: url("../assets/img/fondo-coffeeShow-mobile.jpg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
  margin-top: 48px;
  display: grid;
  gap: 48px;
}

.day__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.1rem, 5vw, 2.5rem);
  text-transform: uppercase;
  display: inline-block;
  position: relative;
  padding-bottom: 0px;
}
.day__title--sat, .day__title--sun { color: var(--red); }
.day__title::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 30%;
  height: 2px;
  background: var(--red);
}

.day__price {
  margin-top: 8px;
  font-size: clamp(0.8rem, 5vw, 1.2rem);
  color: var(--near-black);
}
.day__price strong { font-size: 1rem; }

.artists {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.artist__photo {
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: transparent;
}
.artist__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artist__name {
  margin-top: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.day .btn { margin-top: 28px; }
.day__buenplan { width: 128px; margin: 18px auto 0; }

@media (min-width: 900px) {
  .program__days {
    background-image: url("../assets/img/fondo-coffeeShow.jpg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
  }
  .program__lips {
    display: block;
    position: absolute;
    left: -30px;
    bottom: 0;
    width: 200px;
    z-index: 1;
  }
}

/* ==========================================================================
   EXPERIENCE BAND
   ========================================================================== */
.experience {
  position: relative;
  background-image: url("../assets/img/Hero2--mobile.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  padding: 36px 0;
  overflow: hidden;
}

.experience__portafilter {
  position: absolute;
  left: -60px;
  top: 50%;
  transform: translateY(-50%);
  width: 220px;
  opacity: 0.9;
  z-index: 1;
}
.experience__portafilter.img-missing { display: none; }

/* Sits between .program and .experience with no overflow of its own, so the
   kiss image can straddle the boundary without being clipped by either
   section's overflow: hidden. */
.section-seam {
  position: relative;
  height: 0;
}

.experience__kiss {
  position: absolute;
  left: -14px;
  top: -60px;
  width: 90px;
  z-index: 5;
  transform: rotate(-15deg);
  pointer-events: none;
}
.experience__kiss.img-missing { display: none; }

@media (min-width: 768px) {
  .experience__kiss { left: -14px; width: 130px; top: -60px; }
  .experience { padding: 76px 0; }
}

.experience__inner {
  max-width: var(--middle-width);
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  min-height: 500px;
}

.experience__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.experience__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.4rem, 4vw, 2rem);
  line-height: 1.3;
}

.experience__brands {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.experience__logo { width: 280px; }
.experience__edition {
  margin-top: 4px;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 700;
}

.experience__sponsor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.experience__sponsor .img-wrap { width: 230px; }

.social {
  display: flex;
  gap: 16px;
}
.social__icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
  color: var(--red-dark2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}
.social__icon:hover { transform: translateY(-3px); }

/* Mobile: title on top, logo + sponsor side by side, socials centered below */
@media (max-width: 767px) {
  .experience__content { width: 100%; }
  .experience__brands {
    flex-wrap: nowrap;
    justify-content: space-between;
    width: 100%;
    gap: 16px;
  }
  .experience__logo { width: 46%; }
  .experience__sponsor { width: 42%; }
  .experience__sponsor .img-wrap { width: 100%; }
}

@media (min-width: 768px) {
  .experience { background-image: url("../assets/img/Hero2.jpg"); }
  .experience__inner { align-items: flex-end; min-height: auto; }
}

/* ==========================================================================
   SPONSORS
   ========================================================================== */
.sponsors { padding: 56px 20px; }
.sponsors__grid {
  /* Flex, not grid: every logo gets the same fixed-size cell (still fixes
     the raw intrinsic-width raggedness), but flex-wrap + justify-content
     center an incomplete last row — grid's auto-fit leaves trailing empty
     tracks start-aligned instead, which is the gap you spotted. */
  /* Logos are sized by HEIGHT (--logo-h) and keep their aspect ratio, so wide
     logos (Mazda, Juan Valdez, Dentonomy...) look as big as square ones
     instead of being squeezed into a fixed-width cell. */
  --logo-h: 60px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 15px 20px;
}
.sponsors__logo {
  flex: 0 0 auto;
  height: var(--logo-h);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sponsors__logo img {
  height: var(--logo-h);
  width: auto;
  max-width: none;
  object-fit: contain;
  margin: 0;
}
/* Cosecha Roja's file is only 48px tall (vs 94 for the rest): scale to match */
.sponsors__logo img[height="48"] { height: calc(var(--logo-h) * 0.51); }

/* The forced-break spacer only exists for the wide-desktop 7/10 layout;
   elsewhere it would occupy a slot in the row (and a gap), so hide it. */
.sponsors__break { display: none; }

/* Mobile: tidy 3-column grid. Equal cells, logos contained inside them, so
   rows line up (the last row of 2 stays centered). */
@media (max-width: 767px) {
  .sponsors__grid { gap: 22px 12px; }
  .sponsors__logo {
    flex: 0 0 calc((100% - 2 * 12px - 1px) / 3);
    width: calc((100% - 2 * 12px - 1px) / 3);
    height: 84px;
  }
  .sponsors__logo img,
  .sponsors__logo img[height="48"] {
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 100%;
  }
}

@media (min-width: 768px) {
  .sponsors__grid {
    --logo-h: 94px;
    gap: 25px 40px;
  }
}

/* Wide desktop: forced 7 logos on the first row (break after the 7th in the
   HTML), the remaining 10 on the second. Height scales with the viewport so
   the 10 natural-width logos still fit on one line. */
@media (min-width: 1200px) {
  .sponsors__grid {
    --logo-h: min(94px, 7.2vw);
    max-width: 1400px;
    margin-inline: auto;
  }
  .sponsors__break {
    display: block;
    flex: 0 0 100%;
    height: 0;
    margin-top: -25px; /* cancels one of the two row gaps around the break */
  }
}


/* ==========================================================================
   ORGANIZERS
   ========================================================================== */
.organizers {
  padding: 32px 20px 56px;
  text-align: center;
}
.organizers__logos {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.organizers__logo { width: 623px; height: 60px; }
.organizers__amp {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--red);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  background: var(--red);
  padding: 18px 20px;
  text-align: center;
}
.footer p {
  color: var(--white);
  font-size: clamp(0.1rem, 5vw, 0.9rem);
  font-weight: 700;
  letter-spacing: 0.03em;
}
