/* =============================================================
   Funnyeye — CTA + Footer (Brewery Type Specimen / Field Manual)
   -------------------------------------------------------------
   Aesthetic: editorial typography meets industrial brew log.
   The wordmark is the hero (type-as-art), meta info is set in
   monospace like a craft-beer label, gold (#cc9c30) is used as
   a single accent (rules, hover, QR corners).  A faint SVG
   grain overlay keeps the navy from feeling flat.
   ============================================================= */

/* ============================ CTA ============================ */

.fe-cta {
  position: relative;
  padding: 3.5rem var(--spacing--section-left-and-right);
  color: var(--colors--white);
  background-image:
    linear-gradient(180deg, rgba(15, 36, 57, 0.45), rgba(15, 36, 57, 0.65)),
    url("../img/hero/1.png");
  background-position: 50%;
  background-repeat: no-repeat;
  background-size: cover;
  display: flex;
  overflow: hidden;
}

.fe-cta::before {
  /* hairline gold rule at the top edge — signals "entering footer" */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--colors--brand-gold-500) 30%,
    var(--colors--brand-gold-400) 70%,
    transparent 100%);
}

.fe-cta-title {
  font-family: var(--font-display);
  font-size: var(--font-sizes--body-text-large);
  letter-spacing: -0.5px;
  max-width: 680px;
  line-height: 1.2;
  text-transform: none;
}

.fe-cta-wrap {
  max-width: var(--containers--large);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
}

.fe-cta-action { margin-left: auto; }


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

.fe-footer {
  position: relative;
  padding: 4rem var(--spacing--section-left-and-right) 2rem;
  background-color: var(--colors--brand-navy-900);
  color: var(--colors--white);
  /* Subtle paper-grain overlay — SVG noise data URI keeps it
     zero-asset.  4% opacity so it reads as texture, not dirt. */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-repeat: repeat;
  background-size: 160px 160px;
  overflow: hidden;
}

.fe-footer::before {
  /* gold accent rule across the very top edge of the footer */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(204, 156, 48, 0.55) 20%,
    rgba(236, 188, 82, 0.85) 50%,
    rgba(204, 156, 48, 0.55) 80%,
    transparent);
}

.fe-footer > * {
  position: relative;
  z-index: 1;
  max-width: var(--containers--large);
  margin-left: auto;
  margin-right: auto;
}

/* ============================ Brand wordmark zone ============================ */

.fe-footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.fe-footer-wordmark-en,
.fe-footer-wordmark-zh {
  display: flex;
  flex-wrap: wrap;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fe-footer-wordmark-en {
  font-size: clamp(2.5rem, 7.5vw, 5.5rem);
  color: var(--colors--white);
}

.fe-footer-wordmark-zh {
  font-family: var(--font-logo-zh);
  font-size: clamp(1.75rem, 4.5vw, 3rem);
  color: var(--colors--brand-gold-400);
  letter-spacing: 0.18em;
  text-transform: none;
  align-self: flex-end;
}

.fe-footer-glyph {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.4em);
  animation: fe-footer-glyph-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes fe-footer-glyph-rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================ (meta strip removed) ============================
   The `since 2017 / macau 22.198°n / craft brewery` strip was removed
   per design update.  Classes `.fe-footer-meta*` are kept undefined
   so any stale markup simply renders nothing instead of throwing. */
}

/* ============================ Contact — Brew Label Stack ============================
   Address is the hero block: centered eyebrow with side rules, the
   text, then an embedded OpenStreetMap iframe so visitors can verify
   the location without leaving the page.  Phone + email sit below as
   twin pills (icon + label + value).  The whole pill is the anchor. */

.fe-footer-contact {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding: 1.5rem 0 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---- Address hero ---- */

.fe-footer-address {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  width: 100%;
}

.fe-footer-address-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-display);
  font-size: 0.6875rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--colors--brand-gold-400);
}

:lang(zh) .fe-footer-address-eyebrow {
  font-family: var(--font-zh);
  letter-spacing: 0.4em;
  font-size: 0.75rem;
}

.fe-footer-address-rule {
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--colors--brand-gold-500);
  opacity: 0.6;
}

/* Address text is the clickable trigger — opens the full OSM page.
   No underline at rest; gold underline slides in from the left on
   hover (matches the .fe-footer-link treatment elsewhere). */
.fe-footer-address-text {
  position: relative;
  display: inline-block;
  margin: 0;
  padding-bottom: 2px;
  font-family: var(--font-body-en);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--colors--white);
  text-decoration: none;
  max-width: 32ch;
  transition: color 0.2s ease;
}

:lang(zh) .fe-footer-address-text {
  font-family: var(--font-zh);
  letter-spacing: 0.05em;
  line-height: 1.85;
}

.fe-footer-address-text::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--colors--brand-gold-400);
  transition: right 0.3s ease;
}

.fe-footer-address-text:hover,
.fe-footer-address-text:focus-visible {
  color: var(--colors--brand-gold-400);
  outline: none;
}

.fe-footer-address-text:hover::after,
.fe-footer-address-text:focus-visible::after {
  right: 0;
}

/* ---- Embedded map (80% width, default OSM light theme) ---- */

.fe-footer-map {
  width: 80%;
  max-width: 720px;
  margin: 0.5rem auto 0;
}

.fe-footer-map-frame {
  display: block;
  width: 100%;
  height: 220px;
  border: 1px solid rgba(204, 156, 48, 0.45);
  border-radius: 2px;
  /* Default OSM tiles — light/cream background that reads cleanly
     against the navy footer without the prior invert filter.
     This also serves as the Leaflet container background while
     tiles are loading. */
  background: #f4f1ea;
}

/* Leaflet mini-map (replaces former OSM iframe — see lib/footer-map.js).
   Sizes come from the rules above; this block is just the tile
   background + custom gold pin styling. */

/* Strip Leaflet's default white-card treatment from the divIcon
   wrapper so only the styled .fe-footer-map-pin-tip is visible. */
.fe-footer-map-pin {
  background: transparent !important;
  border: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fe-footer-map-pin-tip {
  display: block;
  width: 18px;
  height: 18px;
  background: var(--colors--brand-gold-500);
  border: 2px solid var(--colors--white);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

/* ---- Twin pills (phone + email) ---- */

.fe-footer-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

.fe-footer-pill {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(204, 156, 48, 0.32);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--colors--white);
  text-decoration: none;
  min-width: 0;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.fe-footer-pill:hover,
.fe-footer-pill:focus-visible {
  border-color: var(--colors--brand-gold-400);
  background: rgba(204, 156, 48, 0.08);
  outline: none;
}

.fe-footer-pill-icon {
  width: 28px;
  height: 28px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--colors--brand-gold-500);
  border-radius: 50%;
  color: var(--colors--brand-gold-400);
  transition: transform 0.25s ease;
}

.fe-footer-pill-icon .fe-footer-icon {
  width: 14px;
  height: 14px;
}

.fe-footer-pill:hover .fe-footer-pill-icon,
.fe-footer-pill:focus-visible .fe-footer-pill-icon {
  transform: rotate(-6deg);
}

.fe-footer-pill-label {
  display: none;  /* implicit in the icon — keeps the pill compact */
}

.fe-footer-pill-value {
  font-family: var(--font-display);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  color: var(--colors--white);
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
}

:lang(zh) .fe-footer-pill-value {
  font-family: var(--font-zh);
  letter-spacing: 0.06em;
}

/* ============================ Actions: QR + social ============================ */

.fe-footer-actions {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: 2.5rem;
  padding: 2.25rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  align-items: center;
}

/* ---- QR badge ---- */

.fe-footer-qr {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  /* Button reset so the same class works whether rendered as <a>
     (legacy) or <button> (current — opens a lightbox via the
     data-fe-modal-open trigger instead of navigating). */
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  text-align: left;
  color: inherit;
  text-decoration: none;
  cursor: zoom-in;
  transition: transform 0.25s ease;
}

/* ---- QR row (Wine Shop + WeChat OA side by side) ---- */

.fe-footer-qr-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem 2rem;
  align-items: center;
}

.fe-footer-qr:hover {
  transform: translateY(-2px);
}

.fe-footer-qr:focus-visible {
  outline: 2px solid var(--colors--brand-gold-400);
  outline-offset: 4px;
  border-radius: 2px;
}

.fe-footer-qr-frame {
  position: relative;
  display: inline-block;
  background-color: var(--colors--white);
  padding: 10px;
  border-radius: 2px;
  line-height: 0;
  flex: none;
}

.fe-footer-qr-frame img {
  display: block;
  width: 110px;
  height: 110px;
  object-fit: contain;
}

.fe-footer-qr-corner {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--colors--brand-gold-500);
}

.fe-footer-qr-corner-tl { top: -3px; left: -3px;  border-right: 0; border-bottom: 0; }
.fe-footer-qr-corner-tr { top: -3px; right: -3px; border-left: 0;  border-bottom: 0; }
.fe-footer-qr-corner-bl { bottom: -3px; left: -3px;  border-right: 0; border-top: 0; }
.fe-footer-qr-corner-br { bottom: -3px; right: -3px; border-left: 0;  border-top: 0; }

.fe-footer-qr-caption {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.fe-footer-qr-eyebrow {
  font-family: var(--font-display);
  font-size: 0.6875rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--colors--brand-gold-400);
}

.fe-footer-qr-title {
  font-family: var(--font-body-en);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--colors--white);
}

:lang(zh) .fe-footer-qr-title {
  font-family: var(--font-zh);
  font-weight: 600;
  letter-spacing: 0.1em;
}

/* ---- Social block ---- */

.fe-footer-social {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: flex-end;
}

.fe-footer-social-head {
  font-family: var(--font-display);
  font-size: 0.6875rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--colors--brand-gold-400);
}

.fe-footer-social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  justify-content: flex-end;
}

.fe-footer-social-item {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--colors--white);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  min-height: 44px;
  opacity: 0.78;
  transition: color 0.2s ease, opacity 0.2s ease;
  min-width: 0;
}

.fe-footer-social-item .fe-footer-icon {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--colors--brand-gold-400);
  transition: color 0.2s ease, transform 0.25s ease;
}

.fe-footer-social-item:hover,
.fe-footer-social-item:focus-visible {
  color: var(--colors--brand-gold-400);
  opacity: 1;
  outline: none;
}

.fe-footer-social-item:hover .fe-footer-icon,
.fe-footer-social-item:focus-visible .fe-footer-icon {
  color: var(--colors--brand-gold-400);
  transform: translateY(-2px);
}

.fe-footer-social-placeholder {
  cursor: not-allowed;
  opacity: 0.35;
}

.fe-footer-social-placeholder .fe-footer-icon {
  color: rgba(255, 255, 255, 0.45);
}

/* ============================ Baseline ============================ */

.fe-footer-baseline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding-top: 1.5rem;
  font-family: var(--font-display);
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.fe-footer-copy {
  display: inline-flex;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.fe-footer-copy-brand {
  color: var(--colors--brand-gold-400);
  font-weight: 700;
}

.fe-footer-law {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.fe-footer-law-dot {
  color: var(--colors--brand-gold-500);
  opacity: 0.6;
}

.fe-footer-law .fe-modal-link {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  transition: color 0.2s ease;
  position: relative;
}

.fe-footer-law .fe-modal-link::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -3px;
  height: 1px;
  background: var(--colors--brand-gold-400);
  transition: right 0.3s ease;
}

.fe-footer-law .fe-modal-link:hover,
.fe-footer-law .fe-modal-link:focus-visible {
  color: var(--colors--brand-gold-400);
  outline: none;
}

.fe-footer-law .fe-modal-link:hover::after,
.fe-footer-law .fe-modal-link:focus-visible::after {
  right: 0;
}

/* ============================ Icons (shared) ============================ */

.fe-footer-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  color: currentColor;
  flex: none;
}

.fe-footer-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ============================ Links (shared) ============================ */

.fe-footer-link {
  color: var(--colors--white);
  text-decoration: none;
  position: relative;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: inline-block;
  max-width: 100%;
  transition: color 0.2s ease;
}

.fe-footer-link::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 1px;
  background: var(--colors--brand-gold-400);
  transition: right 0.3s ease;
}

.fe-footer-link:hover,
.fe-footer-link:focus-visible {
  color: var(--colors--brand-gold-400);
  outline: none;
}

.fe-footer-link:hover::after,
.fe-footer-link:focus-visible::after {
  right: 0;
}

:lang(zh) .fe-footer-link {
  letter-spacing: 0.04em;
}

/* ============================ Breakpoints ============================ */

@media (max-width: 991px) {
  .fe-footer { padding: 3rem var(--spacing--section-left-and-right) 1.75rem; }

  .fe-footer-actions {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    justify-items: flex-start;
  }

  .fe-footer-qr-row {
    gap: 1.25rem 1.5rem;
  }

  .fe-footer-social {
    align-items: flex-start;
    width: 100%;
  }

  .fe-footer-social-row {
    justify-content: flex-start;
  }
}

@media (max-width: 767px) {
  .fe-cta { padding: 2.5rem var(--spacing--section-left-and-right); }

  .fe-footer { padding: 2.5rem var(--spacing--section-left-and-right) 1.5rem; }

  .fe-footer-contact {
    gap: 1.75rem;
  }

  .fe-footer-map-frame {
    height: 180px;
  }

  .fe-footer-pills {
    grid-template-columns: minmax(0, 1fr);
  }

  .fe-footer-baseline {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

@media (max-width: 479px) {
  .fe-footer-qr-frame img {
    width: 88px;
    height: 88px;
  }

  .fe-footer-map-frame {
    height: 160px;
  }

  .fe-footer-address-text {
    font-size: 0.9375rem;
  }

  .fe-footer-pill {
    padding: 0.75rem 0.85rem;
    gap: 0.65rem;
  }

  .fe-footer-pill-value {
    font-size: 0.8125rem;
  }

  /* Tiny screens: keep social icons, drop labels */
  .fe-footer-social-label { display: none; }
}

@media (max-width: 479px) {
  .fe-footer-qr-frame img {
    width: 88px;
    height: 88px;
  }

  /* Tiny screens: keep social icons, drop labels */
  .fe-footer-social-label { display: none; }
}

/* ============================ Reduced motion ============================ */

@media (prefers-reduced-motion: reduce) {
  .fe-footer-glyph {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .fe-footer-link::after,
  .fe-footer-law .fe-modal-link::after {
    transition: none;
  }

  .fe-footer-qr,
  .fe-footer-social-item,
  .fe-footer-social-item .fe-footer-icon {
    transition: none;
  }
}