/* ===================================================================
   Pedra do Gigante — Restaurante de Marisco em Sagres
   =================================================================== */

:root {
  --black: #1c1b16;
  --red: #e12124;
  --red-dark: #b91619;
  --gold: #f5b942;
  --gold-bright: #ffd876;

  --navy-deep: #081119;
  --navy: #0b1420;
  --navy-mid: #12283a;
  --teal: #0f2e3d;

  --cream: #fbf6ec;
  --cream-dim: #f3ead9;
  --ink: #201f1a;
  --ink-soft: #55524a;

  --font-head: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container: 1180px;
  --radius: 14px;
  --shadow-soft: 0 10px 40px rgba(8, 17, 25, 0.18);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
body, h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: 0; cursor: pointer; }
iframe { border: 0; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

h1, h2, h3 { font-family: var(--font-head); font-weight: 700; color: var(--black); line-height: 1.15; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--gold);
  color: var(--black);
  padding: 12px 18px;
  z-index: 1000;
  font-weight: 600;
}
.skip-link:focus { left: 12px; top: 12px; border-radius: 8px; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  min-height: 44px;
  white-space: nowrap;
}
.btn--primary { background: var(--red); color: #fff; box-shadow: 0 8px 24px rgba(225, 33, 36, 0.35); }
.btn--primary:hover { background: var(--red-dark); transform: translateY(-2px); }
.btn--ghost {
  background: transparent;
  color: var(--cream);
  border: 1.5px solid rgba(251, 246, 236, 0.55);
}
.btn--ghost:hover { background: rgba(251, 246, 236, 0.12); border-color: var(--cream); transform: translateY(-2px); }
.btn--large { padding: 16px 34px; font-size: 1rem; }
.btn--small { padding: 10px 20px; font-size: 0.8rem; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  padding-block: 14px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}
.site-header.is-scrolled {
  background: rgba(251, 246, 236, 0.9);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 24px rgba(28, 27, 22, 0.1);
  padding-block: 8px;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-nav ul { display: flex; gap: 26px; }
.site-nav a:not(.btn) {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 4px;
}
.site-nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.site-nav a:not(.btn):hover::after { transform: scaleX(1); }

/* On tablet/desktop the header "Reservar" button stays hidden until the hero
   CTA has scrolled out of view (JS toggles .is-visible). The empty slot keeps
   its space so the nav links don't jump when it fades in. On mobile (≤760px)
   the button lives inside the slide-out menu and is always shown. */
@media (min-width: 761px) {
  .nav-reserve {
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  .nav-reserve.is-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  z-index: 110;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: 120px 90px;
  background: var(--cream);
}
.hero__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}


/* ---------- Hero logo (full lockup with animated lighthouse light) ----------
   The glow layers are positioned as a percentage of the full logo box so
   they sit precisely over the lamp room of the lighthouse mark:
   lamp window centre ≈ 26.5% / 9.5%, beam lines ≈ 32% / 7%. */
.hero-logo {
  position: relative;
  width: min(760px, 90vw);
  aspect-ratio: 915 / 435;
  margin-bottom: 4px;
}
.hero-logo__img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.hero-logo__halo,
.hero-logo__core,
.hero-logo__beam {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
/* Soft ambient halo bleeding out from the lamp onto the page */
.hero-logo__halo {
  left: 26.5%;
  top: 9.5%;
  z-index: 1;
  width: 17%;
  aspect-ratio: 1;
  background: radial-gradient(circle,
    rgba(255, 206, 105, 0.6) 0%,
    rgba(255, 188, 74, 0.3) 38%,
    rgba(255, 188, 74, 0) 70%);
  filter: blur(5px);
  animation: lamp-breathe 4.5s ease-in-out infinite;
}
/* Bright hot light inside the lamp window — kept small so the lamp
   housing stays visible and the glow reads as light from within. */
.hero-logo__core {
  left: 26.5%;
  top: 9.7%;
  z-index: 3;
  width: 4%;
  aspect-ratio: 1;
  background: radial-gradient(circle,
    #fffdf4 0%,
    #fff0b8 34%,
    rgba(255, 210, 96, 0.55) 60%,
    rgba(255, 200, 80, 0) 82%);
  animation: lamp-core 4.5s ease-in-out infinite;
}
/* Warm glow washing over the three beam lines to the right of the lamp */
.hero-logo__beam {
  left: 32%;
  top: 7.1%;
  z-index: 3;
  width: 15%;
  aspect-ratio: 2.4 / 1;
  border-radius: 50%;
  background: radial-gradient(ellipse closest-side,
    rgba(255, 214, 110, 0.95) 0%,
    rgba(255, 205, 90, 0.5) 45%,
    rgba(255, 205, 90, 0) 78%);
  filter: blur(2px);
  /* Screen lights up the black beam strokes to gold while leaving the
     surrounding cream page virtually untouched. */
  mix-blend-mode: screen;
  animation: beam-flicker 4.5s ease-in-out infinite;
}

@keyframes lamp-breathe {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(0.9); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.18); }
}
@keyframes lamp-core {
  0%, 100% { opacity: 0.85; transform: translate(-50%, -50%) scale(0.94); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}
@keyframes beam-flicker {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scaleX(0.94); }
  50% { opacity: 0.95; transform: translate(-50%, -50%) scaleX(1.06); }
}

.hero__tagline {
  color: var(--ink-soft);
  font-size: clamp(1rem, 2vw, 1.2rem);
  max-width: 42ch;
  margin-top: 6px;
  font-weight: 400;
}
.hero__ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 30px;
}
/* Ghost button reads dark on the light hero (base style targets dark sections) */
.hero__ctas .btn--ghost { color: var(--ink); border-color: rgba(28, 27, 22, 0.35); }
.hero__ctas .btn--ghost:hover { background: rgba(28, 27, 22, 0.06); border-color: var(--ink); }

.hero__scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 46px;
  border: 1.5px solid rgba(28, 27, 22, 0.28);
  border-radius: 20px;
}
.hero__scroll span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  background: var(--gold);
  border-radius: 3px;
  transform: translateX(-50%);
  animation: scroll-dot 1.8s ease-in-out infinite;
}
@keyframes scroll-dot {
  0% { opacity: 1; top: 8px; }
  70% { opacity: 0; top: 24px; }
  100% { opacity: 0; top: 8px; }
}

/* ---------- Sections (shared) ---------- */
.section { padding-block: 88px; }
.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 600;
  margin-bottom: 10px;
}
.eyebrow--center { text-align: center; }
.section__title--center { text-align: center; }
.section__intro {
  max-width: 60ch;
  margin: 14px auto 0;
  text-align: center;
  color: var(--ink-soft);
}

/* ---------- About ---------- */
.section--about { background: var(--cream); }
.about__grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 56px;
  align-items: center;
}
.about__media-frame {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(160deg, var(--teal), var(--navy-mid));
  box-shadow: var(--shadow-soft);
}
.about__media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.about__text h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 18px; }
.about__text p { color: var(--ink-soft); margin-bottom: 16px; max-width: 58ch; }
.about__highlights { margin-top: 22px; display: grid; gap: 10px; }
.about__highlights li {
  padding-left: 26px;
  position: relative;
  font-weight: 500;
  color: var(--black);
}
.about__highlights li::before {
  content: "";
  position: absolute;
  left: 0; top: 8px;
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
}

/* ---------- Menu (category tabs + item lists) ---------- */
.section--menu { background: var(--cream-dim); }

.menu-tabs {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.menu-tab {
  padding: 10px 22px;
  border-radius: 999px;
  border: 1.5px solid rgba(28, 27, 22, 0.2);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  min-height: 44px;
}
.menu-tab:hover { border-color: var(--ink); transform: translateY(-1px); }
.menu-tab[aria-selected="true"] {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 6px 18px rgba(225, 33, 36, 0.28);
}

.menu-panels { margin-top: 40px; }
.menu-panel[hidden] { display: none; }
.menu-list {
  max-width: 900px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 56px;
}
.menu-item { break-inside: avoid; }
.menu-item__head { display: flex; align-items: baseline; }
.menu-item__name { font-weight: 500; color: var(--black); }
.menu-item__dots {
  flex: 1 1 auto;
  align-self: flex-end;
  margin: 0 8px 5px;
  border-bottom: 1.5px dotted rgba(28, 27, 22, 0.28);
}
.menu-item__price { font-weight: 700; color: var(--black); white-space: nowrap; }
.menu-item__desc { margin-top: 2px; color: var(--ink-soft); font-size: 0.86rem; max-width: 42ch; }

.menu-cta {
  text-align: center;
  margin-top: 44px;
  color: var(--ink-soft);
}
.menu-cta a { color: var(--red); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Gallery ---------- */
.section--gallery { background: var(--cream); }
.gallery-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.gallery-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  background: var(--navy-mid);
}
.gallery-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery-tile:hover img { transform: scale(1.05); }
.gallery-tile figcaption {
  position: relative;
  z-index: 1;
  padding: 14px 16px;
  color: #fff;
  font-weight: 500;
  font-size: 0.9rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.gallery-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8,17,25,0) 40%, rgba(8,17,25,0.55) 100%);
}

/* ---------- Contact ---------- */
.section--contact { background: var(--navy); color: var(--cream); }
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: stretch;
}
.section--contact .eyebrow { color: var(--gold); }
.section--contact h2 { color: var(--cream); font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 26px; }
.contact__list { display: grid; gap: 18px; margin-bottom: 30px; }
.contact__list li { display: flex; flex-direction: column; gap: 4px; }
.contact__label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  font-weight: 600;
}
.contact__list a { text-decoration: underline; text-underline-offset: 3px; }
.contact__ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 28px; }
.contact__social { display: flex; gap: 20px; }
.contact__social a { font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

.contact__map { border-radius: var(--radius); overflow: hidden; min-height: 320px; box-shadow: var(--shadow-soft); }
.contact__map iframe { width: 100%; height: 100%; min-height: 320px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: var(--cream-dim); padding-block: 40px; }
.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.site-footer__logo { width: 190px; height: auto; filter: brightness(0) invert(1); opacity: 0.92; }
.site-footer nav ul { display: flex; gap: 22px; flex-wrap: wrap; }
.site-footer nav a { font-size: 0.9rem; opacity: 0.85; }
.site-footer nav a:hover { opacity: 1; text-decoration: underline; }
.site-footer__copy { font-size: 0.82rem; opacity: 0.65; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal--visible { opacity: 1; transform: translateY(0); }

/* ===================================================================
   Responsive
   =================================================================== */
@media (max-width: 900px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__media { max-width: 320px; margin-inline: auto; }
  .contact__grid { grid-template-columns: 1fr; }
  .contact__map { min-height: 280px; }
}

@media (max-width: 760px) {
  .site-nav {
    position: fixed;
    inset: 0;
    left: auto;
    width: min(78vw, 340px);
    background: var(--cream);
    box-shadow: -14px 0 46px rgba(28, 27, 22, 0.16);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 40px;
    padding: 40px;
    transform: translateX(100%);
    transition: transform 0.35s ease;
  }
  .site-nav.is-open { transform: translateX(0); }
  .site-nav ul { flex-direction: column; gap: 22px; }
  .site-nav a:not(.btn) { font-size: 1.1rem; }
  .nav-toggle { display: flex; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .menu-list { grid-template-columns: 1fr; gap: 16px; max-width: 460px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }

  .section { padding-block: 64px; }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .hero__ctas { width: 100%; }
  .hero__ctas .btn { flex: 1; }
}
