/* ===== Base ===== */

:root {
  --ink: #111;
  --muted: #666;
  --line: #e5e5e5;
  --band: #f7f5f1;
  /* --line is invisible on the band, so the footer rule has its own tone */
  --band-line: #e2ddd3;
  color-scheme: light;
}

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

/* The band is the page's true ground, so over-scroll below it is not white */
html {
  background: var(--band);
}

html:has(dialog[open]) {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  font-weight: 500;
  line-height: 1.4;
  margin: 0 0 16px;
}

p {
  margin: 0 0 12px;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

/* ===== Age gate ===== */

html:not([data-age-verified]) body[data-age-gate] {
  overflow: hidden;
}

html[data-age-verified] .age-gate {
  display: none;
}

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.age-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90%;
  max-width: 320px;
  text-align: center;
}

.age-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.age-stag {
  width: 84px;
  height: auto;
}

.age-wordmark {
  display: block;
  width: 200px;
  height: auto;
}

.age-box h2 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.age-note {
  margin-bottom: 14px;
  color: #444;
  font-size: 0.9rem;
}

.age-input,
.age-btn {
  display: block;
  width: 100%;
  max-width: 200px;
  padding: 8px 10px;
  font: inherit;
}

.age-input {
  margin: 0 auto 10px;
  border: 1px solid #ccc;
  text-align: center;
}

.age-btn {
  border: none;
  background: #000;
  color: #fff;
  cursor: pointer;
}

.age-btn:hover {
  opacity: 0.9;
}

.age-error {
  min-height: 18px;
  margin-top: 10px;
  color: #b00020;
  font-size: 0.8rem;
}

/* ===== Layout ===== */

.site-header {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px 0;
}

.logo {
  display: inline-block;
  width: 200px;
  height: auto;
}

.page {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.page--narrow {
  max-width: 760px;
  margin: 48px 0 0;
}

@media (min-width: 768px) {
  .site-header {
    padding-top: 40px;
  }

  .logo {
    width: 260px;
  }
}

/* ===== Home ===== */

.home-intro {
  max-width: 620px;
  padding: 56px 0 40px;
}

.home-intro h1 {
  margin-bottom: 12px;
  font-size: 1.45rem;
}

.home-intro__lead {
  margin: 0;
  color: #444;
  font-size: 1rem;
}

/* ===== Ranges ===== */

.range {
  padding: 24px 0 40px;
}

.range__title {
  margin: 0 0 28px;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.product-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 16px;
  max-width: 900px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-card {
  /* Two per row on phones, half the 16px gap taken off each card */
  flex: 0 0 calc(50% - 8px);
  max-width: 240px;
  display: flex;
  flex-direction: column;
}

/* The shot links to the product's page on glenfiddich.com, where there is one */
.product-card__link {
  display: block;
}

.product-card__link:hover {
  opacity: 0.85;
}

.product-card__link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.product-card__shot {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: contain;
}

.product-card__name {
  margin: 16px 0 2px;
  font-size: 0.95rem;
  line-height: 1.5;
  text-wrap: balance;
}

.product-card__en {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
  text-wrap: balance;
}

.product-card__stores {
  display: flex;
  gap: 10px;
  margin: 16px 0 0;
  font-size: 0.8rem;
}

.product-card__stores a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  color: var(--ink);
  line-height: 1.2;
  text-decoration: none;
}

.product-card__stores a:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.product-card__stores a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (min-width: 768px) {
  .range {
    padding: 32px 0 56px;
  }

  .product-grid {
    gap: 56px 40px;
  }

  .product-card {
    flex-basis: 240px;
  }
}

/* ===== Privacy & error pages ===== */

.prose h1 {
  font-size: 1.05rem;
}

.prose h3 {
  margin: 32px 0 8px;
  font-size: 1rem;
  font-weight: 500;
}

.prose p {
  text-align: justify;
}

.prose a {
  color: var(--ink);
}

.prose table {
  display: block;
  overflow-x: auto;
  margin: 0 0 16px;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.prose th,
.prose td {
  padding: 6px 8px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prose dt {
  font-weight: 500;
}

.prose dd {
  margin: 0 0 8px;
}

.prose summary {
  margin-bottom: 12px;
  cursor: pointer;
}

.doc-ref {
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.75rem;
}

.error-page {
  padding-bottom: 80px;
}

.error-page a {
  color: var(--ink);
}

/* ===== Dialogs ===== */

.dialog {
  width: min(90vw, 300px);
  padding: 0;
  border: none;
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.dialog__body {
  position: relative;
  padding: 24px 20px 20px;
  text-align: center;
}

.dialog h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.dialog p {
  margin: 0 0 10px;
  color: #444;
  font-size: 0.9rem;
}

.dialog__qr {
  display: block;
  width: 180px;
  height: auto;
  margin: 14px auto 0;
}

.dialog__close {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 4px 8px;
  border: none;
  background: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

/* ===== Footer ===== */

/* The band runs the full width; only the column inside it lines up with the page */
.site-footer {
  width: 100%;
  margin-top: auto;
  background: var(--band);
  color: var(--muted);
}

.site-footer__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 20px 40px;
}

.footer-mark {
  display: block;
  width: 150px;
  height: auto;
}

/* ===== Footer channels ===== */

/* Margins here are 13px short of the gap they read as, which is the padding
   the links carry to reach a 44px tap target */
.channels {
  margin: 11px 0 0;
}

.channels ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.channels a,
.channels button {
  display: block;
  padding: 13px 0;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.4;
  text-decoration: none;
}

.channels a:hover,
.channels button:hover {
  text-decoration: underline;
}

/* ===== Footer responsibility & legal ===== */

.footer-responsibility {
  margin: 19px 0 0;
  color: var(--ink);
  font-size: 0.95rem;
}

.footer-legal {
  margin: 24px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--band-line);
}

.site-footer small {
  display: block;
  margin: 4px 0;
  font-size: 0.75rem;
  line-height: 1.6;
}

.footer-responsibility > *,
.footer-links > * {
  display: inline;
  white-space: nowrap;
}

.footer-responsibility > * + *::before,
.footer-links > * + *::before {
  content: "·";
  margin: 0 8px;
  color: #a9a196;
}

/* Scoped per zone rather than one blanket .site-footer a, which would otherwise
   win on source order and flatten the channels back to --muted */
.footer-legal a {
  color: inherit;
  text-decoration: none;
}

.footer-legal a:hover {
  color: var(--ink);
  text-decoration: underline;
}

@media (min-width: 768px) {
  .site-footer__inner {
    padding: 88px 20px 48px;
  }

  .footer-mark {
    width: 180px;
  }

  .channels {
    margin-top: 19px;
  }

  .channels ul {
    gap: 0 32px;
  }

  .footer-responsibility {
    margin-top: 31px;
  }

  .footer-legal {
    margin-top: 32px;
    padding-top: 24px;
  }
}
