:root {
  --paper: #fbfaf7;
  --surface: #ffffff;
  --ink: #1f211f;
  --muted: #666a64;
  --line: #ded9cf;
  --wine: #7c1f31;
  --forest: #214f3d;
  --sage: #dfe7d6;
  --brass: #b78334;
  --shadow: 0 18px 40px rgba(31, 33, 31, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

body.is-dialog-open {
  overflow: hidden;
}

body.is-dialog-fallback-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 16, 14, 0.72);
  backdrop-filter: blur(4px);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.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;
}

.hero {
  min-height: 55vh;
  display: flex;
  align-items: flex-end;
  background-image:
    linear-gradient(90deg, rgba(15, 22, 17, 0.84), rgba(15, 22, 17, 0.48) 58%, rgba(15, 22, 17, 0.12)),
    url("assets/pdf-images/page-01-img-01-obj-1307.jpg");
  background-position: center 48%;
  background-size: cover;
}

.hero__inner {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0 44px;
  color: #fff;
}

.hero__brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 10px 14px 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.36);
}

.hero__brand img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
}

.hero__brand strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  line-height: 1;
}

.eyebrow {
  margin: 0 0 10px;
  color: #f2d7a4;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.4rem;
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: 0;
}

.hero__copy {
  max-width: 660px;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.06rem;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero__meta span,
.hero__meta a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.hero__instagram {
  border-color: rgba(242, 215, 164, 0.68) !important;
  background: rgba(124, 31, 49, 0.72) !important;
  font-weight: 800;
}

.hero__meta strong {
  color: #f6d99d;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 247, 0.96);
  backdrop-filter: blur(14px);
}

.toolbar__inner {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 14px 0;
  display: grid;
  grid-template-columns: minmax(250px, 1fr);
  gap: 10px;
}

.search input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.search input:focus {
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(124, 31, 49, 0.14);
}

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-btn {
  min-height: 40px;
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: #b8ad9e;
}

.filter-btn[aria-pressed="true"] {
  border-color: var(--wine);
  background: var(--wine);
  color: #fff;
}

.filter-row--types .filter-btn[aria-pressed="true"] {
  border-color: var(--forest);
  background: var(--forest);
}

.summary-band {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.summary-band__inner {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 14px 0;
}

.summary-band p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.wine-sections {
  padding-bottom: 28px;
}

.country-section {
  padding: 38px 0 18px;
}

.country-section:nth-child(even) {
  background: #f1f5ed;
}

.country-inner {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
}

.country-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.country-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  letter-spacing: 0;
}

.country-heading span {
  color: var(--muted);
  white-space: nowrap;
}

.wine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
  align-items: start;
}

.wine-card {
  --accent: var(--wine);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.wine-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 54px rgba(31, 33, 31, 0.14);
}

.wine-card__image {
  position: relative;
  height: 280px;
  display: grid;
  place-items: center;
  margin: -18px -18px 0;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(33, 79, 61, 0.08), rgba(183, 131, 52, 0.08)),
    #f8f6f1;
}

.wine-card__image img {
  position: absolute;
  inset: 22px;
  width: calc(100% - 44px);
  height: calc(100% - 44px);
  display: block;
  object-fit: contain;
  object-position: center;
}

.wine-card__body {
  padding: 18px;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
}

.wine-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid rgba(31, 33, 31, 0.1);
  border-radius: 999px;
  background: #f7f3ec;
  color: #4c463d;
  font-size: 0.8rem;
}

.pill--accent {
  border-color: transparent;
  background: color-mix(in srgb, var(--accent) 14%, #fff);
  color: var(--accent);
  font-weight: 700;
}

.wine-card h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  line-height: 1.18;
  letter-spacing: 0;
}

.variant {
  margin: -8px 0 0;
  color: var(--brass);
  font-weight: 700;
}

.fact-list {
  display: grid;
  gap: 9px;
  margin: 0;
}

.fact-list div {
  display: grid;
  gap: 2px;
}

.fact-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.fact-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.card-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.card-highlight {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.card-highlight--wide {
  grid-column: 1 / -1;
}

.card-highlight span {
  display: block;
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.card-highlight strong {
  display: block;
  color: #272925;
  font-size: 0.94rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.card-preview {
  margin: 0;
  padding-left: 11px;
  border-left: 3px solid var(--accent);
  color: #4a4d47;
  font-size: 0.93rem;
  line-height: 1.45;
}

.card-action {
  min-height: 44px;
  margin-top: auto;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.card-action:hover,
.card-action:focus-visible {
  filter: brightness(0.92);
  outline: none;
}

.card-action:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 26%, #fff);
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}

.image-thumb {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f6f1;
}

.image-thumb img {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: contain;
  padding: 6px;
}

.image-thumb figcaption {
  min-height: 30px;
  padding: 4px 6px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.2;
  text-align: center;
}

.region-media {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.region-media__item {
  display: grid;
  grid-template-columns: minmax(96px, 0.42fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.region-media__cover {
  min-height: 150px;
  background: #ece7dc;
}

.region-media__cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.region-media__body {
  min-width: 0;
  padding: 12px;
}

.region-media__body h3 {
  margin: 0 0 3px;
  font-size: 1rem;
}

.region-media__body > span {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.region-media .image-gallery {
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
}

.region-media .image-thumb figcaption {
  display: none;
}

.wine-dialog {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(1160px, calc(100% - 28px));
  max-width: none;
  max-height: calc(100vh - 24px);
  max-height: calc(100svh - 24px);
  max-height: calc(100dvh - 24px);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
}

.wine-dialog:not([open]) {
  display: none;
}

.wine-dialog[open] {
  display: block;
}

.wine-dialog--fallback {
  z-index: 90;
}

.wine-dialog::backdrop {
  background: rgba(15, 16, 14, 0.72);
  backdrop-filter: blur(4px);
}

.wine-dialog__panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  max-height: calc(100vh - 24px);
  max-height: calc(100svh - 24px);
  max-height: calc(100dvh - 24px);
}

.wine-dialog__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: #1f211f;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.wine-dialog__layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  max-height: calc(100vh - 24px);
  max-height: calc(100svh - 24px);
  max-height: calc(100dvh - 24px);
}

.wine-dialog__media {
  min-height: 0;
  height: 760px;
  height: min(760px, calc(100vh - 24px));
  height: min(760px, calc(100svh - 24px));
  height: min(760px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  display: grid;
  grid-template-rows: minmax(360px, 1fr) auto;
  gap: 12px;
  padding: 24px;
  background:
    linear-gradient(160deg, rgba(33, 79, 61, 0.16), rgba(183, 131, 52, 0.12)),
    #f4f0e8;
}

.wine-dialog__main-image {
  position: relative;
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  cursor: zoom-in;
  overflow: hidden;
  text-decoration: none;
  touch-action: manipulation;
}

.wine-dialog__main-image img {
  position: absolute;
  inset: 18px;
  width: calc(100% - 36px);
  height: calc(100% - 36px);
  display: block;
  object-fit: contain;
  object-position: center;
}

.dialog-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
  max-height: 156px;
  overflow: auto;
  padding-right: 3px;
}

.dialog-thumb {
  min-height: 74px;
  aspect-ratio: 1 / 1;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  touch-action: manipulation;
}

.dialog-thumb[aria-current="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.dialog-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.wine-dialog__content {
  min-height: 0;
  overflow: auto;
  max-height: calc(100dvh - 24px);
  padding: 30px 30px 80px;
}

.wine-dialog__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 70px 14px 0;
}

.wine-dialog h2 {
  margin: 0 70px 8px 0;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  line-height: 1.12;
}

.dialog-variant {
  margin: 0 0 18px;
  color: var(--brass);
  font-weight: 800;
}

.dialog-facts {
  display: grid;
  gap: 10px;
  margin: 0 0 24px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dialog-facts div,
.dialog-details section {
  display: grid;
  gap: 4px;
}

.dialog-facts dt,
.dialog-details h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dialog-facts dd {
  margin: 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.dialog-details {
  display: grid;
  gap: 12px;
}

.dialog-details section {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.dialog-details p {
  margin: 0;
  color: #333631;
  font-size: 1rem;
  line-height: 1.62;
}

.empty-state {
  width: min(720px, calc(100% - 28px));
  margin: 42px auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
  color: var(--muted);
}

.contact-section {
  padding: 38px 0;
  border-top: 1px solid var(--line);
  background: #fff;
}

.contact-section__inner {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.contact-section img {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  object-fit: cover;
}

.contact-section .eyebrow {
  margin-bottom: 6px;
  color: var(--wine);
}

.contact-section h2 {
  margin: 0 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  color: var(--forest);
}

.contact-section p {
  margin-bottom: 0;
  color: var(--muted);
}

.contact-section a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--wine);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 22px max(14px, calc((100% - 1120px) / 2));
  border-top: 1px solid var(--line);
  background: #20231f;
  color: #fff;
}

.footer__brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.footer__brand img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
}

.footer__brand div {
  display: grid;
  gap: 3px;
}

.footer span {
  color: #d8c29a;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer a {
  color: #f0d49d;
  text-decoration: none;
}

@media (min-width: 860px) {
  .toolbar__inner {
    grid-template-columns: minmax(290px, 0.9fr) minmax(300px, 1.2fr);
    align-items: center;
  }

  .filter-row--types {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .hero {
    min-height: 50vh;
  }

  .hero__inner {
    width: min(100% - 28px, 1120px);
    padding: 58px 0 32px;
  }

  h1 {
    font-size: 2.35rem;
  }

  .hero__copy {
    font-size: 1rem;
  }

  .hero__brand img {
    width: 58px;
    height: 58px;
  }

  .country-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .country-heading span {
    white-space: normal;
  }

  .wine-card__image {
    height: 250px;
  }

  .region-media__item {
    grid-template-columns: 1fr;
  }

  .region-media__cover {
    height: 170px;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .contact-section__inner {
    grid-template-columns: 1fr;
    justify-items: start;
  }
}

@media (max-width: 820px) {
  .wine-dialog {
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
    max-height: calc(100svh - 16px);
    max-height: calc(100dvh - 16px);
  }

  .wine-dialog__panel {
    max-height: calc(100vh - 16px);
    max-height: calc(100svh - 16px);
    max-height: calc(100dvh - 16px);
  }

  .wine-dialog__layout {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 16px);
    max-height: calc(100svh - 16px);
    max-height: calc(100dvh - 16px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .wine-dialog__media {
    height: auto;
    max-height: none;
    grid-template-rows: auto auto;
    gap: 10px;
    padding: 14px;
  }

  .wine-dialog__main-image {
    height: min(52vh, 410px);
    height: min(52svh, 410px);
    height: min(52dvh, 410px);
    min-height: 260px;
  }

  .wine-dialog__main-image img {
    inset: 12px;
    width: calc(100% - 24px);
    height: calc(100% - 24px);
  }

  .dialog-thumbs {
    display: flex;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 3px 8px;
    scroll-snap-type: x proximity;
  }

  .dialog-thumb {
    flex: 0 0 68px;
    min-height: 68px;
    scroll-snap-align: start;
  }

  .wine-dialog__content {
    overflow: visible;
    max-height: none;
    padding: 22px 18px 60px;
  }

  .wine-dialog h2,
  .wine-dialog__meta {
    margin-right: 86px;
  }
}
