/* ------------------------------
   Root tokens
------------------------------ */

:root {
  /* Warm “salsa” palette */
  --tomato: #B63A2B;       /* primary accent */
  --tomato-deep: #7B241C;  /* darker shade for borders/text */
  --cream: #FCEFD8;        /* soft background */
  --paper: #fffdf8;        /* cards */
  --ink: #202325;          /* body text */
  --muted: #6c6a66;        /* secondary text */
  --olive: #8B8D5A;        /* subtle accent */
  --radius: 18px;
  --shadow: 0 10px 28px rgba(0, 0, 0, .12);
  --border: #f1e7d6;
}

/* ------------------------------
   Global base
------------------------------ */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--cream), #fff);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: 0.2px;
}

a {
  color: var(--tomato);
  text-decoration: none;
}

/* ------------------------------
   Print header
------------------------------ */

.print-header {
  display: none;
}

/* ------------------------------
   Hero
------------------------------ */

.hero {
  position: relative;
  min-height: 66vh;
  display: grid;
  place-items: center;
  text-align: center;
  color: #fff;
  padding: 40px 18px;
  background:
    linear-gradient(0deg, rgba(0, 0, 0, .45), rgba(0, 0, 0, .45)),
    url("../images/amatriciana-hero.jpg") center/cover no-repeat fixed;
  overflow: hidden; /* keep snow inside */
}

/* Snow overlay on hero */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(4px 4px at 20px 20px, rgba(255, 255, 255, 0.9) 50%, transparent 51%),
    radial-gradient(4px 4px at 80px 40px, rgba(255, 255, 255, 0.85) 50%, transparent 51%),
    radial-gradient(4px 4px at 40px 80px, rgba(255, 255, 255, 0.8) 50%, transparent 51%);
  background-size: 120px 120px;
  opacity: 0.9;
  pointer-events: none;
  animation: snowFall 9s linear infinite;
  z-index: 1;
}

/* Snow animation */
@keyframes snowFall {
  0% {
    transform: translateY(-80px);
  }
  100% {
    transform: translateY(80px);
  }
}

/* Hero watermark */
.hero::after {
  content: "© Amatriciana.co.uk • licensed image";
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1;
  background: rgba(0, 0, 0, .30);
  color: #fff;
  border-radius: 6px;
  pointer-events: none;
  z-index: 3;
}

/* Wrap for headline, badge, buttons, lights */
.hero-content {
  position: relative;
  z-index: 2; /* above snow */
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Brand badge + logo */
.brand-badge {
  display: inline-block;
  background: rgba(255, 255, 255, .94);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  padding: 10px 18px;
  margin-bottom: 12px;
}

.brand-logo {
  height: 148px;
  display: block;
}

/* Headline */
.hero h1 {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  letter-spacing: 0.2px;
  font-size: clamp(28px, 4.6vw, 56px);
  margin: 6px 0 10px;
}

/* Subtitle */
.subtitle {
  font-size: clamp(15px, 2.1vw, 20px);
  opacity: 0.95;
  font-weight: 600;
  text-align: center;
}

/* CTA buttons area */
.cta {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  transition: 0.18s;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  backdrop-filter: blur(6px);
}

.btn.primary {
  background: #ffdccc;
  color: #5a2a10;
  border-color: #ffdccc;
}

.btn.secondary {
  background: #fff;
  color: var(--tomato);
  border: 2px solid var(--tomato);
}

.btn.secondary:hover {
  background: var(--tomato);
  color: #fff;
}

.btn:hover {
  transform: translateY(-2px);
}

/* ------------------------------
   Festive lights
------------------------------ */

/* Create 8 light bulbs */
.hero-lights::before,
.hero-lights::after {
  content: "";
}

/* Generate bulbs (kept for parity with Fraschetta implementation) */
.hero-lights {
  counter-reset: bulbs 7;
}

/* Internal counter, not used visually but kept for consistency */
.hero-lights::before {
  counter-reset: bulbIndex 0;
}

/* Container for festive lights */
.hero-lights {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  height: 22px;
  width: 280px;
  display: flex;
  justify-content: space-between;
  z-index: 3;
}

/* Single bulb base style */
.hero-lights .bulb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: red;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
  animation:
    bulbShift 4s infinite ease-in-out,
    bulbColor 3s infinite ease-in-out;
}

/* Animations */
@keyframes bulbShift {
  0%   { transform: translateX(0px); }
  33%  { transform: translateX(4px); }
  66%  { transform: translateX(-4px); }
  100% { transform: translateX(0px); }
}

@keyframes bulbColor {
  0% {
    background: #008C45; /* green */
  }
  20% {
    background: #F4F5F0; /* white */
  }
  40% {
    background: #CD212A; /* red */
  }
  60% {
    background: #00CCFF; /* cyan */
  }
  80% {
    background: #FF66FF; /* fuchsia */
  }
  100% {
    background: #FFCC00; /* yellow */
  }
}

/* Staggered delays so bulbs do not change color at the same time */
.hero-lights .bulb:nth-child(1) { animation-delay: 0s; }
.hero-lights .bulb:nth-child(2) { animation-delay: .2s; }
.hero-lights .bulb:nth-child(3) { animation-delay: .4s; }
.hero-lights .bulb:nth-child(4) { animation-delay: .6s; }
.hero-lights .bulb:nth-child(5) { animation-delay: .8s; }
.hero-lights .bulb:nth-child(6) { animation-delay: 1s; }
.hero-lights .bulb:nth-child(7) { animation-delay: 1.2s; }
.hero-lights .bulb:nth-child(8) { animation-delay: 1.4s; }


/* ------------------------------
   Festive badge under hero
------------------------------ */

.hero-badge {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 720px;
  margin: 16px auto 32px;   /* space under hero and above content */
  padding: 9px 30px;
  text-align: center;

  background: linear-gradient(120deg, #FFF8F1, #FFE9D6);
  border: 1px solid rgba(182, 58, 43, 0.35);

  color: #8C2C1E;
  border-radius: 999px;
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);

  white-space: nowrap;
  z-index: 5;
}

/* ------------------------------
   Layout containers
------------------------------ */

.container {
  max-width: 1240px;
  margin: 24px auto 60px;
  padding: 0 18px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 22px;
}

/* ------------------------------
   Typography
------------------------------ */

h2 {
  color: var(--tomato);
  margin: 0 0 12px;
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: clamp(22px, 2.6vw, 36px);
}

h3 {
  font-family: "Playfair Display", serif !important;
  font-size: clamp(22px, 2.6vw, 28px);
}

p.lead,
p {
  font-size: 1.05rem;
  text-align: justify;
}

/* ------------------------------
   Grids / images
------------------------------ */

.grid {
  display: grid;
  gap: 16px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.img-block {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  position: relative; /* needed for watermark overlays */
}

/* ------------------------------
   Highlights
------------------------------ */

.why {
  background: #fff9f0;
  border: 1px solid #f4e6d1;
}

.highlight {
  background: #fff;
  border: 1px solid #f0e5d3;
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
}

.highlight span {
  font-size: 3rem;
  display: block;
  margin-bottom: 6px;
}

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

/* ------------------------------
   Price panel
------------------------------ */

.price-panel {
  border: 2px solid var(--tomato);
  border-radius: 20px;
  text-align: center;
  padding: 20px;
  background:
    linear-gradient(#fffdf8, #fffdf8) padding-box,
    linear-gradient(135deg, #f3d2bf, #fff) border-box;
}

.price-badge {
  display: inline-block;
  background: var(--tomato);
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 16px;
  margin-bottom: 10px;
}

.price-big {
  font-size: 44px;
  font-weight: 800;
}

.price-big .currency {
  font-size: 0.6em;
  vertical-align: super;
}

/* ------------------------------
   Table styles
------------------------------ */

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  background: #fff5ea;
}

/* ------------------------------
   Testimonials
------------------------------ */

.t-section {
  background: #fbf6ef;
  border: 1px solid #efe2d0;
}

.t-title {
  text-align: center;
  font-family: "Playfair Display", serif;
  font-weight: 800;
  color: #9c4a2d;
  letter-spacing: 0.3px;
  font-size: clamp(24px, 3vw, 40px);
  margin: 6px 0 18px;
}

.t-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(4, minmax(280px, 1fr));
  justify-content: center;
}

#testimonials {
  max-width: 1200px;
  margin: 0 auto 22px;
}

@media (max-width: 1100px) {
  .t-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.t-card {
  background: #fff;
  border: 1px solid #eadfcd;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .06);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.t-quote {
  font-style: italic;
  color: #3b3b3b;
  line-height: 1.55;
  margin: 0 0 18px;
  flex-grow: 1;
}

.t-author {
  font-weight: 800;
  color: var(--tomato-deep);
  letter-spacing: 0.2px;
  margin-top: auto;
}

/* ------------------------------
   Footer
------------------------------ */

footer {
  padding: 30px 0;
  color: var(--muted);
  text-align: center;
}

/* ------------------------------
   Responsive / mobile tweaks
------------------------------ */

/* Generic mobile adjustments */
@media (max-width: 820px) {
  .hero {
    background-attachment: scroll;
  }

  .container {
    margin: 40px auto 60px;
  }

  body {
    padding-top: env(safe-area-inset-top);
  }
}

/* Hero, badge and lights on phones */
@media (max-width: 600px) {
  .hero {
    background-attachment: scroll !important;
    min-height: auto;
    padding: 48px 16px;
  }

  .hero-badge {
    display: block;
    width: 90%;
    max-width: 340px;
    margin: 12px auto 20px;
    padding: 8px 14px;
    font-size: 0.95rem;
    white-space: normal;
    text-align: center;
  }

  .hero-lights {
    top: -24px;
    width: 240px;
  }
}

@media (max-width: 430px) {
  .hero {
    padding: 40px 14px;
  }

  .hero-badge {
    width: 94%;
    max-width: 280px;
    font-size: 0.9rem;
  }
}

/* Ultra-small devices: 240x320, 320x480, etc. */
@media (max-width: 320px) and (max-height: 480px) {

  html {
    font-size: 14px;
  }

  body {
    letter-spacing: 0.15px;
  }

  .hero {
    height: auto;
    min-height: 0;
    padding: 32px 10px 40px;
    background-size: cover;
    background-position: center top;
    align-items: center;
  }

  .brand-logo {
    height: 110px;
  }

  .hero h1 {
    font-size: 1.25rem;
    line-height: 1.3;
    margin-bottom: 8px;
  }

  .subtitle {
    font-size: 0.86rem;
    line-height: 1.35;
  }

  .cta {
    margin-top: 16px;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .cta .btn {
    width: 100%;
    max-width: 230px;
    padding: 9px 14px;
    font-size: 0.82rem;
  }

  .hero-badge {
    width: 94%;
    max-width: 260px;
    margin: 10px auto 16px;
    padding: 7px 10px;
    font-size: 0.82rem;
    white-space: normal;
  }

  .hero-lights {
    top: -26px;
    width: 180px;
  }

  .hero-lights .bulb {
    width: 12px;
    height: 12px;
  }

  .container {
    width: 96%;
    max-width: 300px;
    margin: 0 auto 32px auto;
    padding: 18px 10px;
  }

  .card {
    padding: 18px 12px;
    margin-bottom: 18px;
  }

  h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
  }

  h3 {
    font-size: 1.05rem;
  }

  p,
  li {
    font-size: 0.9rem;
  }

  .highlight span {
    font-size: 2.1rem;
  }

  .price-big {
    font-size: 2rem;
  }

  .t-title {
    font-size: 1.25rem;
  }
}

/* ------------------------------
   Print
------------------------------ */

@media print {

  .hero,
  .btn,
  .cta,
  footer,
  .img-block,
  .hero-badge {
    display: none !important;
  }

  .print-header {
    display: block;
    text-align: center;
    padding: 10px 0;
    border-bottom: 1px solid #ccc;
  }

  .print-header h1 {
    margin: 0;
    font-family: "Cormorant Garamond", serif;
  }

  body {
    background: #fff !important;
    color: #000;
    line-height: 1.45;
  }

  .container,
  .card,
  table {
    box-shadow: none !important;
    border: none !important;
    margin: 0;
    padding: 0;
    width: 100%;
  }

  h2 {
    color: #000;
  }

  th,
  td {
    border: 1px solid #ccc;
    padding: 6px 8px;
  }

  th {
    background: #f5f5f5;
    font-weight: 700;
  }
}

/* ------------------------------
   iOS & anti-copy tweaks
------------------------------ */

@supports (-webkit-touch-callout:none) {
  .hero {
    background-attachment: scroll !important;
    position: relative;
    z-index: 1;
  }

  .hero .cta {
    position: relative;
    z-index: 2;
  }
}

/* Prevent easy drag-save on images and hero */
img,
.hero {
  -webkit-user-drag: none;
  user-drag: none;
}

@supports (-webkit-touch-callout: none) {
  .hero {
    -webkit-touch-callout: none;
  }
}

/* ------------------------------
   Image watermarks
------------------------------ */

/* Generic watermark for all .img-block images in 2-column grid */
.grid.cols-2 > div:has(> img.img-block) {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
}

.grid.cols-2 > div:has(> img.img-block)::after {
  content: "© Amatriciana.co.uk • licensed image";
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 6px;
  font-size: 11px;
  line-height: 1;
  background: rgba(0, 0, 0, .35);
  color: #fff;
  border-radius: 4px;
  pointer-events: none;
  z-index: 2;
}
