/* ===================================================
   ALGARVE FOR AMERICANS — STYLESHEET
   Aesthetic: Sun-bleached Mediterranean editorial
   Palette: Warm terracotta, Atlantic blue, sand, ivory
   =================================================== */

:root {
  --terra: #C4622D;
  --terra-light: #E8845A;
  --terra-pale: #F5DDD0;
  --ocean: #1A4E6E;
  --ocean-mid: #2D7EA8;
  --ocean-light: #9DCCE0;
  --sand: #F0E8D8;
  --sand-deep: #D9CFBB;
  --ivory: #FAF7F2;
  --dark: #1C1A17;
  --mid: #5A5044;
  --light-text: #8C7E71;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', sans-serif;

  --max-w: 1200px;
  --section-pad: 90px 24px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--ivory);
  color: var(--dark);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ——— TYPOGRAPHY ——— */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
}
h1 { font-size: clamp(2.8rem, 6vw, 5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
h3 { font-size: clamp(1.4rem, 2.5vw, 1.8rem); }
em { font-style: italic; color: var(--terra); }
a { color: inherit; text-decoration: none; }
p { line-height: 1.75; }

/* ——— NAV ——— */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: rgba(250, 247, 242, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sand-deep);
  transition: box-shadow 0.3s ease;
}
.nav.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.08); }

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ocean);
  letter-spacing: 0.01em;
}
.nav-logo em { color: var(--terra); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--mid);
  letter-spacing: 0.03em;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--terra); }
.nav-cta {
  background: var(--terra) !important;
  color: white !important;
  padding: 9px 20px !important;
  border-radius: 4px;
  transition: background 0.2s !important;
}
.nav-cta:hover { background: var(--terra-light) !important; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; }

/* ——— HERO ——— */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 70% 40%, rgba(26, 78, 110, 0.4) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(196, 98, 45, 0.3) 0%, transparent 50%),
    linear-gradient(160deg, #0D2E45 0%, #1A4E6E 35%, #0A2233 100%);
  animation: heroShift 18s ease-in-out infinite alternate;
}

@keyframes heroShift {
  0% { filter: brightness(1); }
  100% { filter: brightness(1.08) saturate(1.1); }
}

/* Wave of light mimicking Portuguese tiles */
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent 0,
      transparent 40px,
      rgba(255,255,255,0.015) 40px,
      rgba(255,255,255,0.015) 41px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent 0,
      transparent 40px,
      rgba(255,255,255,0.015) 40px,
      rgba(255,255,255,0.015) 41px
    );
}

.hero-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(to bottom, transparent, var(--ivory));
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 120px 32px 80px;
  width: 100%;
}

.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ocean-light);
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.2s forwards;
}

.hero-title {
  color: white;
  margin-bottom: 24px;
  max-width: 700px;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.4s forwards;
}

.hero-sub {
  color: rgba(255,255,255,0.72);
  font-size: 1.1rem;
  max-width: 560px;
  margin-bottom: 40px;
  font-weight: 300;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.6s forwards;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.8s forwards;
}

.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
  z-index: 2;
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:0.4;} 50%{opacity:0.8;} }

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

/* ——— BUTTONS ——— */
.btn-primary {
  display: inline-block;
  background: var(--terra);
  color: white;
  padding: 14px 32px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover { background: var(--terra-light); transform: translateY(-1px); }

.btn-ghost {
  display: inline-block;
  color: white;
  padding: 14px 24px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  font-weight: 400;
  font-size: 0.95rem;
  transition: border-color 0.2s, background 0.2s;
}
.btn-ghost:hover { border-color: white; background: rgba(255,255,255,0.08); }

/* ——— INTRO STRIP ——— */
.intro-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--ocean);
  padding: 32px 24px;
  flex-wrap: wrap;
}
.strip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 40px;
  text-align: center;
}
.strip-num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--terra-light);
  line-height: 1;
}
.strip-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  margin-top: 4px;
}
.strip-divider {
  width: 1px;
  height: 48px;
  background: rgba(255,255,255,0.15);
}

/* ——— SECTION HEADERS ——— */
.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 60px;
}
.section-header.light h2, .section-header.light .section-sub { color: white; }
.section-header.light .eyebrow { color: var(--terra-light); }
.eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: 12px;
}
.section-sub {
  font-size: 1rem;
  color: var(--light-text);
  margin-top: 16px;
  font-weight: 300;
}

/* ——— PILLARS ——— */
.pillars {
  padding: var(--section-pad);
  max-width: var(--max-w);
  margin: 0 auto;
}
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.pillar-card {
  display: block;
  padding: 36px 32px;
  border: 1px solid var(--sand-deep);
  border-radius: 8px;
  background: white;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  text-decoration: none;
  color: var(--dark);
}
.pillar-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.08);
  border-color: var(--terra-pale);
}
.pillar-icon { font-size: 2rem; margin-bottom: 16px; }
.pillar-card h3 { margin-bottom: 12px; }
.pillar-card p { font-size: 0.9rem; color: var(--mid); line-height: 1.65; }
.pillar-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--terra);
  letter-spacing: 0.03em;
}
.pillar-card:hover .pillar-link { text-decoration: underline; }

/* ——— TOWNS ——— */
.towns {
  background: var(--ocean);
  padding: var(--section-pad);
}
.towns .section-header { margin-bottom: 48px; }
.towns-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.town-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.town-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.town-img {
  height: 180px;
  background-size: cover;
  background-position: center;
}

/* Gradient placeholders representing each town's feel */
.town-lagos {
  background: linear-gradient(135deg, #1A6B8A 0%, #E8845A 100%);
  position: relative;
}
.town-lagos::after { content: '🏖️'; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 3rem; }
.town-tavira {
  background: linear-gradient(135deg, #C4622D 0%, #F0E8D8 100%);
  position: relative;
}
.town-tavira::after { content: '🏛️'; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 3rem; }
.town-vilamoura {
  background: linear-gradient(135deg, #0D2E45 0%, #2D7EA8 100%);
  position: relative;
}
.town-vilamoura::after { content: '⛳'; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 3rem; }
.town-silves {
  background: linear-gradient(135deg, #5A7A2E 0%, #C4622D 100%);
  position: relative;
}
.town-silves::after { content: '🏰'; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 3rem; }

.town-body { padding: 24px; }
.town-body h3 { font-size: 1.4rem; margin-bottom: 4px; }
.town-type { font-size: 0.75rem; color: var(--terra); font-weight: 500; letter-spacing: 0.05em; margin-bottom: 10px; text-transform: uppercase; }
.town-body p { font-size: 0.875rem; color: var(--mid); line-height: 1.65; }

/* ——— NEWSLETTER ——— */
.newsletter {
  background: var(--terra-pale);
  padding: 72px 24px;
}
.newsletter-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 60px;
}
.newsletter-text { flex: 1; }
.newsletter-text h2 { margin: 12px 0; color: var(--ocean); }
.newsletter-text p { color: var(--mid); font-size: 0.95rem; }
.newsletter-form {
  flex: 0 0 340px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.newsletter-form input[type="email"] {
  padding: 14px 16px;
  border: 1px solid var(--sand-deep);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: white;
  outline: none;
  transition: border-color 0.2s;
}
.newsletter-form input[type="email"]:focus { border-color: var(--terra); }
.newsletter-form button {
  padding: 14px;
  background: var(--ocean);
  color: white;
  border: none;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.newsletter-form button:hover { background: var(--ocean-mid); }

/* ——— TESTIMONIALS ——— */
.testimonials {
  padding: var(--section-pad);
  max-width: var(--max-w);
  margin: 0 auto;
}
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.testimonial-card {
  padding: 36px;
  background: var(--sand);
  border-radius: 8px;
  border-left: 3px solid var(--terra);
}
.quote {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--ocean);
  line-height: 1.6;
  margin-bottom: 20px;
}
.attribution {
  font-size: 0.8rem;
  color: var(--light-text);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ——— FOOTER ——— */
.footer {
  background: var(--dark);
  color: rgba(255,255,255,0.65);
  padding: 60px 32px 0;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  gap: 60px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand { flex: 0 0 260px; }
.footer-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: white;
  margin-bottom: 8px;
  font-weight: 400;
}
.footer-logo em { color: var(--terra-light); }
.footer-tagline { font-size: 0.875rem; }
.footer-links {
  flex: 1;
  display: flex;
  gap: 48px;
}
.footer-col-head {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: white;
  font-weight: 600;
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 0.875rem; transition: color 0.2s; }
.footer-col a:hover { color: var(--terra-light); }
.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 20px 0;
  font-size: 0.8rem;
  opacity: 0.45;
}

/* ——— NARRATIVE SECTION ——— */
.narrative {
  padding: var(--section-pad);
  background: var(--ivory);
}
.narrative-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 80px;
  align-items: start;
}
.narrative-text .eyebrow { margin-bottom: 12px; }
.narrative-text h2 { margin-bottom: 20px; }
.narrative-text p { color: var(--mid); margin-bottom: 16px; }
.link-arrow { display: inline-block; margin-top: 8px; font-size: 0.875rem; font-weight: 500; color: var(--terra); }
.link-arrow:hover { text-decoration: underline; }
.narrative-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--sand-deep); border-radius: 10px; overflow: hidden; }
.stat-block { background: white; padding: 28px 24px; display: flex; flex-direction: column; gap: 4px; }
.stat-num { font-family: var(--font-display); font-size: 2.2rem; color: var(--ocean); font-weight: 600; line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--light-text); letter-spacing: 0.04em; line-height: 1.4; }

/* ——— HOW IT WORKS ——— */
.how-it-works { background: var(--ocean); padding: var(--section-pad); }
.how-it-works .section-header { margin-bottom: 56px; }
.how-grid { max-width: 960px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: start; gap: 16px; }
.how-step { text-align: center; }
.how-num { font-family: var(--font-display); font-size: 3rem; color: var(--terra-light); font-weight: 300; line-height: 1; margin-bottom: 12px; }
.how-step h3 { color: white; font-size: 1.1rem; margin-bottom: 8px; }
.how-step p { color: rgba(255,255,255,0.6); font-size: 0.875rem; }
.how-arrow { font-size: 1.8rem; color: rgba(255,255,255,0.2); padding-top: 24px; }
.how-disclosure { max-width: 720px; margin: 48px auto 0; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; padding: 22px 28px; font-size: 0.83rem; color: rgba(255,255,255,0.55); line-height: 1.7; text-align: center; }
.how-disclosure strong { color: rgba(255,255,255,0.8); }

/* ——— DARK PILLAR CTA ——— */
.pillar-cta-dark { background: var(--ocean) !important; border-color: var(--ocean) !important; }
.pillar-cta-dark h3 { color: white; }
.pillar-cta-dark p { color: rgba(255,255,255,0.7) !important; }
.pillar-link-light { color: var(--terra-light) !important; }

/* ——— DARK BUTTON ——— */
.btn-primary-dark { display: inline-block; background: var(--terra); color: white; padding: 16px 40px; border-radius: 4px; font-weight: 500; font-size: 1rem; letter-spacing: 0.03em; transition: background 0.2s, transform 0.15s; }
.btn-primary-dark:hover { background: var(--terra-light); transform: translateY(-1px); }

@media (max-width: 900px) {
  .narrative-inner { grid-template-columns: 1fr; gap: 40px; }
  .how-grid { grid-template-columns: 1fr; }
  .how-arrow { display: none; }
}

/* ——— INNER PAGE LAYOUT ——— */
.page-hero {
  background: linear-gradient(135deg, var(--ocean) 0%, #0D2E45 100%);
  padding: 120px 32px 64px;
  text-align: center;
}
.page-hero h1 { color: white; margin-bottom: 16px; }
.page-hero p { color: rgba(255,255,255,0.7); font-size: 1.1rem; max-width: 600px; margin: 0 auto; font-weight: 300; }

.page-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 72px 24px;
}
.page-content h2 {
  margin: 48px 0 16px;
  font-size: 2rem;
  color: var(--ocean);
}
.page-content h3 {
  margin: 32px 0 12px;
  font-size: 1.4rem;
}
.page-content p { margin-bottom: 20px; color: var(--mid); }
.page-content ul, .page-content ol {
  margin: 0 0 20px 24px;
  color: var(--mid);
  line-height: 2;
}
.info-box {
  background: var(--terra-pale);
  border-left: 4px solid var(--terra);
  padding: 24px 28px;
  border-radius: 0 8px 8px 0;
  margin: 32px 0;
}
.info-box strong { color: var(--terra); display: block; margin-bottom: 8px; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; }

.cost-table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  font-size: 0.9rem;
}
.cost-table th {
  background: var(--ocean);
  color: white;
  padding: 12px 16px;
  text-align: left;
  font-weight: 500;
}
.cost-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--sand-deep);
  color: var(--mid);
}
.cost-table tr:nth-child(even) td { background: var(--sand); }
.cost-table .total td { font-weight: 600; color: var(--ocean); border-top: 2px solid var(--ocean); }

/* ——— CONTACT FORM ——— */
.contact-form {
  background: white;
  border: 1px solid var(--sand-deep);
  border-radius: 8px;
  padding: 48px;
  margin-top: 40px;
}
.form-group {
  margin-bottom: 24px;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--dark);
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--sand-deep);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--dark);
  background: var(--ivory);
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--terra); }
.form-group textarea { resize: vertical; min-height: 120px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-submit {
  width: 100%;
  padding: 16px;
  background: var(--terra);
  color: white;
  border: none;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.form-submit:hover { background: var(--terra-light); }

/* ——— RESPONSIVE ——— */
@media (max-width: 1024px) {
  .pillars-grid { grid-template-columns: repeat(2, 1fr); }
  .towns-grid { grid-template-columns: repeat(2, 1fr); }
  .testimonials-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --section-pad: 60px 20px; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--ivory); padding: 20px 32px; border-bottom: 1px solid var(--sand-deep); gap: 16px; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .hero-content { padding: 100px 20px 60px; }
  .pillars-grid { grid-template-columns: 1fr; }
  .towns-grid { grid-template-columns: 1fr; }
  .newsletter-inner { flex-direction: column; gap: 32px; }
  .newsletter-form { flex: none; width: 100%; }
  .footer-inner { flex-direction: column; gap: 32px; }
  .footer-links { flex-direction: column; gap: 24px; }
  .strip-divider { display: none; }
  .strip-item { padding: 12px 20px; }
  .form-row { grid-template-columns: 1fr; }
  .contact-form { padding: 28px 20px; }
  .intro-strip { gap: 0; }
}
