/***** Base & Tokens *****/
:root {
  --bg: #0f0e0d;
  --bg-soft: #171514;
  --card: #201e1c;
  --ink: #f6f3ee;
  --muted: #c9c4bc;
  --accent: #b22d2a;    /* Rioja red */
  --accent-2: #e0a04a;  /* warm saffron */
  --border: #2c2927;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth; /* Adds smooth scrolling for anchor links */
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto;
  line-height: 1.5;
}

img {
  max-width: 100%;
  display: block;
  border-radius: 12px;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1120px, 92%);
  margin: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  background: #000;
  color: #fff;
  padding: .5rem .75rem;
  border-radius: 10px;
  z-index: 100;
}

/***** Announcement *****/
.announcement {
  background: linear-gradient(90deg, rgba(178,45,42,.15), rgba(224,160,74,.15));
  color: var(--ink);
  padding: .6rem 1rem;
  text-align: center;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.status-badge {
  margin-left: .6rem;
  padding: .25rem .6rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  background: #333;
  color: #ddd;
  border: 1px solid var(--border);
}

.status-badge.open {
  background: rgba(61,142,66,.18);
  color: #a9f3af;
  border-color: #2e4a30;
}

.status-badge.closed {
  background: rgba(178,45,42,.18);
  color: #ffb3ab;
  border-color: #4a2e2e;
}

/***** Header *****/
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(15,14,13,.8);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .8rem 0;
}

.brand {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-text {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 1.35rem;
}

.brand-tag {
  font-size: .8rem;
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  padding: .6rem .8rem;
  border-radius: 10px;
}

.site-nav a:hover {
  background: rgba(255,255,255,.06);
}

.site-nav a[aria-current] {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 10px;
}

.small-cta {
  margin-left: .5rem;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  border-radius: 2px;
}

/***** Buttons *****/
.btn {
  display: inline-block;
  padding: .85rem 1.1rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  letter-spacing: .2px;
  box-shadow: var(--shadow);
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent), #8f211f);
  border-color: #701a19;
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-ghost {
  background: transparent;
  border-color: #4a403a;
}

.btn-ghost:hover {
  background: rgba(255,255,255,.06); /* UPDATED for consistency */
}

.btn.full {
  width: 100%;
}

/***** Hero *****/
.hero {
  position: relative;
  min-height: 82vh;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 780px;
  padding: 6rem 0 3rem;
}

.hero h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  margin: 0 0 .7rem;
}

.hero h1 span {
  color: var(--accent-2);
}

.hero p {
  color: #e8e2da;
  margin: 0 0 1.2rem;
}

.cta-row {
  display: flex;
  gap: .7rem;
  justify-content: center;
}

.scroll-indicator {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  opacity: .7;
  z-index: 2;
}

/* Slideshow background */
.hero-slideshow {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-slideshow::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,.65));
  z-index: 2;
  pointer-events: none;
}

.hero-slideshow .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 1;
  background-size: cover;
  background-position: center;
  animation: heroFade 40s infinite;
  will-change: opacity; /* Performance hint */
}

.hero-slideshow .slide::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: inherit;
  background-size: cover;
  animation: heroPan 8s linear infinite alternate;
  will-change: background-position; /* Performance hint */
}

.hero-slideshow .slide:nth-child(1) { animation-delay: 0s; }
.hero-slideshow .slide:nth-child(2) { animation-delay: 8s; }
.hero-slideshow .slide:nth-child(3) { animation-delay: 16s; }
.hero-slideshow .slide:nth-child(4) { animation-delay: 24s; }
.hero-slideshow .slide:nth-child(5) { animation-delay: 32s; }

@keyframes heroFade {
  0%, 20% { opacity: 1; }
  25%, 100% { opacity: 0; }
}

@keyframes heroPan {
  0% { background-position: left; }
  100% { background-position: right; }
}

/* Reduced motion: freeze slideshow */
@media (prefers-reduced-motion: reduce) {
  .hero-slideshow .slide {
    animation: none;
    opacity: 1;
  }
  .hero-slideshow .slide:not(:first-child) {
    display: none;
  }
}

/***** Sections *****/
.section {
  padding: 4.5rem 0;
  border-bottom: 1px solid var(--border);
}

.section h2 {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 1rem;
}

.grid-2 {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1.2fr .8fr;
}

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/***** About / Menu card *****/
.about .about-copy p {
  color: #e7e2db;
}

.bullets {
  margin: 1rem 0;
  padding-left: 1.1rem;
}

.bullets li {
  margin: .35rem 0;
}

.card {
  background: linear-gradient(180deg, #1e1b19, #171514);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.menu-card h3 {
  margin-top: 0;
  font-family: "Playfair Display", serif;
}

.menu-list {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  display: grid;
  gap: .6rem;
}

.menu-list li {
  display: flex;
  justify-content: space-between;
  padding: .6rem .75rem;
  background: #141312;
  border: 1px dashed #3a3330;
  border-radius: 12px;
}

/***** Whole jamon tighter layout *****/
.whole-jamon-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem;
}

.whole-jamon-item {
  padding: .6rem .7rem;
}

.whole-jamon-item img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: .4rem;
}

.whole-jamon-item h3 {
  margin: 0 0 .2rem;
  font-family: "Playfair Display", serif;
  font-size: .95rem;
}

.wj-weight {
  margin: 0 0 .2rem;
  color: var(--muted);
  font-size: .85rem;
}

.wj-price {
  margin: 0;
  font-weight: 700;
  color: var(--accent-2);
  font-size: .95rem;
}

@media (max-width: 900px) {
  .whole-jamon-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
  }
}

@media (max-width: 600px) {
  .whole-jamon-grid {
    grid-template-columns: 1fr;
    gap: .7rem;
  }
}

/***** Feature strip *****/
.strip {
  padding: 2.2rem 0;
}

.strip-inner {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, 1fr);
}

.strip-item {
  background: #161413;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
}

.strip h4 {
  margin: .2rem 0 .4rem;
  font-family: "Playfair Display", serif;
}

@media (max-width: 900px) {
  .strip-inner { grid-template-columns: 1fr; }
}

/***** Hours *****/
.hours-card h3 {
  margin-top: 0;
  font-family: "Playfair Display", serif;
}

.hours-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .4rem;
}

.hours-list li {
  display: flex;
  justify-content: space-between;
  padding: .55rem .75rem;
  background: #141312;
  border: 1px solid #2e2a27;
  border-radius: 12px;
}

/***** Find us / Map & Gallery *****/
.findus .map-card h2 {
  margin-top: 0;
}

.map-embed {
  margin-top: .6rem;
  aspect-ratio: 16/10;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.map-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  box-sizing: border-box; /* Added for robustness */
}

.gallery h3 {
  margin-top: 0;
  font-family: "Playfair Display", serif;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .6rem;
}

@media (max-width: 700px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

/***** Footer *****/
.site-footer {
  background: #0c0b0a;
  padding: 2rem 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  align-items: center;
}

.footer-brand {
  display: flex;
  flex-direction: column;
}

.footer-brand strong {
  font-family: "Playfair Display", serif;
  font-size: 1.2rem;
}

.footer-nav {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.footer-nav a {
  padding: .5rem .8rem;
  border-radius: 10px;
}

.footer-nav a:hover {
  background: #161413;
}

.footer-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
}

.socials a {
  display: inline-flex;
  padding: .4rem;
  border-radius: 0;
  background: #141312;
  border: 1px solid #2a2623;
}

.social-icon {
  width: 20px;
  height: 25px;
}

.socials a:hover {
  background: #1c1917;
}

@media (max-width: 840px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1rem;
    text-align: center;
  }
  .footer-meta {
    justify-content: center;
  }
}

/***** Mobile Nav *****/
@media (max-width: 860px) {
  .nav-toggle {
    display: block;
  }
  .site-nav {
    position: absolute;
    right: 1rem;
    top: 64px;
    background: #141312;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: .75rem;
    display: none; /* Safely hides links from keyboard focus when closed */
    flex-direction: column;
    gap: .5rem;
    min-width: 220px;
  }
  .site-nav.open {
    display: flex;
  }
  .site-nav ul {
    flex-direction: column;
  }
  .small-cta {
    display: block;
    width: 100%;
    text-align: center;
  }
}

/***** Focus styles *****/
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}