/* =====================================================================
   WHNext — "Le eccellenze del Brasile" (page-template/page-brasile.php)
   Loads after whnext.css and uses its --whx-* tokens. Scoped to
   body.whx-brasile so nothing here can leak into other templates.
   ===================================================================== */

/* Hero — the theme's own photo hero (.whx-hero--img), fed by a responsive
   <img> instead of a background-image so the browser picks the width. */
.whx-brasile .whx-br-hero {
  min-height: 58vh;
  padding-bottom: clamp(5.2rem, 11vh, 7.2rem);   /* room for the banner lifted over the edge */
}
.whx-brasile .whx-br-hero .whx-hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 48%;
  filter: none;              /* the theme mutes hero photos (saturate .92); the flag keeps its colours */
}

/* Event banner — small artwork (300 x 100), shown at its own size and never
   upscaled, framed as a card lifted over the hero's lower edge. */
.whx-brasile .whx-br-banner {
  position: relative;
  z-index: 3;
  width: fit-content;
  max-width: 100%;
  margin: calc(-1 * clamp(3rem, 8vh, 5.5rem) - 2.4rem) auto clamp(2.4rem, 5.5vh, 3.4rem);
  padding: 7px;
  background: var(--whx-white);
  border-radius: 12px;
  box-shadow: var(--whx-shadow-lift);
}
.whx-brasile .whx-br-banner img {
  display: block;
  width: 300px;
  max-width: 100%;
  height: auto;
  border-radius: 7px;
}

/* Section heading */
.whx-brasile .whx-br-title {
  text-align: center;
  margin: 0 0 clamp(1.6rem, 4vh, 2.4rem);
}

/* The showcase — one column of cards: medal · producer + product · tipologia */
.whx-brasile .whx-br-list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 52rem;
  display: grid;
  gap: .85rem;
}
.whx-brasile .whx-br-item {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr) 7.75rem;
  align-items: center;
  gap: 1.4rem;
  margin: 0;
  padding: 1.1rem 1.3rem 1.1rem 1.2rem;
  background: var(--whx-white);
  border-radius: var(--whx-radius);
  box-shadow: 0 1px 2px rgba(32, 28, 29, .05), 0 6px 22px rgba(32, 28, 29, .06);
}
.whx-brasile .whx-br-medal {
  display: block;
  width: 4.25rem;
  height: 4.25rem;
  object-fit: contain;        /* the award artwork is square; never force a box */
}
.whx-brasile .whx-br-body { min-width: 0; }
.whx-brasile .whx-br-producer {
  margin: 0;
  font-family: var(--whx-sans);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--whx-claret);
}
.whx-brasile .whx-br-wine {
  margin: .22rem 0 0;
  font-size: clamp(1.25rem, 2.3vw, 1.55rem);
  line-height: 1.2;
  letter-spacing: .01em;
  overflow-wrap: anywhere;
}
.whx-brasile .whx-br-meta {
  margin: .3rem 0 0;
  font-family: var(--whx-sans);
  font-size: .88rem;
  line-height: 1.4;
  letter-spacing: .06em;
  color: var(--whx-ink-soft);
}

/* Tipologia — the catalogue glyph over its approved name */
.whx-brasile .whx-br-type {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding-left: 1.2rem;
  border-left: 1px solid var(--whx-grey-light);
  text-align: center;
}
.whx-brasile .whx-br-type img {
  display: block;
  height: 2.1rem;
  width: auto;
}
.whx-brasile .whx-br-type span {
  font-family: var(--whx-sans);
  font-size: .68rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--whx-ink-soft);
}

/* The closing note — lightly greyed, as asked; #69696C is the lightest grey
   that still holds 4.5:1 on the tinted ground (--whx-paper-2). */
.whx-brasile .whx-br-soon {
  margin: clamp(2.6rem, 6vh, 3.8rem) auto 0;
  max-width: 52rem;
  text-align: center;
  font-family: var(--whx-serif);
  font-size: 1.12rem;
  font-style: italic;
  line-height: 1.5;
  letter-spacing: .01em;
  color: #69696C;
}

/* ---------------------------------------------------------------------
   Filters (v1.1) — one control above each card column, the same width as
   that column: award · text · tipologia. The native <select> stays the
   real control, laid transparent over a painted face (placeholder, or the
   chosen medal / glyph); the X clears one filter.
   --------------------------------------------------------------------- */

/* `hidden` must win: the cards and the bar set their own display, which
   outranks the browser's default [hidden] rule. */
.whx-brasile .whx-br [hidden] { display: none !important; }

.whx-brasile .whx-br-filters {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr) 7.75rem;   /* = the cards */
  align-items: center;
  gap: 1.4rem;
  max-width: 52rem;
  margin: 0 auto 1.1rem;
  padding: .8rem 1.3rem .8rem 1.2rem;                        /* = the cards' side padding */
  background: var(--whx-white);
  border-radius: var(--whx-radius);
  box-shadow: inset 0 0 0 1px var(--whx-grey-light);          /* a border that takes no width */
}
.whx-brasile .whx-br-f { position: relative; min-width: 0; }
.whx-brasile .whx-br-f-box { position: relative; width: 100%; height: 100%; }

.whx-brasile .whx-br-f--tier { width: 4.25rem; height: 4.25rem; }
.whx-brasile .whx-br-f--type {
  align-self: stretch;
  min-height: 4.25rem;
  padding-left: 1.2rem;                                      /* = the cards' type column */
  border-left: 1px solid var(--whx-grey-light);
}

/* The real control: transparent, on top, covering its cell */
.whx-brasile .whx-br-f-select {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 1rem;                                           /* iOS: no zoom on focus */
  -webkit-appearance: none;
  appearance: none;
}

/* The painted face under it */
.whx-brasile .whx-br-f-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: 1.5px dashed var(--whx-sage);
  color: var(--whx-ink-soft);
  font-family: var(--whx-sans);
  font-size: .62rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: center;
  transition: border-color .25s var(--whx-ease), background-color .25s var(--whx-ease);
}
.whx-brasile .whx-br-f--tier .whx-br-f-face { border-radius: 50%; }           /* an empty medal slot */
.whx-brasile .whx-br-f--type .whx-br-f-face { border-radius: 10px; }
.whx-brasile .whx-br-f-ph::after {                                            /* a drawn chevron, never a font glyph */
  content: "";
  display: block;
  width: .38rem;
  height: .38rem;
  margin: .32rem auto 0;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.whx-brasile .whx-br-f-box:hover .whx-br-f-face { border-color: var(--whx-claret); background: rgba(120, 47, 64, .04); }
.whx-brasile .whx-br-f-box:focus-within .whx-br-f-face { outline: 2px solid var(--whx-claret); outline-offset: 3px; }

/* Set: the face becomes the medal / the glyph, like the card below */
.whx-brasile .whx-br-f.is-set .whx-br-f-face { border-color: transparent; background: none; }
.whx-brasile .whx-br-f.is-set .whx-br-f-ph { display: none; }
.whx-brasile .whx-br-f--tier .whx-br-f-icon { width: 100%; height: 100%; object-fit: contain; }
.whx-brasile .whx-br-f--type .whx-br-f-icon { height: 2.1rem; width: auto; }
.whx-brasile .whx-br-f-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--whx-ink-soft);
}

/* The little X, top right, over the badge or the glyph */
.whx-brasile .whx-br-f-clear {
  position: absolute;
  top: -.4rem;
  right: -.4rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 1.6rem;                                             /* >= 24 px target (WCAG 2.2, 2.5.8) */
  height: 1.6rem;
  padding: 0;
  border: 2px solid var(--whx-white);
  border-radius: 50%;
  background: var(--whx-ink);
  color: var(--whx-white);
  box-shadow: 0 2px 6px rgba(32, 28, 29, .25);
  cursor: pointer;
  transition: background-color .2s var(--whx-ease);
}
.whx-brasile .whx-br-f--type .whx-br-f-clear { top: -.2rem; right: .15rem; }
.whx-brasile .whx-br-f-clear svg { width: .62rem; height: .62rem; display: block; }
.whx-brasile .whx-br-f-clear:hover { background: var(--whx-claret); }
.whx-brasile .whx-br-f-clear:focus-visible { outline: 2px solid var(--whx-claret); outline-offset: 2px; }

/* Text search */
.whx-brasile .whx-br-f-input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 2.9rem;
  margin: 0;
  padding: 0 1.1rem 0 2.7rem;
  border: 1px solid var(--whx-grey-light);
  border-radius: 999px;
  background: var(--whx-paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='5' fill='none' stroke='%234A4547' stroke-width='1.6'/%3E%3Cpath d='M11 11l3.5 3.5' stroke='%234A4547' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 1.05rem 50% / 1rem;
  box-shadow: none;
  font-family: var(--whx-sans);
  font-size: 1rem;
  line-height: normal;
  color: var(--whx-ink);
  text-overflow: ellipsis;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .25s var(--whx-ease), background-color .25s var(--whx-ease);
}
.whx-brasile .whx-br-f-input::placeholder { color: #69696C; opacity: 1; }
.whx-brasile .whx-br-f-input:hover { border-color: var(--whx-sage); }
.whx-brasile .whx-br-f-input:focus { outline: 2px solid var(--whx-claret); outline-offset: 2px; border-color: transparent; background-color: var(--whx-white); }

/* The count, for screen readers only */
.whx-brasile .whx-br-count {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Nothing in scope */
.whx-brasile .whx-br-list.is-empty { display: none; }
.whx-brasile .whx-br-empty {
  max-width: 52rem;
  margin: 0 auto;
  padding: clamp(1.8rem, 5vh, 2.6rem) 1.5rem;
  text-align: center;
  border: 1.5px dashed var(--whx-sage);
  border-radius: var(--whx-radius);
  background: rgba(255, 255, 255, .6);
}
.whx-brasile .whx-br-empty p {
  max-width: 34rem;
  margin: 0 auto 1.2rem;
  font-family: var(--whx-serif);
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--whx-ink);
}
.whx-brasile .whx-br-reset {
  display: inline-block;
  padding: .75rem 1.6rem;
  border: 0;
  border-radius: 999px;
  background: var(--whx-claret);
  color: var(--whx-white);
  font-family: var(--whx-sans);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .25s var(--whx-ease);
}
.whx-brasile .whx-br-reset:hover { background: var(--whx-claret-bright); }
.whx-brasile .whx-br-reset:focus-visible { outline: 2px solid var(--whx-claret); outline-offset: 3px; }

/* Phones — the medal holds the left edge; the tipologia drops under the product */
@media (max-width: 37.5em) {
  .whx-brasile .whx-br-item {
    grid-template-columns: 3.3rem minmax(0, 1fr);
    gap: .55rem 1rem;
    padding: 1rem 1.05rem;
  }
  .whx-brasile .whx-br-medal {
    grid-row: span 2;
    align-self: start;
    width: 3.3rem;
    height: 3.3rem;
  }
  .whx-brasile .whx-br-type {
    grid-column: 2;
    flex-direction: row;
    justify-content: flex-start;
    gap: .55rem;
    padding: .6rem 0 0;
    border-left: 0;
    border-top: 1px solid var(--whx-grey-light);
    text-align: left;
  }
  .whx-brasile .whx-br-type img { height: 1.45rem; }

  /* The filter bar keeps the cards' phone shape too */
  .whx-brasile .whx-br-filters {
    grid-template-columns: 3.3rem minmax(0, 1fr);
    gap: .6rem 1rem;
    padding: .9rem 1.05rem;
  }
  .whx-brasile .whx-br-f--tier { grid-row: span 2; align-self: start; width: 3.3rem; height: 3.3rem; }
  .whx-brasile .whx-br-f--type {
    grid-column: 2;
    min-height: 2.9rem;
    padding: .6rem 0 0;
    border-left: 0;
    border-top: 1px solid var(--whx-grey-light);
  }
  .whx-brasile .whx-br-f--type .whx-br-f-face { flex-direction: row; justify-content: flex-start; padding: 0 .9rem; gap: .55rem; }
  .whx-brasile .whx-br-f--type .whx-br-f-ph::after { display: inline-block; margin: 0 0 .12rem .5rem; vertical-align: middle; }
  .whx-brasile .whx-br-f--type .whx-br-f-icon { height: 1.45rem; }
  .whx-brasile .whx-br-f--type .whx-br-f-clear { top: -.45rem; right: -.45rem; }
  .whx-brasile .whx-br-f--type.is-set .whx-br-f-face { border: 1px solid var(--whx-grey-light); }
  .whx-brasile .whx-br-f-input { height: 2.75rem; padding: 0 .8rem 0 2.35rem; background-position: .85rem 50%; }
  .whx-brasile .whx-br-f-input::placeholder { font-size: .84rem; }
}
