/* Decorative font of the old "Dream of energy" heading (SIL Open Font License) */
@font-face {
  font-family: "Mystery Quest";
  src: url("/fonts/mystery-quest-latin.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #fbf7f1;
  --surface: #ffffff;
  --text: #3b2f25;
  --muted: #7a6a5c;
  /* The old WordPress theme's red */
  --accent: #d65050;
  --accent-dark: #b03a3a;
  /* The old site's purple for the jewellery filters */
  --jewel: rgba(151, 21, 165, 0.79);
  --line: #eadfd2;
  --header-h: 64px;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

/* Keep #amici links from hiding under the sticky header */
html { scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
}

img { max-width: 100%; height: auto; display: block; }
/* Text links use the darker red so they stay readable on the cream background */
a { color: var(--accent-dark); }
a:hover { color: #8a2c2c; }

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  background: rgba(43, 33, 25, 0.92);
  backdrop-filter: blur(6px);
}
.site-header .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  color: #fff;
  font: 700 1.4rem var(--font-head);
  text-decoration: none;
}
.logo:hover { color: #fff; }
.site-header ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 24px;
}
.site-header nav a {
  color: #f1e6da;
  text-decoration: none;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.site-header nav a:hover { color: #fff; }

/* Home slider */
.hero {
  position: relative;
  height: calc(100vh - var(--header-h));
  min-height: 420px;
  max-height: 820px;
  overflow: hidden;
  background: #2b2119;
}
.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  text-align: center;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease;
}
.slide.active { opacity: 1; }
/* Text flies in from the right each time its slide appears, as on the old site */
.slide.active > * { animation: fly-in-right 1s ease-out both; }
@keyframes fly-in-right {
  from { opacity: 0; transform: translateX(100vw); }
  to { opacity: 1; transform: none; }
}
.slide blockquote { margin: 0 0 28px; max-width: 760px; color: #fff; }
.slide blockquote p {
  margin: 0 0 14px;
  padding-bottom: 16px;
  position: relative;
  font: italic 400 clamp(1.5rem, 4vw, 2.6rem)/1.3 var(--font-head);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5), 0 0 18px rgba(0, 0, 0, 0.35);
}
/* Red line under the quote, as on the old site */
.slide blockquote p::after {
  content: "";
  position: absolute;
  left: 30%;
  bottom: 0;
  width: 40%;
  height: 2px;
  background: var(--accent);
}
.slide blockquote footer {
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}
.button {
  display: inline-block;
  padding: 12px 34px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.9rem;
}
.button:hover { background: var(--accent-dark); color: #fff; }
.dots {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
}
.dots button {
  width: 12px;
  height: 12px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.dots button[aria-selected="true"] { background: #fff; }

/* Sections */
.section { padding: 64px 0; }
.section h2, .page h2 {
  margin: 0 0 32px;
  text-align: center;
  font: 400 2.2rem var(--font-head);
}
.section h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin: 14px auto 0;
  background: var(--accent);
}

/* "I nostri amici": light-blue clouds along the top and bottom, as on the old site */
.amici {
  /* The clouds keep their shape and grow with the page width (never under 70px) */
  --cloud-h: max(70px, 9.8vw);
  position: relative;
  padding: calc(var(--cloud-h) + 48px) 0 calc(var(--cloud-h) + 56px);
}
.amici::before,
.amici::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: var(--cloud-h);
  background: url("/img/home/clouds.svg") center bottom / cover no-repeat;
  pointer-events: none;
}
.amici::before { top: 0; }
.amici::after { bottom: 0; transform: rotate(180deg); }

/* Friends grid */
/* Flex rather than grid so an incomplete last row is centred */
.friends {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 1000px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
}
.friends li { flex: 0 1 220px; }
.friends a, .friends li > span {
  display: block;
  color: var(--text);
  text-decoration: none;
  text-align: center;
}
.friends img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 6px solid var(--surface);
  box-shadow: 0 4px 16px rgba(59, 47, 37, 0.15);
  transition: transform 0.25s ease;
}
.friends a:hover img { transform: scale(1.04); }
.friends .name {
  display: block;
  margin-top: 12px;
  font: 400 1.35rem var(--font-head);
}

/* Inner pages */
.page-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 260px;
  background-size: cover;
  background-position: center 40%;
}
.page-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(30, 20, 12, 0.2);
}
.page-banner h1 {
  position: relative;
  margin: 0;
  color: #fff;
  font: 400 clamp(2.2rem, 6vw, 3.4rem) var(--font-head);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5), 0 0 18px rgba(0, 0, 0, 0.35);
}
.page { padding: 48px 16px 64px; }
.back { margin: 40px 0 0; text-align: center; }

/* Gallery */
.gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.gallery a { display: block; overflow: hidden; border-radius: var(--radius); }
.gallery img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.gallery a:hover img { transform: scale(1.05); }

/* Jewellery gallery: heading on a photo, gallery on a pink tiled pattern */
.jewellery-title {
  margin: 0;
  padding: 60px 16px 90px;
  background: url("/img/home/dream-of-energy.jpg") center top / cover;
  text-align: center;
  font: 400 clamp(2.2rem, 8vw, 66px)/1.2 "Mystery Quest", var(--font-head);
  letter-spacing: clamp(3px, 1.2vw, 10px);
  text-shadow: 3px 3px 18px rgba(0, 0, 0, 0.56);
}
.jewellery-title a { color: #fff; text-decoration: none; }
.jewellery-title a:hover { color: #fff; opacity: 0.9; }
.jewellery-body {
  padding: 48px 0 64px;
  background: url("/img/home/tile.jpg");
}
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 28px;
}
.filters button {
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
/* Purple, as the old site used for this section */
.filters button:hover { border-color: var(--jewel); color: var(--jewel); }
.filters button[aria-pressed="true"] {
  background: var(--jewel);
  border-color: var(--jewel);
  color: #fff;
}
.jewels li[hidden] { display: none; }
/* Changing category: old photos shrink away, new ones pop in one by one */
.jewels li.leave {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.jewels li.appear { animation: pop-in 0.5s cubic-bezier(0.2, 0.8, 0.3, 1.2) both; }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(30px) scale(0.85); }
  to { opacity: 1; transform: none; }
}

/* Lightbox */
.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(15, 10, 6, 0.94);
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: transparent; }
.lightbox img {
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  object-fit: contain;
  border-radius: 4px;
}
.lightbox button {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
}
.lightbox button:hover { background: rgba(255, 255, 255, 0.25); }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-close { top: 16px; right: 16px; }

/* Text pages, e.g. Privacy */
.prose { max-width: 760px; }
.prose h2 {
  margin: 36px 0 8px;
  text-align: left;
  font: 400 1.5rem var(--font-head);
}
.prose p { margin: 0 0 14px; }
.prose .updated { margin-top: 36px; color: var(--muted); font-size: 0.9rem; }

/* Footer */
.site-footer {
  padding: 28px 0;
  background: #2b2119;
  color: #cbb9a8;
  font-size: 0.9rem;
  text-align: center;
}
.site-footer a { color: #f1e6da; }
.site-footer a:hover { color: #fff; }

.site-header nav a { white-space: nowrap; }

@media (max-width: 600px) {
  /* Logo on top, menu on its own row underneath */
  :root { --header-h: 84px; }
  body { font-size: 16px; }
  .site-header .wrap {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
  }
  .site-header ul { gap: 18px; }
  .site-header nav a { font-size: 0.78rem; }
  .logo { font-size: 1.15rem; }
  .friends { gap: 18px; }
  .friends li { flex-basis: calc(50% - 9px); }
  .page-banner { height: 180px; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
