@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  --text-color: #592C38;
  --bg: #F3ECDC;
  --nav-gap: 28px;
  --nav-font-size: 18px;
  --dropdown-bg: rgba(242, 240, 208, 0.98);
  --dropdown-border: rgba(89, 44, 56, 0.06);
  --border: rgba(89, 44, 56, 0.15);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  font-family: 'EB Garamond', Georgia, serif;
  background: var(--bg);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── NAVIGATION ── */
nav ul, nav a, nav button {
  font-family: 'EB Garamond', serif !important;
}

.nav-wrap {
  display: flex;
  justify-content: center;
  padding: 18px 24px;
  background: transparent;
}

.hamburger { display: none; }

nav ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: var(--nav-gap);
  align-items: center;
  font-size: var(--nav-font-size);
}

nav li { position: relative; }

nav a, nav button {
  color: var(--text-color);
  text-decoration: none;
  background: none;
  border: none;
  padding: 6px 8px;
  cursor: pointer;
  font: inherit;
}

nav a:hover, nav button:hover { opacity: 0.7; }
nav a.active { border-bottom: 1px solid var(--text-color); }

.dropdown {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 100%;
  min-width: 180px;
  background: var(--dropdown-bg);
  border: 1px solid var(--dropdown-border);
  border-radius: 6px;
  padding: 8px 0;
  box-shadow: 0 8px 20px rgba(0,0,0,0.04);
  display: none;
  z-index: 200;
}

.dropdown a {
  display: block;
  padding: 8px 20px;
  text-decoration: none;
  color: var(--text-color);
  font-size: 16px;
}

.dropdown a:hover { background: rgba(89,44,56,0.06); }

nav li:hover > .dropdown,
nav li:focus-within > .dropdown { display: block; }

/* ── MAIN ── */
main {
  flex: 1;
  padding: 60px 24px 80px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* ── PAGE HEADER ── */
.page-header {
  text-align: center;
  margin-bottom: 52px;
}

.page-header h1 {
  font-size: 36px;
  font-weight: 400;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}

.page-subtitle {
  font-size: 15px;
  opacity: 0.65;
  margin: 0;
  font-style: italic;
}

/* ── GRID ── */
.wijnmaker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

/* ── CARD WRAP ── */
.wijnmaker-card-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── FLIP CARD ── */
.wijnmaker-card {
  width: 100%;
  aspect-ratio: 3 / 4;
  perspective: 1000px;
  cursor: pointer;
  position: relative;
}

.wijnmaker-flip-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1.1s ease;
}

.wijnmaker-card.is-flipped .wijnmaker-flip-inner {
  transform: rotateY(180deg);
}

.wijnmaker-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(89,44,56,0.10);
  border: 1px solid var(--border);
}

/* FRONT */
.wijnmaker-front {
  background: rgba(243,236,220,0.6);
  display: flex;
  flex-direction: column;
}

.wijnmaker-front img {
  width: 100%;
  flex: 1;
  object-fit: cover;
  display: block;
  min-height: 0;
}

.wijnmaker-info {
  background: rgba(243,236,220,0.95);
  padding: 12px 14px;
  text-align: center;
  border-top: 1px solid rgba(89,44,56,0.10);
  flex-shrink: 0;
}

.wijnmaker-info h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.wijnmaker-info p {
  margin: 4px 0 0;
  font-size: 12px;
  opacity: 0.7;
  font-style: italic;
}

/* BACK */
.wijnmaker-back {
  transform: rotateY(180deg);
  background: rgba(243,236,220,0.98);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0 16px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.back-inner {
  width: 100%;
  text-align: center;
  padding: 22px 0;
}

.wijnmaker-back h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
}

.wijnmaker-location {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.5;
  margin: 0 0 14px;
}

.wijnmaker-description {
  font-size: 13px;
  line-height: 1.55;
  text-align: justify;
  opacity: 0.85;
  margin: 0;
}

/* ── FLIP HINT ── */
.flip-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-color);
  opacity: 0.38;
  margin: 8px 0 0;
  letter-spacing: 0.03em;
  pointer-events: none;
  user-select: none;
}

/* ── FOCUS ── */
.wijnmaker-card:focus-within .wijnmaker-face {
  outline: 2px solid rgba(89,44,56,0.2);
  outline-offset: 3px;
}

/* ── FOOTER ── */
footer {
  margin-top: auto;
  padding: 10px 20px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  opacity: 0.85;
}


/* ── TABLET ── */
@media (max-width: 900px) {
  .wijnmaker-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

/* ── MOBILE ── */
@media (max-width: 720px) {

  .hamburger {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: transparent;
    border: none;
    width: 44px;
    height: 44px;
    padding: 8px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: absolute;
    left: 16px;
    top: 12px;
    z-index: 1100;
  }

  .hamburger .line {
    width: 20px;
    height: 4px;
    background: #592C38;
    border-radius: 3px;
    transition: transform .25s ease, opacity .2s ease;
    display: block;
  }

  .hamburger[aria-expanded="true"] .line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .hamburger[aria-expanded="true"] .line:nth-child(2) { opacity: 0; }
  .hamburger[aria-expanded="true"] .line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  nav ul { display: none; }

  .nav-wrap.open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 900;
    pointer-events: none;
  }

  .nav-wrap.open nav ul {
    display: flex;
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    width: 280px;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--bg);
    z-index: 950;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
    align-items: flex-start;
  }

  .nav-wrap.open nav ul li { width: 100%; }

  .nav-wrap.open nav ul a,
  .nav-wrap.open nav ul button {
    display: block;
    width: 100%;
    padding: 12px 14px;
    text-align: left;
    font-size: 16px;
  }

  .nav-wrap.open nav ul .dropdown {
    position: static;
    transform: none;
    background: rgba(89,44,56,0.06);
    border: none;
    box-shadow: none;
    padding: 0;
    display: flex !important;
    flex-direction: column;
    width: 100%;
    margin-top: 4px;
  }

  .nav-wrap.open nav ul .dropdown a {
    padding: 8px 14px;
    font-size: 14px;
  }

  main {
    padding: 40px 16px 60px;
  }

  .page-header h1 {
    font-size: 26px;
  }

  .wijnmaker-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 360px;
    margin: 0 auto;
  }

  footer { font-size: 12px; }
}