/* Bernillo's Beachside Pizza — plain CSS, mobile-first, no build tools or external assets. */

:root {
  --red: #8c1c1c;
  --red-dark: #641313;
  --cream: #fbf6ee;
  --white: #ffffff;
  --ink: #2b2320;
  --check-size: 2rem;

  --muted: #6b6058;
  --line: rgba(140, 28, 28, 0.15);
  --line-strong: rgba(140, 28, 28, 0.25);
  --tint: rgba(140, 28, 28, 0.06);
  --focus: var(--red);
  --radius: 0.5rem;
  --tap-min: 2.75rem;
  /* 44px touch target */
  --nav-offset: 3.5rem;
  /* keeps anchored headings clear of the sticky nav */

  --font-heading: Georgia, "Times New Roman", Times, serif;
  --font-body:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;

  --wrap-max: 60rem;
  --menu-max: 36rem;
  --section-pad: 2rem;
  /* equal space above and below every section divider */
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
}

h1,
h2 {
  font-family: var(--font-heading);
  margin: 0 0 0.5rem;
}

a {
  color: var(--red);
}

/* One visible focus style everywhere; --focus flips to white on red surfaces */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.site-header,
.site-nav,
.site-footer {
  --focus: var(--white);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--white);
  color: var(--red-dark);
  border-radius: var(--radius);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

main:focus {
  outline: none;
}

section[id] {
  scroll-margin-top: var(--nav-offset);
}

.muted {
  color: var(--muted);
}

.wrap {
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Red-and-white checkered curtain accent, no images required */
.checkered-band {
  height: 0.75rem;
  background-image: repeating-linear-gradient(
    45deg,
    var(--red) 0,
    var(--red) var(--check-size),
    var(--cream) var(--check-size),
    var(--cream) calc(var(--check-size) * 2)
  );
  background-size: calc(var(--check-size) * 2) calc(var(--check-size) * 2);
}

.site-header {
  background: var(--red);
  color: var(--white);
}

.site-header .wrap {
  padding-top: 1.25rem;
  padding-bottom: 0.25rem;
  text-align: center;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  opacity: 0.85;
}

.site-header h1 {
  color: var(--white);
  font-size: 2rem;
  margin-top: 0.25rem;
}

.tagline {
  margin: 0 0 1rem;
  font-style: italic;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: 0.25rem;
  background: var(--red-dark);
  box-shadow: 0 2px 8px rgba(43, 35, 32, 0.2);
}

/* Both lists wrap and stay centered; on narrow screens the social icons
   drop to a second line as a group instead of scrolling sideways */
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.site-nav li {
  flex-shrink: 0;
}

.site-nav ul a {
  display: flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: 0 0.6rem;
  color: var(--white);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}

.site-nav ul a:hover,
.site-nav ul a:focus {
  text-decoration: underline;
}

/* Icon-only social links at the end of the nav */
.site-nav .nav-social a {
  padding: 0 0.45rem;
}

.site-nav .nav-social svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-nav .nav-social a:hover svg,
.site-nav .nav-social a:focus svg {
  opacity: 0.8;
}

.nav-call {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0 1rem;
  border-radius: 999px;
  background: var(--white);
  color: var(--red-dark);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.nav-call:hover {
  background: var(--cream);
}

.hero {
  padding: var(--section-pad) 0;
}

.hero h2 {
  color: var(--red);
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
}

/* Copy and photos stack on small screens; side by side from 40rem up */
.hero-layout {
  display: grid;
  gap: 1.5rem;
}

.hero-intro {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  text-align: left;
}

.hero-intro:last-child {
  margin-bottom: 0;
}

/* Two-column checklist of what the shop offers */
.hero-perks {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 1rem;
  font-size: 0.95rem;
}

.hero-perks li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.hero-perks li::before {
  content: "\2713";
  flex-shrink: 0;
  color: var(--red);
  font-weight: 700;
}

.hero-image {
  display: block;
  width: 100%;
  max-width: 40rem;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin: 0 auto;
  background-image: repeating-linear-gradient(
    45deg,
    var(--line) 0,
    var(--line) 1rem,
    transparent 1rem,
    transparent 2rem
  );
  background-color: var(--white);
  border: 1px solid rgba(140, 28, 28, 0.2);
  border-radius: 0.25rem;
}

/* Solid red call-to-action, e.g. the Get directions link */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  padding: 0 1.25rem;
  border-radius: var(--radius);
  background: var(--red);
  color: var(--white);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}

.button:hover,
.button:focus-visible {
  background: var(--red-dark);
}

/* Every section opens with a light divider line */
.section {
  padding: var(--section-pad) 0;
  border-top: 1px solid var(--line);
}

.section h2 {
  color: var(--red);
  font-size: 1.5rem;
}

/* A second h2 within a section (e.g. Ordering under the menu) gets room above */
.section h2:not(:first-child) {
  margin-top: 2.5rem;
}

.section-lede {
  font-style: italic;
  margin-top: 0;
}

.placeholder {
  color: var(--muted);
}

.hours-table {
  border-collapse: collapse;
  width: 100%;
  max-width: 22rem;
}

.hours-table th,
.hours-table td {
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--line);
  font-weight: normal;
}

.hours-table th {
  font-weight: 600;
}

.hours-table td {
  font-variant-numeric: tabular-nums;
}

.hours-table .is-closed th,
.hours-table .is-closed td {
  color: var(--muted);
  font-weight: normal;
}

.menu-heading {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--red);
  margin: 2rem 0 0.5rem;
}

.menu-note {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Decorative dot between inline menu options */
.dot {
  display: inline-block;
  margin: 0 0.4rem;
  color: var(--red);
  font-weight: 700;
}

.menu-table {
  border-collapse: collapse;
  width: 100%;
  max-width: var(--menu-max);
  margin: 0 0 1rem;
  background: var(--white);
  border: 1px solid var(--line);
}

.menu-table th,
.menu-table td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
  font-weight: normal;
}

.menu-table tbody tr:last-child th,
.menu-table tbody tr:last-child td {
  border-bottom: 0;
}

.menu-table thead th {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--red);
  background: var(--tint);
}

.menu-table td {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Pizza names that open a photo gallery for that pizza */
.menu-photo-link {
  color: var(--red);
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.menu-table th[scope="col"]:not(:first-child) {
  text-align: right;
}

/* Beer table: tap number is narrow, beer name fills the middle */
.beer-table th[scope="row"] {
  width: 3rem;
  text-align: center;
}

.beer-table th[scope="col"]:first-child {
  text-align: center;
}

.beer-table td:nth-child(2),
.beer-table th[scope="col"]:nth-child(2) {
  text-align: left;
  white-space: normal;
  width: 100%;
}

/* Extra toppings as a plain two-column list */
.toppings-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  max-width: var(--menu-max);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem 1.5rem;
  font-size: 0.95rem;
}

address {
  font-style: normal;
}

/* Address block sits under the hours table in the first column */
.location {
  margin-top: 1.5rem;
}

.location address {
  margin-bottom: 0.25rem;
}

/* Google Maps embed fills the second column; stacks below on phones */
.map-embed {
  align-self: stretch;
  min-height: 20rem;
}

.map-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 20rem;
  border: 0;
  border-radius: 0.25rem;
  background: var(--white);
}

/* Hours and Location stack on small screens; the gap keeps the second
   heading clear of the table above it. Becomes two columns at 40rem. */
.two-col {
  display: grid;
  gap: 2rem;
}

/* Toppings beside ranch and beer; headings already carry vertical spacing */
.menu-columns {
  gap: 0 2rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

/* Hero strip: always three across, tiles shrink to fit on small screens */
/* Small screens: three equal tiles filling the container width */
.hero .photo-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
  margin: 0;
}

/* Short note under the hero photos explaining they open the lightbox */
.photo-hint {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  text-align: center;
  color: var(--muted);
}

/* Each photo sits in a figure so a name badge can overlay its corner */
.photo-tile {
  position: relative;
  margin: 0;
}

.photo-badge {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  max-width: calc(100% - 1rem);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(100, 19, 19, 0.85);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  line-height: 1.4;
  text-align: center;
}

/* Long names wrap inside the tile and are cut after two lines. The clamp
   sits on an inner span so a third line can't show through the padding. */
.photo-badge span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}

@media (max-width: 26rem) {
  /* The nav wraps to two rows here (text links, then icons), so anchored
     headings need more clearance; tighter link padding keeps the text
     links on one row down to about 300px */
  :root {
    --nav-offset: 6.25rem;
  }

  .site-nav .nav-links a {
    padding: 0 0.4rem;
  }

  .photo-badge {
    right: 0.35rem;
    bottom: 0.35rem;
    max-width: calc(100% - 0.7rem);
    padding: 0.1rem 0.45rem;
    font-size: 0.65rem;
  }
}

/* Photos crop to their tile; the stripe pattern shows while they load */
.photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background-image: repeating-linear-gradient(
    45deg,
    var(--line) 0,
    var(--line) 1rem,
    transparent 1rem,
    transparent 2rem
  );
  background-color: var(--white);
  border: 1px solid rgba(140, 28, 28, 0.2);
  border-radius: 0.25rem;
}

/* Photo links: whole tile is clickable; focus ring sits on the tile */
.photo-link {
  display: block;
  border-radius: 0.25rem;
}

/* CSS-only lightbox: one fixed overlay, shown while any slide inside it is
   the URL fragment (:has(:target)). Slides live in a horizontal snap-scroll
   strip so a swipe moves to the next photo without script. */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(43, 35, 32, 0.88);
}

.lightbox:has(:target) {
  display: block;
}

.lightbox-strip {
  position: absolute;
  inset: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.lightbox-strip::-webkit-scrollbar {
  display: none;
}

.lightbox-slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  margin: 0;
  padding: 1rem 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* Transparent hit area behind each photo so tapping empty space closes */
.lightbox-backdrop {
  position: absolute;
  inset: 0;
}

.lightbox-slide img {
  position: relative;
  display: block;
  max-width: 100%;
  max-height: calc(100% - 3rem);
  width: auto;
  height: auto;
  border-radius: 0.25rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.lightbox-slide figcaption {
  position: relative;
  margin-top: 0.75rem;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 1.05rem;
  text-align: center;
}

/* Round white controls: close in the corner, arrows at each edge */
.lightbox-close,
.lightbox-arrow {
  --focus: var(--white);
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-min);
  height: var(--tap-min);
  border-radius: 50%;
  background: var(--white);
  color: var(--red-dark);
  line-height: 1;
  text-decoration: none;
}

.lightbox-close:hover,
.lightbox-arrow:hover {
  background: var(--cream);
}

/* Inline SVG glyphs so the icons sit exactly centered in the circles,
   independent of font metrics */
.lightbox-close svg,
.lightbox-arrow svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lightbox-close {
  top: 1rem;
  right: 1rem;
}

.lightbox-arrow {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 0.5rem;
}

.lightbox-next {
  right: 0.5rem;
}

/* Social links: inline SVG icon plus label, no external assets */
.social-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.5rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--tap-min);
  color: var(--red);
  font-weight: 600;
  text-decoration: none;
}

.social-links a:hover span,
.social-links a:focus-visible span {
  text-decoration: underline;
}

.social-links svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.back-to-top {
  margin: 0;
  padding: 1rem 1.25rem;
  text-align: center;
}

.back-to-top a {
  text-decoration: none;
  font-size: 0.9rem;
}

.back-to-top a:hover,
.back-to-top a:focus {
  text-decoration: underline;
}

.site-footer {
  background: var(--red);
  color: var(--white);
}

.site-footer .wrap {
  padding: 1rem 1.25rem;
  text-align: center;
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--white);
}

/* Two-column layout once there's enough room */
@media (min-width: 40rem) {
  .two-col {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .site-header .wrap {
    padding-top: 2.5rem;
    padding-bottom: 1rem;
  }

  .site-header h1 {
    font-size: 2.75rem;
  }

  .hero-layout {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
  }

  /* Wide screens: one large tile on top, two smaller ones beneath */
  .hero .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero .photo-tile:first-child {
    grid-column: 1 / -1;
  }

  .hero .photo-tile:first-child .photo {
    aspect-ratio: 2 / 1;
  }

  .menu-table th,
  .menu-table td {
    padding: 0.5rem 0.75rem;
  }

  :root {
    --section-pad: 3rem;
  }
}
