:root {
  --ink: #18363a;
  --deep: #153f46;
  --sea: #2f7277;
  --foam: #dcebea;
  --sand: #f6f2e9;
  --paper: #fffdf8;
  --coral: #de785e;
  --line: rgba(24, 54, 58, .16);
  --shadow: 0 22px 55px rgba(20, 57, 62, .14);
  --serif: "Newsreader", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); }
a { color: inherit; }
button { font: inherit; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 14px; background: #fff; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.site-header { height: 88px; display: flex; align-items: center; justify-content: space-between; padding: 9px clamp(24px, 5vw, 76px); background: rgba(255, 253, 248, .95); border-bottom: 1px solid var(--line); position: relative; z-index: 30; }
.brand { display: block; width: min(330px, 38vw); height: 70px; overflow: hidden; }
.brand img { width: 100%; height: 100%; object-fit: contain; }
.language-switcher { display: flex; align-items: center; gap: 4px; margin-left: auto; margin-right: 28px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; }
.language-switcher a { min-width: 32px; padding: 6px 7px; border-radius: 999px; color: #667b7d; text-align: center; text-decoration: none; font-size: .67rem; font-weight: 700; }
.language-switcher a:hover, .language-switcher a[aria-current="page"] { color: white; background: var(--deep); }
nav { display: flex; align-items: center; gap: 34px; font-size: .9rem; font-weight: 600; }
nav a { text-decoration: none; }
.nav-cta { padding: 12px 19px; color: white; background: var(--deep); border-radius: 999px; }
.menu-toggle { display: none; border: 0; background: transparent; color: var(--ink); font-weight: 700; }

.hero { position: relative; min-height: calc(100svh - 88px); overflow: hidden; color: white; display: grid; align-items: end; }
.hero-photo, .hero-shade { position: absolute; inset: 0; }
.hero-photo { background-image: url("assets/madeira-hero.png"); background-size: cover; background-position: center 48%; transform: scale(1.01); }
.hero-shade { background: linear-gradient(90deg, rgba(9, 35, 39, .88) 0%, rgba(9, 35, 39, .47) 50%, rgba(9, 35, 39, .06) 85%), linear-gradient(0deg, rgba(9, 35, 39, .38), transparent 55%); }
.hero-content { position: relative; z-index: 2; width: min(790px, 86vw); padding: clamp(70px, 10vw, 140px) clamp(24px, 7vw, 106px); }
.eyebrow { margin: 0 0 18px; color: var(--sea); font-size: .72rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.eyebrow.light { color: #cde8e7; }
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.035em; margin: 0; }
h1 { font-size: clamp(3.5rem, 8vw, 7.6rem); line-height: .87; }
h1 em { color: #f0b296; font-weight: 400; }
.hero-copy { max-width: 550px; margin: 30px 0; font-size: clamp(1rem, 1.6vw, 1.22rem); line-height: 1.65; color: rgba(255,255,255,.86); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 26px; min-height: 52px; padding: 0 22px; border-radius: 999px; text-decoration: none; font-size: .86rem; font-weight: 700; transition: transform .2s ease, background .2s ease; }
.button:hover { transform: translateY(-2px); }
.button-light { background: white; color: var(--ink); }
.button-dark { background: var(--deep); color: white; }
.hero-note { position: absolute; right: clamp(24px, 6vw, 88px); bottom: 54px; z-index: 2; display: flex; align-items: center; gap: 14px; font-size: .75rem; line-height: 1.5; }
.note-score { width: 62px; height: 62px; border: 1px solid rgba(255,255,255,.6); border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 1.55rem; }

.section { padding: clamp(80px, 11vw, 150px) clamp(22px, 7vw, 106px); }
.section-heading { display: grid; grid-template-columns: 1.1fr .7fr; gap: 8vw; align-items: end; max-width: 1250px; margin: 0 auto 58px; }
.section-heading h2, .contact h2, .why h2 { font-size: clamp(2.8rem, 5vw, 5.2rem); line-height: .95; }
.section-heading > p { margin: 0; color: #587074; line-height: 1.75; max-width: 530px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; max-width: 1250px; margin: 0 auto 35px; }
.filter { border: 1px solid var(--line); background: transparent; color: var(--ink); padding: 10px 15px; border-radius: 999px; cursor: pointer; }
.filter span { margin-left: 6px; opacity: .55; }
.filter:hover, .filter.is-active { color: white; background: var(--deep); border-color: var(--deep); }

.property-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 38px 24px; max-width: 1250px; margin: auto; }
.property-card { grid-column: span 4; min-width: 0; }
.property-card:nth-child(5n + 1), .property-card:nth-child(5n + 2) { grid-column: span 6; }
.card-link { display: block; text-decoration: none; }
.card-media { position: relative; height: 340px; overflow: hidden; background: var(--foam); }
.property-card:nth-child(5n + 1) .card-media, .property-card:nth-child(5n + 2) .card-media { height: 430px; }
.card-media img { width: 100%; height: 100%; display: block; object-fit: cover; opacity: 0; transform: scale(1.03); transition: opacity .45s ease, transform .5s ease; }
.card-media img.is-loaded { opacity: 1; }
.card-link:hover img { transform: scale(1.08); }
.card-badge { position: absolute; top: 16px; left: 16px; z-index: 2; padding: 8px 11px; background: rgba(255,253,248,.92); border-radius: 999px; font-size: .69rem; font-weight: 700; }
.card-arrow { position: absolute; right: 16px; bottom: 16px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: white; font-size: 1.2rem; }
.card-copy { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; padding-top: 18px; }
.card-copy h3 { margin: 0; font-family: var(--serif); font-size: clamp(1.45rem, 2vw, 1.9rem); font-weight: 500; line-height: 1.05; }
.card-location { grid-column: 1; margin: 0; color: #687c7e; font-size: .81rem; }
.card-score { grid-row: 1 / span 2; grid-column: 2; align-self: start; border-left: 1px solid var(--line); padding-left: 14px; text-align: center; font-weight: 700; }
.card-score small { display: block; color: #718285; font-size: .6rem; font-weight: 500; text-transform: uppercase; }
.empty-state { grid-column: 1 / -1; padding: 60px 0; color: #607578; }

.why { padding-block: 0; display: grid; grid-template-columns: 1.05fr .95fr; min-height: 720px; background: var(--deep); color: white; }
.why-image { min-height: 620px; background: #234e53 center/cover no-repeat; }
.why-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(55px, 8vw, 120px); }
.why-copy > p:not(.eyebrow) { color: rgba(255,255,255,.7); line-height: 1.8; max-width: 520px; margin: 28px 0 38px; }
.benefits { border-top: 1px solid rgba(255,255,255,.2); display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding-top: 28px; }
.benefits strong, .benefits span { display: block; }
.benefits strong { font-family: var(--serif); font-size: 1.65rem; font-weight: 500; color: #f0b296; }
.benefits span { margin-top: 5px; font-size: .68rem; color: rgba(255,255,255,.62); }
.booking { display: grid; grid-template-columns: .78fr 1.22fr; gap: clamp(50px, 9vw, 130px); background: var(--paper); align-items: start; }
.booking-intro { position: sticky; top: 40px; }
.booking-intro h2 { font-size: clamp(2.8rem, 5vw, 5.2rem); line-height: .95; }
.booking-intro > p:not(.eyebrow) { max-width: 470px; margin: 28px 0; color: #607578; line-height: 1.75; }
.booking-promises { display: flex; flex-direction: column; gap: 12px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--sea); font-size: .82rem; font-weight: 600; }
.booking-form { padding: clamp(28px, 4vw, 54px); background: var(--sand); border: 1px solid rgba(24, 54, 58, .08); }
.booking-honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 18px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field > span { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.field small { color: #7c8c8e; font-weight: 500; text-transform: none; }
.field input, .field select, .field textarea { width: 100%; border: 0; border-bottom: 1px solid #aebcba; border-radius: 0; padding: 13px 2px; background: transparent; color: var(--ink); font: inherit; outline: none; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-bottom-color: var(--sea); box-shadow: 0 2px 0 -1px var(--sea); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-bottom-color: #a83f32; }
.booking-summary { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 28px 0 20px; padding: 15px 17px; border: 1px solid var(--line); background: rgba(255,255,255,.55); color: #64787a; font-size: .78rem; }
.booking-summary strong { color: var(--ink); font-size: .92rem; }
.consent { display: flex; align-items: flex-start; gap: 10px; color: #65787a; font-size: .7rem; line-height: 1.5; cursor: pointer; }
.consent input { margin-top: 3px; accent-color: var(--deep); }
.submit-booking { border: 0; cursor: pointer; margin-top: 22px; }
.submit-booking:disabled { opacity: .6; cursor: wait; }
.form-note { color: #758587; font-size: .68rem; line-height: 1.55; max-width: 580px; }
.form-status { margin-top: 18px; padding: 15px 17px; background: var(--foam); color: var(--deep); font-size: .78rem; line-height: 1.55; }
.form-status.is-error { background: #f8dfd9; color: #7b2d23; }
.form-status a { color: inherit; font-weight: 700; }
.contact { text-align: center; background: var(--sand); }
.contact p:not(.eyebrow) { max-width: 560px; margin: 26px auto; color: #607578; line-height: 1.7; }

.detail-view { min-height: calc(100vh - 88px); background: var(--paper); }
.is-detail .site-header nav, .is-detail .menu-toggle { visibility: hidden; }
.detail-hero { position: relative; height: min(68vh, 720px); min-height: 470px; overflow: hidden; background: var(--deep); }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(9,35,39,.7), transparent 62%); }
.detail-back { position: absolute; z-index: 2; top: 26px; left: clamp(20px, 5vw, 70px); background: white; color: var(--ink); text-decoration: none; padding: 11px 17px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.detail-title { position: absolute; z-index: 2; left: clamp(24px, 7vw, 106px); right: 24px; bottom: clamp(32px, 7vw, 90px); color: white; }
.detail-title h1 { font-size: clamp(3rem, 7vw, 7rem); max-width: 1030px; }
.detail-title p { font-weight: 600; opacity: .85; }
.detail-content { display: grid; grid-template-columns: 1fr 380px; gap: clamp(45px, 8vw, 120px); max-width: 1240px; margin: auto; padding: clamp(60px, 9vw, 120px) 24px; }
.detail-copy h2 { font-size: clamp(2.4rem, 4vw, 4rem); margin-bottom: 24px; }
.detail-copy > p { color: #587074; line-height: 1.85; font-size: 1.04rem; }
.detail-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 38px 0; }
.fact { border-top: 1px solid var(--line); padding-top: 13px; }
.fact strong, .fact span { display: block; }
.fact strong { font-family: var(--serif); font-size: 1.8rem; font-weight: 500; }
.fact span { font-size: .69rem; color: #6b8082; text-transform: uppercase; letter-spacing: .08em; }
.amenities { display: flex; gap: 9px; flex-wrap: wrap; }
.amenity { padding: 9px 12px; background: var(--foam); border-radius: 999px; font-size: .77rem; }
.booking-panel { align-self: start; position: sticky; top: 30px; padding: 30px; color: white; background: var(--deep); box-shadow: var(--shadow); }
.booking-panel .rating { display: flex; align-items: center; gap: 14px; padding-bottom: 25px; border-bottom: 1px solid rgba(255,255,255,.2); }
.booking-panel .rating strong { font-family: var(--serif); font-size: 2.6rem; color: #f0b296; }
.booking-panel p { line-height: 1.65; color: rgba(255,255,255,.7); }
.booking-panel .button { width: 100%; margin-top: 14px; }
.booking-panel .booking-secondary { background: transparent; border: 1px solid rgba(255,255,255,.32); color: white; }
.booking-panel small { display: block; margin-top: 15px; text-align: center; color: rgba(255,255,255,.55); }

footer { padding: 55px clamp(22px, 7vw, 106px) 35px; display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 18px 42px; border-top: 1px solid var(--line); }
footer img { width: 250px; height: 64px; object-fit: contain; }
footer p, footer a, footer small { font-size: .75rem; color: #62777a; }
footer small { grid-column: 1 / -1; }
.noscript { padding: 20px; text-align: center; background: #fee; }

@media (max-width: 900px) {
  .site-header { height: 76px; }
  .brand { width: 230px; height: 60px; }
  .language-switcher { margin-left: auto; margin-right: 14px; }
  nav { display: none; position: absolute; top: 76px; left: 0; right: 0; padding: 24px; background: var(--paper); border-bottom: 1px solid var(--line); flex-direction: column; }
  nav.is-open { display: flex; }
  .menu-toggle { display: block; }
  .hero { min-height: calc(100svh - 76px); }
  .hero-note { display: none; }
  .section-heading { grid-template-columns: 1fr; }
  .property-card, .property-card:nth-child(5n + 1), .property-card:nth-child(5n + 2) { grid-column: span 6; }
  .card-media, .property-card:nth-child(5n + 1) .card-media, .property-card:nth-child(5n + 2) .card-media { height: 330px; }
  .why { grid-template-columns: 1fr; }
  .why-image { min-height: 500px; }
  .booking { grid-template-columns: 1fr; }
  .booking-intro { position: static; }
  .detail-content { grid-template-columns: 1fr; }
  .booking-panel { position: static; }
}

@media (max-width: 620px) {
  .site-header { padding-inline: 16px; }
  .brand { width: min(170px, 44vw); }
  .language-switcher { gap: 1px; margin-right: 6px; }
  .language-switcher a { min-width: 25px; padding: 6px 4px; font-size: .61rem; }
  h1 { font-size: clamp(3rem, 14.5vw, 4rem); }
  .hero-content { width: 100%; padding-inline: 22px; }
  .section { padding-inline: 18px; }
  .filters { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 8px; }
  .filter { flex: 0 0 auto; }
  .property-grid { display: block; }
  .property-card { margin-bottom: 38px; }
  .card-media, .property-card:nth-child(5n + 1) .card-media, .property-card:nth-child(5n + 2) .card-media { height: 300px; }
  .why-image { min-height: 380px; }
  .why-copy { padding: 58px 22px; }
  .benefits { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: 1; }
  .booking-form { padding: 26px 18px; }
  .booking-summary { align-items: flex-start; flex-direction: column; }
  .detail-hero { min-height: 520px; }
  .detail-title h1 { font-size: clamp(2.8rem, 14vw, 4.2rem); }
  .detail-facts { grid-template-columns: 1fr 1fr; }
  footer { grid-template-columns: 1fr; text-align: center; }
  footer img { margin: auto; }
  footer small { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
