* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #fff;
  min-height: 100vh;
  padding-bottom: 70px;

  /*background-image: url('/sassi-matera.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;*/
  background-color: #2a1a2e;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  /*Einschub Fix*/
  background-image: url('/sassi-matera.jpg');
    background-size: cover;
    background-position: center;
  /*Ende einschub*/
  /*überschrieben
  background: linear-gradient(
    135deg,
    rgba(45, 20, 60, 0.55),
    rgba(10, 40, 50, 0.55)
  );
  pointer-events: none;
  überschrieben*/
  background-image:
      linear-gradient(135deg, rgba(45,20,60,.55), rgba(10,40,50,.55)),
      url('/sassi-matera.jpg');
    background-size: cover, cover;
    background-position: center, center;
    pointer-events: none;
}

/* Sticky top bar */
.sticky-top {
  position: sticky;
  top: 0;
  z-index: 10;

  background: rgba(188, 4, 67, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

/* Header */
header {
  text-align: center;
  padding: 40px 20px 20px;
}

@font-face {
  font-family: "sassifont";
  src: url("./sassi-font-4.woff2") format("woff2");
}

header h1 {
    position: relative;
    display: inline-block;
    /*font-family: 'Bradley Hand', 'Bradley Hand ITC', cursive; */
    /*font-family: "Amature Circus", cursive;*/
    font-family: 'sassifont',sans-serif;
    font-size: clamp(2rem, 8vw, 3.2rem);
    font-weight: 300;
    letter-spacing: 4px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
header h1 .h1-sub {
    display: block;
    position: absolute;
    right: 0;              /* ends exactly where "Sassi" ends */
    bottom: -0.4em;        /* sits directly below the word */
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;  /* normal page font */
    font-size: 0.30em;      /* half the h1 size */
    font-weight: 300;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

header p {
  margin-top: 20px;
  opacity: 0.75;
  font-style: italic;
}

/* Shrink the header while scrolling where supported */
@supports (animation-timeline: scroll()) {
  header {
    animation: shrink-header linear both;
    animation-timeline: scroll(root);
    animation-range: 0px 120px;
  }

  header h1 {
    animation: shrink-title linear both;
    animation-timeline: scroll(root);
    animation-range: 0px 120px;
  }

  header p {
    animation: shrink-tagline linear both;
    animation-timeline: scroll(root);
    animation-range: 0px 120px;
  }
}

@keyframes shrink-header {
  from { padding: 40px 20px 20px; }
  to { padding: 12px 20px 6px; }
}

@keyframes shrink-title {
  from { font-size: clamp(2rem, 8vw, 3.2rem); }
  to { font-size: 1.5rem; }
}

@keyframes shrink-tagline {
  from { opacity: 0.75; max-height: 3em; margin-top: 8px; }
  to { opacity: 0; max-height: 0; margin-top: 0; }
}

/* Category filter targets */
.filter-target {
  display: block;
  height: 0;
  scroll-margin-top: 12rem;
}

/* Category filter */
.filter {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  padding: 16px 20px;
}

.filter a {
  display: inline-block;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.25s, transform 0.15s;
}

.filter a:active {
  transform: scale(0.95);
}

.filter a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* Highlight the selected category; Del giorno is selected on initial load */
body:not(:has(.filter-target:target)) .filter a[href="#filter-del-giorno"],
body:has(#filter-del-giorno:target) .filter a[href="#filter-del-giorno"],
body:has(#filter-pizze:target) .filter a[href="#filter-pizze"],
body:has(#filter-antipasti:target) .filter a[href="#filter-antipasti"],
body:has(#filter-paste:target) .filter a[href="#filter-paste"],
body:has(#filter-insalate:target) .filter a[href="#filter-insalate"],
body:has(#filter-dolci:target) .filter a[href="#filter-dolci"] {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.6);
}

/* On initial load, show only daily specials */
body:not(:has(.filter-target:target)) .menu .tile:not([data-cat="del-giorno"]),
#filter-del-giorno:target ~ .menu .tile:not([data-cat="del-giorno"])  {
  display: none;
}

/* Show only the selected regular category */
#filter-pizze:target ~ .menu .tile:not([data-cat="pizze"]),
#filter-antipasti:target ~ .menu .tile:not([data-cat="antipasti"]),
#filter-paste:target ~ .menu .tile:not([data-cat="paste"]),
#filter-insalate:target ~ .menu .tile:not([data-cat="insalate"]),
#filter-dolci:target ~ .menu .tile:not([data-cat="dolci"]) {
  display: none;
}
/* Hide the hours panel for other categories */
.menu-section > .hours-panel {
  display: none;
}

/* Show initially, or when Del giorno is selected */
body:not(:has(.filter-target:target)) .menu-section > .hours-panel,
#filter-del-giorno:target ~ .hours-panel {
  display: flex;
}

.hours-panel {
  box-sizing: border-box;
  width: calc(100% - 32px);
  max-width: 660px;
  margin: 20px auto 0;
  padding: 14px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;

  /* Expanded by default, including in browsers without scroll-animation support */
  max-height: 16rem;
  overflow: hidden;

  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.hours-panel__title {
  width: 100%;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
}

.hours-panel__details {
  width: 100%;
  margin-top: 8px;
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
}

.hours-panel__details p {
  display: block;
  margin: 0;
}

@supports (animation-timeline: scroll()) {
  .hours-panel {
    animation: expand-hours linear both;
    animation-timeline: scroll(root);
    animation-range: 0px 120px;
  }

  .hours-panel__details {
    animation: reveal-hours-text linear both;
    animation-timeline: scroll(root);
    animation-range: 0px 120px;
  }
}

@keyframes expand-hours {
  from { max-height: 3.3rem; }
  to   { max-height: 16rem; }
}

@keyframes reveal-hours-text {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (max-width: 600px) {
  .hours-panel {
    padding: 14px 16px;
  }
}

/* Menu tiles */
.menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 320px));
  justify-content: center;
  gap: 18px;
  padding: 24px 28px;
  max-width: 1100px;
  margin: 0 auto;
}

.tile {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  padding: 22px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s, background 0.25s;
  animation: fadeIn 0.4s ease;
}

.tile:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.18);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tile .emoji {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.tile h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.tile p {
  font-size: 0.9rem;
  opacity: 0.8;
  line-height: 1.4;
  flex-grow: 1;
}

.tile .price {
  margin-top: 14px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffd9a0;
}

.tile .badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(255, 255, 255, 0.15);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

/* Fixed footer */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  text-align: center;
  padding: 14px 20px;
  background: rgba(20, 8, 25, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

footer nav {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

footer a {
  color: #fff;
  opacity: 0.7;
  font-size: 0.85rem;
  text-decoration: none;
  transition: opacity 0.2s;
}

footer a:hover,
footer a:focus-visible {
  opacity: 1;
  text-decoration: underline;
}


@media (max-width: 600px) {
  .filter {
    gap: 8px;
    padding: 12px;
  }

  .filter a {
    padding: 8px 14px;
    font-size: 0.85rem;
  }

  .menu {
    grid-template-columns: 1fr;
    padding: 20px 16px;
  }

}
