/* ==========================================================================
   Portogallo Road Trip — shared styles
   Aesthetic: editorial travel magazine · azulejo blue + cream + terracotta
   ========================================================================== */

:root {
  /* palette */
  --azul-deep:   #0f2d4a;   /* deep azulejo blue */
  --azul:        #1c4d78;
  --azul-soft:   #3a76a8;
  --cream:       #f5ecdc;   /* warm paper */
  --cream-2:     #efe3cd;
  --terracotta:  #d1622f;   /* sunset accent */
  --terracotta-d:#b34d1f;
  --gold:        #e0a92e;   /* Pena palace yellow */
  --ink:         #16232e;
  --ink-soft:    #3f5460;
  --line:        rgba(15,45,74,.14);
  --white:       #fffdf8;

  --shadow-sm: 0 1px 2px rgba(15,45,74,.08), 0 2px 8px rgba(15,45,74,.06);
  --shadow-md: 0 8px 30px rgba(15,45,74,.14);
  --shadow-lg: 0 20px 60px rgba(15,45,74,.22);

  --maxw: 1120px;
  --radius: 18px;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Instrument Sans", -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* subtle grain / paper texture */
  background-image:
    radial-gradient(circle at 15% 12%, rgba(224,169,46,.06), transparent 40%),
    radial-gradient(circle at 85% 8%, rgba(209,98,47,.06), transparent 45%);
  background-attachment: fixed;
}

img { max-width: 100%; display: block; }

a { color: var(--terracotta-d); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.01em;
  font-optical-sizing: auto;
}
.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: .72rem;
  font-weight: 600;
  color: var(--terracotta-d);
}

/* ==========================================================================
   NAV
   ========================================================================== */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: .9rem clamp(1rem, 4vw, 3rem);
  background: rgba(245,236,220,.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__brand {
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.15rem;
  color: var(--azul-deep);
  display: flex; align-items: center; gap: .5rem;
  white-space: nowrap;
}
.nav__brand:hover { text-decoration: none; }
.nav__links { display: flex; gap: .3rem; align-items: center; }
.nav__toggle {
  display: none; background: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px;
  color: var(--azul-deep); width: 42px; height: 38px;
  align-items: center; justify-content: center;
  transition: background .18s, border-color .18s;
}
.nav__toggle:hover { background: rgba(28,77,120,.08); }
.nav__toggle::before { content: "☰"; font-size: 1.35rem; line-height: 1; }
.nav.open .nav__toggle::before { content: "✕"; font-size: 1.15rem; }

@media (max-width: 640px) {
  .nav { flex-wrap: wrap; gap: .5rem; padding: .7rem .9rem; }
  .nav__brand { font-size: 1.05rem; }
  .nav__toggle { display: inline-flex; }
  .nav__links {
    order: 3; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: .15rem;
    overflow: hidden; max-height: 0; opacity: 0;
    transition: max-height .32s cubic-bezier(.2,.7,.2,1), opacity .22s, padding .2s;
  }
  .nav.open .nav__links { max-height: 30rem; opacity: 1; padding-top: .5rem; }
  .nav__links a { padding: .7rem .9rem; border-radius: 12px; font-size: 1.02rem; }
  .nav__links a.logout { margin-top: .3rem; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .nav__links { transition: none; } }
.nav__links a {
  color: var(--ink-soft);
  font-weight: 500; font-size: .93rem;
  padding: .35rem .7rem; border-radius: 999px;
  transition: background .18s, color .18s;
}
.nav__links a:hover { background: rgba(28,77,120,.1); color: var(--azul-deep); text-decoration: none; }
.nav__links a.active { background: var(--azul-deep); color: var(--cream); }
.nav__links a.logout { color: var(--terracotta-d); border: 1px solid var(--line); }
.nav__links a.logout:hover { background: var(--terracotta); color: var(--cream); border-color: var(--terracotta); }

/* ==========================================================================
   LAYOUT
   ========================================================================== */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }
section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-head { max-width: 640px; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); color: var(--azul-deep); margin: .4rem 0 .6rem; }
.section-head p { color: var(--ink-soft); font-size: 1.05rem; }

/* ==========================================================================
   HERO (home)
   ========================================================================== */
.hero {
  position: relative;
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5rem);
  background:
    linear-gradient(160deg, var(--azul-deep) 0%, var(--azul) 55%, var(--azul-soft) 100%);
  color: var(--cream);
  overflow: hidden;
}
.hero::after {
  /* azulejo-ish tile pattern */
  content: ""; position: absolute; inset: 0; opacity: .10; pointer-events: none;
  background-image:
    linear-gradient(45deg, var(--cream) 25%, transparent 25%, transparent 75%, var(--cream) 75%),
    linear-gradient(45deg, var(--cream) 25%, transparent 25%, transparent 75%, var(--cream) 75%);
  background-size: 44px 44px;
  background-position: 0 0, 22px 22px;
}
.hero .wrap { position: relative; z-index: 2; }
.hero__dates {
  display: inline-flex; align-items: center; gap: .6rem;
  border: 1px solid rgba(245,236,220,.35);
  border-radius: 999px; padding: .35rem .95rem;
  font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600;
  color: var(--gold);
}
.hero h1 {
  font-size: clamp(3.2rem, 12vw, 8rem);
  margin: 1.2rem 0 .3rem;
  color: var(--white);
  font-weight: 600;
}
.hero h1 em { color: var(--gold); font-style: italic; }
.hero__sub {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  max-width: 540px; color: rgba(245,236,220,.9);
}
.hero__stats {
  display: flex; flex-wrap: wrap; gap: 2.2rem; margin-top: 2.5rem;
}
.hero__stats .stat b {
  font-family: var(--font-display); font-size: 2.1rem; color: var(--gold); display: block; line-height: 1;
}
.hero__stats .stat span { font-size: .82rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(245,236,220,.75); }

/* panoramic poster band at bottom of home hero */
.hero__art {
  position: absolute; left: 0; right: 0; bottom: -1px; z-index: 1; height: 42%;
  min-height: 150px; pointer-events: none;
}
.hero__art svg { width: 100%; height: 100%; display: block; }
.hero .wrap { padding-bottom: clamp(6rem, 16vw, 9rem); pointer-events: none; }
.hero .wrap a, .hero .wrap button { pointer-events: auto; }
@media (max-width: 620px) { .hero .wrap { padding-bottom: clamp(7rem, 34vw, 10rem); } }

/* animated entrance */
.rise { opacity: 0; transform: translateY(22px); animation: rise .8s cubic-bezier(.2,.7,.2,1) forwards; }
.rise-1 { animation-delay: .05s; }
.rise-2 { animation-delay: .18s; }
.rise-3 { animation-delay: .31s; }
.rise-4 { animation-delay: .44s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; opacity: 1; transform: none; } }

/* ==========================================================================
   ROUTE STRIP
   ========================================================================== */
.route { display: flex; flex-wrap: wrap; gap: 0; counter-reset: stop; }
.route__stop {
  position: relative; flex: 1 1 140px; min-width: 130px;
  padding: 1.4rem 1rem 1.2rem; text-align: center;
}
.route__stop::before {
  counter-increment: stop; content: counter(stop);
  display: grid; place-items: center;
  width: 42px; height: 42px; margin: 0 auto .7rem;
  background: var(--white); border: 2px solid var(--terracotta);
  color: var(--terracotta-d); font-family: var(--font-display); font-weight: 600;
  border-radius: 999px; box-shadow: var(--shadow-sm);
  position: relative; z-index: 2;
}
.route__stop::after {
  content: ""; position: absolute; top: calc(1.4rem + 21px); left: 50%; right: -50%;
  height: 2px; background: repeating-linear-gradient(90deg, var(--terracotta) 0 8px, transparent 8px 16px);
  z-index: 1;
}
.route__stop:last-child::after { display: none; }
.route__stop b { display: block; font-family: var(--font-display); font-size: 1.05rem; color: var(--azul-deep); }
.route__stop span { font-size: .8rem; color: var(--ink-soft); }

/* ==========================================================================
   CARDS (tappe grid)
   ========================================================================== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.4rem; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); text-decoration: none; }
.card__band { height: 8px; background: linear-gradient(90deg, var(--terracotta), var(--gold)); }
.card__art { height: 150px; overflow: hidden; background: var(--azul-deep); }
.card__art svg { width: 100%; height: 100%; display: block; transition: transform .4s cubic-bezier(.2,.7,.2,1); }
.card:hover .card__art svg { transform: scale(1.06); }
.card__body { padding: 1.5rem 1.5rem 1.7rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card__day { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--terracotta-d); font-weight: 600; }
.card h3 { font-size: 1.55rem; color: var(--azul-deep); }
.card p { color: var(--ink-soft); font-size: .95rem; }
.card__go { margin-top: auto; padding-top: .8rem; color: var(--azul); font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: .35rem; }
.card:hover .card__go { gap: .6rem; }

/* ==========================================================================
   PAGE HERO (tappa pages)
   ========================================================================== */
.phero {
  background: linear-gradient(150deg, var(--azul-deep), var(--azul));
  color: var(--cream); padding: clamp(3rem, 7vw, 5rem) 0 0;
  position: relative; overflow: hidden;
}
.phero .wrap { position: relative; z-index: 3; padding-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.phero__days { color: var(--gold); font-weight: 600; letter-spacing: .18em; text-transform: uppercase; font-size: .8rem; }
.phero h1 { font-size: clamp(2.6rem, 7vw, 5rem); color: var(--white); margin: .6rem 0 .5rem; }
.phero p { max-width: 520px; color: rgba(245,236,220,.9); font-size: 1.1rem; }

/* signature poster illustration inside page hero */
.phero__art {
  position: absolute; right: 0; bottom: 0; z-index: 1;
  width: min(46%, 520px); height: 100%;
  pointer-events: none;
}
.phero__art svg { width: 100%; height: 100%; display: block; object-fit: cover; }
.phero__art::before {
  /* fade the art into the hero on its left edge */
  content: ""; position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(90deg, var(--azul-deep) 0%, rgba(15,45,74,.35) 22%, transparent 55%);
}
@media (max-width: 780px) {
  .phero { padding-top: clamp(2.4rem, 8vw, 3rem); }
  .phero__art { position: relative; width: 100%; height: 190px; margin-top: 1.5rem; }
  .phero__art::before { background: linear-gradient(180deg, var(--azul-deep) 0%, transparent 30%); }
  .phero .wrap { padding-bottom: 0; }
}
.phero__where {
  display: inline-flex; align-items: center; gap: .5rem; margin-top: 1.4rem;
  background: rgba(245,236,220,.14); border: 1px solid rgba(245,236,220,.28);
  padding: .45rem 1rem; border-radius: 999px; font-size: .9rem;
}

/* ==========================================================================
   TIMELINE (day sections)
   ========================================================================== */
.day { border-top: 1px solid var(--line); padding: clamp(2.2rem,5vw,3.2rem) 0; }
.day:first-of-type { border-top: none; }
.day__head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.day__num {
  font-family: var(--font-display); font-size: 3rem; color: var(--terracotta);
  line-height: 1; opacity: .85;
}
.day__title h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); color: var(--azul-deep); }
.day__title span { color: var(--ink-soft); font-size: .95rem; }

.block { margin-bottom: 1.6rem; }
.block h3 { font-size: 1.2rem; color: var(--azul); margin-bottom: .4rem; display: flex; align-items: center; gap: .5rem; }
.block ul { list-style: none; display: flex; flex-direction: column; gap: .55rem; }
.block li { position: relative; padding-left: 1.4rem; color: var(--ink-soft); }
.block li::before { content: ""; position: absolute; left: 0; top: .6em; width: 7px; height: 7px; background: var(--terracotta); border-radius: 2px; transform: rotate(45deg); }
.block li b, .block li strong { color: var(--ink); }

/* tip callout */
.tip {
  display: flex; gap: .9rem; align-items: flex-start;
  background: var(--white); border-left: 4px solid var(--gold);
  border-radius: 12px; padding: 1rem 1.2rem; margin: 1.2rem 0;
  box-shadow: var(--shadow-sm);
}
.tip.warn { border-left-color: var(--terracotta); }
.tip__icon { font-size: 1.3rem; line-height: 1.2; }
.tip p { font-size: .95rem; color: var(--ink-soft); margin: 0; }
.tip b { color: var(--ink); }

/* pill row */
.pills { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0; }
.pill { background: rgba(28,77,120,.09); color: var(--azul-deep); border-radius: 999px; padding: .3rem .8rem; font-size: .82rem; font-weight: 500; }

/* ==========================================================================
   TABLE (alloggi + overview)
   ========================================================================== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; background: var(--white); font-size: .92rem; }
thead th { background: var(--azul-deep); color: var(--cream); text-align: left; padding: .85rem 1rem; font-family: var(--font-body); font-weight: 600; letter-spacing: .03em; white-space: nowrap; }
tbody td { padding: .8rem 1rem; border-top: 1px solid var(--line); color: var(--ink-soft); }
tbody tr:nth-child(even) td { background: rgba(239,227,205,.4); }
tbody td b { color: var(--ink); }

/* ==========================================================================
   HOTEL CARDS
   ========================================================================== */
.hotel {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem 1.7rem; box-shadow: var(--shadow-sm); margin-bottom: 1.3rem;
}
.hotel__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.hotel h3 { font-size: 1.35rem; color: var(--azul-deep); }
.hotel__city { color: var(--terracotta-d); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; }
.hotel__price { font-family: var(--font-display); font-size: 1.5rem; color: var(--azul); white-space: nowrap; }
.hotel__meta { display: flex; flex-wrap: wrap; gap: .5rem .5rem; margin-top: .9rem; }
.hotel__meta .pill { background: var(--cream-2); }
.hotel__conf { margin-top: 1rem; font-size: .85rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 1.2rem; }
.hotel__conf code { font-family: ui-monospace, monospace; background: var(--cream-2); padding: .1rem .45rem; border-radius: 5px; color: var(--ink); }

/* ==========================================================================
   CTA / SPLITWISE
   ========================================================================== */
.cta {
  background: linear-gradient(135deg, var(--terracotta), var(--terracotta-d));
  color: var(--cream); border-radius: var(--radius); padding: clamp(2rem,5vw,3rem);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  box-shadow: var(--shadow-md);
}
.cta h3 { font-size: 1.7rem; color: var(--white); }
.cta p { color: rgba(245,236,220,.9); max-width: 440px; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--cream); color: var(--terracotta-d); font-weight: 700;
  padding: .8rem 1.5rem; border-radius: 999px; font-size: .95rem;
  transition: transform .18s, box-shadow .18s; box-shadow: var(--shadow-sm); white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.btn--ghost { background: transparent; border: 2px solid var(--cream); color: var(--cream); }

/* checklist */
.checklist { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 1.5rem; }
.checklist .col { background: var(--white); border-radius: var(--radius); padding: 1.4rem 1.5rem; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.checklist h4 { color: var(--azul-deep); font-size: 1.15rem; margin-bottom: .8rem; }
.checklist ul { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.checklist li { padding-left: 1.7rem; position: relative; font-size: .92rem; color: var(--ink-soft); }
.checklist li::before { content: "☐"; position: absolute; left: 0; color: var(--terracotta); font-size: 1.05rem; }

/* prev/next nav */
.pagenav { display: flex; justify-content: space-between; gap: 1rem; padding: 2.5rem 0 1rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pagenav a { display: flex; flex-direction: column; gap: .1rem; color: var(--azul-deep); font-weight: 600; }
.pagenav a span { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-soft); font-weight: 500; }
.pagenav a.next { text-align: right; margin-left: auto; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  background: var(--azul-deep); color: rgba(245,236,220,.7);
  padding: 2.5rem 0; margin-top: 2rem; text-align: center; font-size: .88rem;
}
.footer strong { color: var(--gold); font-family: var(--font-display); }
.footer a { color: var(--cream); }

@media (max-width: 620px) {
  .route__stop::after { display: none; }
  .hero__stats { gap: 1.4rem; }
}

/* ==========================================================================
   EASTER EGGS 🥚 (photos of the crew)
   ========================================================================== */
/* peekers — a crew photo peeking from a screen edge */
.egg-peek {
  position: fixed; bottom: 0; width: 96px; height: auto; z-index: 60;
  cursor: pointer; opacity: .96; -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.32));
  transition: transform .38s cubic-bezier(.2,.7,.2,1);
}
.egg-peek--l { left: 14px; transform: translateY(62%) rotate(-6deg); }
.egg-peek--r { right: 14px; transform: translateY(62%) rotate(6deg); }
.egg-peek--l:hover, .egg-peek--l.up { transform: translateY(2%) rotate(-3deg); }
.egg-peek--r:hover, .egg-peek--r.up { transform: translateY(2%) rotate(3deg); }
@media (max-width: 640px) {
  .egg-peek { width: 68px; }
  .egg-peek--l { transform: translateY(68%) rotate(-6deg); }
  .egg-peek--r { transform: translateY(68%) rotate(6deg); }
}

/* clickable sailboat in the home hero */
#egg-boat { transform-box: fill-box; transform-origin: center; animation: egg-boat-bob 3.2s ease-in-out infinite; }
@keyframes egg-boat-bob { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-3px) rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { #egg-boat { animation: none; } }

.egg-fly {
  position: fixed; left: -240px; width: 170px; height: auto; z-index: 70;
  pointer-events: none; filter: drop-shadow(0 8px 18px rgba(0,0,0,.35));
  animation: egg-fly 3.4s linear forwards;
}
@keyframes egg-fly {
  from { transform: translateX(0) rotate(var(--r, 0deg)); }
  to   { transform: translateX(calc(100vw + 460px)) rotate(calc(var(--r, 0deg) * -1)); }
}
.egg-banner {
  position: fixed; top: 16%; left: 50%; z-index: 80; pointer-events: none;
  transform: translateX(-50%) rotate(-4deg); white-space: nowrap;
  font-family: var(--font-display); font-weight: 600; font-size: clamp(1.8rem, 7vw, 3.8rem);
  color: #fffdf8; background: linear-gradient(135deg, var(--terracotta), var(--gold));
  padding: .45rem 1.3rem; border-radius: 16px; box-shadow: var(--shadow-lg);
  animation: egg-pop .5s cubic-bezier(.2,1.6,.4,1);
}
@keyframes egg-pop { from { transform: translateX(-50%) scale(.3) rotate(-4deg); opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .egg-fly { animation-duration: .3s; } }
