/* Study in Girona — Up! idiomes
   Palette taken from the painted houses on the Onyar river. */
:root {
  --terracotta: #b8492a;
  --terracotta-dark: #8f3519;
  --ochre: #e0a238;
  --saffron: #f3d9a4;
  --river: #2f6b70;
  --stone: #f7f2ea;
  --paper: #ffffff;
  --ink: #1f2a33;
  --muted: #5b6670;
  --line: #e6ded2;
  --radius: 14px;
  --max: 1120px;
  --shadow: 0 1px 2px rgba(31,42,51,.06), 0 8px 24px rgba(31,42,51,.06);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--stone);
}
img { max-width: 100%; display: block; }
a { color: var(--terracotta); }
a:hover { color: var(--terracotta-dark); }
h1, h2, h3, h4 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  line-height: 1.15;
  margin: 0 0 .5em;
  font-weight: 600;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.section { padding: 80px 0; }
.section.alt { background: var(--paper); }
.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--river);
  margin-bottom: .8em;
}
.lead { font-size: 1.2rem; color: var(--muted); max-width: 640px; }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247,242,234,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { font-family: "Fraunces", Georgia, serif; font-weight: 700; font-size: 1.25rem; color: var(--ink); text-decoration: none; }
.logo span { color: var(--terracotta); }
.logo small { display: block; font-family: "Inter", sans-serif; font-size: .7rem; font-weight: 500; color: var(--muted); letter-spacing: .04em; }
.nav { display: flex; gap: 28px; align-items: center; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--terracotta); }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--ink); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--terracotta);
  background: var(--terracotta);
  color: #fff !important;
  transition: background .15s, transform .15s;
  cursor: pointer;
  font-size: 1rem;
}
.btn:hover { background: var(--terracotta-dark); border-color: var(--terracotta-dark); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--terracotta) !important; }
.btn.ghost:hover { background: var(--terracotta); color: #fff !important; }
.btn.small { padding: 9px 18px; font-size: .9rem; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* Hero */
.hero { padding: 72px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hero h1 em { font-style: normal; color: var(--terracotta); }
.hero .trust { margin-top: 28px; display: flex; gap: 22px; flex-wrap: wrap; font-size: .9rem; color: var(--muted); }
.hero .trust strong { color: var(--ink); }

/* Image placeholders: swap for real photography */
.photo {
  border-radius: var(--radius);
  min-height: 220px;
  display: flex; align-items: flex-end;
  padding: 16px;
  color: #fff;
  font-size: .8rem;
  font-weight: 500;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
.photo:not([data-label])::after { display: none; }
.photo::after { content: attr(data-label); background: rgba(31,42,51,.62); padding: 4px 10px; border-radius: 999px; }
.photo.onyar {
  /* Les cases de l'Onyar (Pixabay photo 9597447, Pixabay Content License).
     If img/cases-onyar.jpg is missing, the striped fallback underneath shows. */
  background:
    linear-gradient(180deg, rgba(31,42,51,0) 60%, rgba(31,42,51,.55) 100%),
    url("../img/cases-onyar.jpg") center / cover no-repeat,
    repeating-linear-gradient(90deg, #c8552f 0 60px, #e0a238 60px 110px, #e9c48a 110px 150px, #b8492a 150px 200px, #d9774a 200px 250px, #f0d59b 250px 290px);
  background:
    linear-gradient(180deg, rgba(31,42,51,0) 60%, rgba(31,42,51,.55) 100%),
    image-set(url("../img/cases-onyar.webp") type("image/webp"), url("../img/cases-onyar.jpg") type("image/jpeg")) center / cover no-repeat,
    repeating-linear-gradient(90deg, #c8552f 0 60px, #e0a238 60px 110px, #e9c48a 110px 150px, #b8492a 150px 200px, #d9774a 200px 250px, #f0d59b 250px 290px);
  min-height: 440px;
}
.photo.cathedral { background: url("../img/catedral.jpg") center / cover no-repeat, linear-gradient(160deg, #e9dcc4, #b89a74);
  background: image-set(url("../img/catedral.webp") type("image/webp"), url("../img/catedral.jpg") type("image/jpeg")) center / cover no-repeat, linear-gradient(160deg, #e9dcc4, #b89a74); }
.photo.market { background: url("../img/mercat.jpg") center / cover no-repeat, linear-gradient(160deg, #e0a238, #b8492a);
  background: image-set(url("../img/mercat.webp") type("image/webp"), url("../img/mercat.jpg") type("image/jpeg")) center / cover no-repeat, linear-gradient(160deg, #e0a238, #b8492a); }
.photo.coast { background: url("../img/costa-brava.jpg") center / cover no-repeat, linear-gradient(160deg, #7fb4b2, #2f6b70);
  background: image-set(url("../img/costa-brava.webp") type("image/webp"), url("../img/costa-brava.jpg") type("image/jpeg")) center / cover no-repeat, linear-gradient(160deg, #7fb4b2, #2f6b70); }
.photo.volcano { background: url("../img/castellfollit.jpg") center / cover no-repeat, linear-gradient(160deg, #9aa77a, #4e5d3a);
  background: image-set(url("../img/castellfollit.webp") type("image/webp"), url("../img/castellfollit.jpg") type("image/jpeg")) center / cover no-repeat, linear-gradient(160deg, #9aa77a, #4e5d3a); }
.photo.city { background: url("../img/onyar-catedral.jpg") center / cover no-repeat, linear-gradient(160deg, #e0a238, #2f6b70);
  background: image-set(url("../img/onyar-catedral.webp") type("image/webp"), url("../img/onyar-catedral.jpg") type("image/jpeg")) center / cover no-repeat, linear-gradient(160deg, #e0a238, #2f6b70); }
.photo.street { background: url("../img/barri-vell.jpg") center 40% / cover no-repeat, linear-gradient(160deg, #e9dcc4, #b89a74);
  background: image-set(url("../img/barri-vell.webp") type("image/webp"), url("../img/barri-vell.jpg") type("image/jpeg")) center 40% / cover no-repeat, linear-gradient(160deg, #e9dcc4, #b89a74); }
.photo.besalu { background: url("../img/besalu.jpg") center 35% / cover no-repeat, linear-gradient(160deg, #e9dcc4, #8a7a5c);
  background: image-set(url("../img/besalu.webp") type("image/webp"), url("../img/besalu.jpg") type("image/jpeg")) center 35% / cover no-repeat, linear-gradient(160deg, #e9dcc4, #8a7a5c); }
.photo.cycling { background: url("../img/ciclistes.jpg") center 40% / cover no-repeat, linear-gradient(160deg, #9aa77a, #2f6b70);
  background: image-set(url("../img/ciclistes.webp") type("image/webp"), url("../img/ciclistes.jpg") type("image/jpeg")) center 40% / cover no-repeat, linear-gradient(160deg, #9aa77a, #2f6b70); }
.photo.roses { background: url("../img/sant-jordi.jpg") center / cover no-repeat, linear-gradient(160deg, #c8552f, #8f3519);
  background: image-set(url("../img/sant-jordi.webp") type("image/webp"), url("../img/sant-jordi.jpg") type("image/jpeg")) center / cover no-repeat, linear-gradient(160deg, #c8552f, #8f3519); }
.photo.correfoc { background: url("../img/correfoc.jpg") center 40% / cover no-repeat, linear-gradient(160deg, #3a2a20, #b8492a);
  background: image-set(url("../img/correfoc.webp") type("image/webp"), url("../img/correfoc.jpg") type("image/jpeg")) center 40% / cover no-repeat, linear-gradient(160deg, #3a2a20, #b8492a); }
.photo.castells { background: url("../img/castellers.jpg") center / cover no-repeat, linear-gradient(160deg, #b8492a, #8f3519);
  background: image-set(url("../img/castellers.webp") type("image/webp"), url("../img/castellers.jpg") type("image/jpeg")) center / cover no-repeat, linear-gradient(160deg, #b8492a, #8f3519); }
.photo.bonfire { background: url("../img/foguera.jpg") center 60% / cover no-repeat, linear-gradient(160deg, #1f2a33, #c8552f);
  background: image-set(url("../img/foguera.webp") type("image/webp"), url("../img/foguera.jpg") type("image/jpeg")) center 60% / cover no-repeat, linear-gradient(160deg, #1f2a33, #c8552f); }
.photo.christmas { background: url("../img/nadal.jpg") center / cover no-repeat, linear-gradient(160deg, #1f2a33, #b8492a);
  background: image-set(url("../img/nadal.webp") type("image/webp"), url("../img/nadal.jpg") type("image/jpeg")) center / cover no-repeat, linear-gradient(160deg, #1f2a33, #b8492a); }
.photo.torro { background: url("../img/torro.jpg") center / cover no-repeat, linear-gradient(160deg, #f3d9a4, #e0a238);
  background: image-set(url("../img/torro.webp") type("image/webp"), url("../img/torro.jpg") type("image/jpeg")) center / cover no-repeat, linear-gradient(160deg, #f3d9a4, #e0a238); }
.photo.festa { background: url("../img/flors.jpg") center / cover no-repeat, linear-gradient(160deg, #f3d9a4, #c8552f);
  background: image-set(url("../img/flors.webp") type("image/webp"), url("../img/flors.jpg") type("image/jpeg")) center / cover no-repeat, linear-gradient(160deg, #f3d9a4, #c8552f); }

/* Cards */
.grid { display: grid; gap: 24px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
}
.card .photo { border-radius: 0; min-height: 180px; }
.card-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.card-body p { color: var(--muted); }
.card .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tag { font-size: .75rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--stone); color: var(--river); }
.tag.hot { background: var(--terracotta); color: #fff; }
.price { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.price strong { font-size: 1.4rem; font-family: "Fraunces", Georgia, serif; }
.price small { display: block; color: var(--muted); font-size: .8rem; }
.card.featured { border: 2px solid var(--terracotta); }

/* Pillars */
.pillar { padding: 28px; border-radius: var(--radius); background: var(--stone); }
.pillar .num { font-family: "Fraunces", serif; font-size: 2.4rem; color: var(--ochre); line-height: 1; margin-bottom: 8px; }
.pillar p { color: var(--muted); margin: 0; }

/* Day timeline */
.day-plan { list-style: none; padding: 0; margin: 0; }
.day-plan li { display: grid; grid-template-columns: 110px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.day-plan time { font-weight: 700; color: var(--terracotta); }
.day-plan p { margin: 0; color: var(--muted); }

/* Itinerary */
.itinerary { border-left: 3px solid var(--saffron); margin: 24px 0; padding-left: 28px; }
.itinerary .day { position: relative; padding-bottom: 28px; }
.itinerary .day::before { content: ""; position: absolute; left: -36px; top: 6px; width: 13px; height: 13px; border-radius: 50%; background: var(--terracotta); border: 3px solid var(--stone); }
.itinerary h4 { font-family: "Inter", sans-serif; font-size: 1.05rem; margin-bottom: .3em; }
.itinerary h4 span { color: var(--river); font-weight: 500; }
.itinerary p { color: var(--muted); margin: 0 0 .4em; }
.itinerary .words { font-size: .9rem; color: var(--ink); }
.itinerary .words b { color: var(--terracotta); font-weight: 600; }

/* Course detail block */
.course-photo { min-height: 320px; margin: 8px 0 28px; box-shadow: var(--shadow); }
@media (max-width: 720px) { .course-photo { min-height: 220px; } }
.course { padding: 64px 0; border-top: 1px solid var(--line); }
.course-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; }
.booking-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); position: sticky; top: 92px; align-self: start; }
.booking-box .big { font-family: "Fraunces", serif; font-size: 2.2rem; font-weight: 600; }
.booking-box ul, .check { list-style: none; padding: 0; margin: 16px 0 24px; }
.booking-box li, .check li { padding: 6px 0 6px 28px; position: relative; }
.booking-box li::before, .check li::before { content: "✓"; position: absolute; left: 0; color: var(--river); font-weight: 700; }
.booking-box .btn { width: 100%; text-align: center; }
.dates { font-size: .9rem; color: var(--muted); margin-top: 14px; }

/* Phrase strip */
.phrases { background: var(--river); color: #fff; padding: 22px 0; overflow: hidden; }
.phrases .wrap { display: flex; gap: 40px; flex-wrap: wrap; justify-content: center; font-size: .98rem; }
.phrases b { font-family: "Fraunces", serif; font-size: 1.1rem; color: var(--saffron); }

/* Quote */
.quote { background: var(--paper); border-radius: var(--radius); padding: 32px; border: 1px solid var(--line); }
.quote p { font-family: "Fraunces", serif; font-size: 1.15rem; color: var(--ink); }
.quote cite { font-style: normal; color: var(--muted); font-size: .9rem; }

/* FAQ */
details { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 18px 22px; margin-bottom: 12px; }
summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--terracotta); font-size: 1.3rem; line-height: 1; }
details[open] summary::after { content: "–"; }
details p { margin: 12px 0 0; color: var(--muted); }

/* CTA band */
.cta-band { background: var(--terracotta); color: #fff; border-radius: 22px; padding: 56px; display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px; align-items: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.88); margin: 0; }
.cta-band .btn { background: #fff; color: var(--terracotta) !important; border-color: #fff; }
.cta-band .btn:hover { background: var(--saffron); border-color: var(--saffron); }
.cta-band .btn-row { justify-content: flex-end; }

/* Articles */
.article-hero { padding: 64px 0 32px; }
.article-hero .meta { color: var(--muted); font-size: .9rem; }
.article { padding-bottom: 80px; }
.article h2 { margin-top: 1.6em; font-size: 1.8rem; }
.article h3 { margin-top: 1.4em; }
.article ol, .article ul { padding-left: 1.3em; }
.article li { margin-bottom: .5em; }
.callout { background: var(--paper); border-left: 4px solid var(--terracotta); border-radius: 0 var(--radius) var(--radius) 0; padding: 22px 26px; margin: 32px 0; box-shadow: var(--shadow); }
.callout h3 { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }
.say { display: inline-block; background: var(--saffron); padding: 0 8px; border-radius: 6px; font-weight: 600; font-style: normal; }

/* Forms */
.form { display: grid; gap: 18px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: 6px; }
.form input, .form select, .form textarea {
  width: 100%; padding: 13px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper);
  font: inherit; color: var(--ink);
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--ochre); border-color: var(--ochre); }

/* Footer */
.site-footer { background: var(--ink); color: #c9d1d7; padding: 56px 0 32px; font-size: .92rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--saffron); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h4 { font-family: "Inter", sans-serif; color: #fff; font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 40px; padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: #8d99a3; }

/* Responsive */
@media (max-width: 900px) {
  .hero-grid, .course-grid, .cta-band, .footer-grid { grid-template-columns: 1fr; }
  .grid.c3, .grid.c4 { grid-template-columns: repeat(2, 1fr); }
  .booking-box { position: static; }
  .cta-band { padding: 36px 28px; }
  .cta-band .btn-row { justify-content: flex-start; }
  .photo.onyar { min-height: 280px; }
}
@media (max-width: 720px) {
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; background: var(--stone); flex-direction: column; padding: 20px; border-bottom: 1px solid var(--line); gap: 16px; }
  .nav.open { display: flex; }
  .nav-toggle { display: block; }
  .grid.c2, .grid.c3, .grid.c4, .form .row { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .day-plan li { grid-template-columns: 1fr; gap: 4px; }
  .wrap { padding: 0 16px; }
}

/* Language switcher */
.lang-switch { display: flex; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--paper); }
.lang-switch a { font-size: .78rem; font-weight: 600; padding: 4px 9px; border-radius: 999px; color: var(--muted); letter-spacing: .04em; }
.lang-switch a[aria-current="true"] { background: var(--ink); color: #fff; }
.lang-switch a:hover:not([aria-current="true"]) { color: var(--terracotta); }
@media (max-width: 720px) { .lang-switch { align-self: flex-start; } }

/* Ratings (filled from tools/site.json) */
.ratings { padding-top: 0; }
.rating-row { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.rating-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 32px; box-shadow: var(--shadow); min-width: 260px; }
.rating-card p { margin: 4px 0; color: var(--muted); }
.rating-card .btn-row { justify-content: center; margin-top: 12px; }
.rating-big { font-family: "Fraunces", Georgia, serif; font-size: 2.6rem; color: var(--ink) !important; line-height: 1.1; }
.rating-big small { font-size: 1rem; color: var(--muted); }
.stars { --r: 5; position: relative; display: inline-block; font-size: 1.5rem; letter-spacing: 3px; line-height: 1; }
.stars::before { content: "★★★★★"; background: linear-gradient(90deg, var(--ochre) calc(var(--r) / 5 * 100%), var(--line) calc(var(--r) / 5 * 100%)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Name / address / phone line in the footer */
.nap { font-style: normal; margin-top: 28px; color: #c9d1d7; }
.nap strong { color: #fff; }

/* 404 */
.notfound { min-height: 60vh; display: flex; align-items: center; }

/* Live Google reviews (js/main.js, /api/reviews) */
.review-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 32px; text-align: left; }
.review { margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.review figcaption { display: grid; grid-template-columns: 1fr; row-gap: 2px; align-items: center; margin-bottom: 12px; }
.review figcaption:has(img) { grid-template-columns: 40px 1fr; column-gap: 12px; }
.review figcaption img { grid-row: 1 / span 2; border-radius: 50%; }
.review figcaption:has(img) > :not(img) { grid-column: 2; }
.review-author { font-weight: 600; color: var(--ink); text-decoration: none; }
.review-meta { font-size: .85rem; color: var(--ochre); }
.review blockquote { margin: 0; color: var(--ink); font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.review-foot { margin: auto 0 0; padding-top: 12px; font-size: .8rem; color: var(--muted); }
.review-source { margin-top: 16px; font-size: .8rem; color: var(--muted); }

/* Sister sites (upidiomes.cat / upidiomes.com) */
.sister { margin: 10px 0 0; color: #c9d1d7; }
.sister strong { color: #fff; }
.sister span { color: #8d99a3; }
.sister-sites { padding-top: 0; }
.sister-card { text-decoration: none; color: inherit; display: block; border: 1px solid var(--line); transition: border-color .15s; }
.sister-card:hover { border-color: var(--terracotta); }
.sister-card h3 { color: var(--terracotta); margin-bottom: .2em; }

/* "Start before you arrive" (Viquiràdio, Global Method) */
.prep { background: var(--paper); }
.prep-grid { margin-top: 32px; max-width: 900px; margin-left: auto; margin-right: auto; }
.prep-card { display: flex; flex-direction: column; }
.prep-card h3 { color: var(--river); }
.prep-card p:last-child { margin-top: auto; padding-top: 12px; }

/* Indicative prices and programmes */
.ast { color: var(--terracotta); font-family: "Inter", system-ui, sans-serif; font-weight: 600; font-size: .5em; vertical-align: super; line-height: 0; margin-left: 2px; }
.price-note { max-width: 760px; margin: 24px auto 0; padding: 14px 18px; background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--ochre); border-radius: 10px; font-size: .9rem; color: var(--muted); text-align: left; }
.course + .price-note, .article-hero + .price-note { margin-bottom: 8px; }
.ast-note { margin: 10px 0 0; font-size: .78rem; color: var(--muted); }
