/* ==========================================================================
   Icon7 Redesign — Global Design System (Phase 3 foundation)
   --------------------------------------------------------------------------
   Extracted from the static prototypes' inline <style> (icon7-home.html et al).
   This is the SHARED stylesheet every converted page builds on. It is enqueued
   LAST in functions.php so it layers on top of the legacy theme CSS
   (plugins.min.css / style.css) without editing them.

   HOW LATER PAGE AGENTS MUST USE THIS FILE  (keep all 9 pages consistent):
   -------------------------------------------------------------------------
   1. Design tokens live in :root below — ALWAYS use var(--navy) etc., never
      re-hardcode hex values.
   2. Typography: body is Playfair Display; use class .italianno for the script
      accent (Italianno). Do not introduce other fonts.
   3. Buttons: reuse .btn-primary (light/ghost on dark), .btn-secondary
      (navy outline on light), .btn-light (white outline, terracotta hover),
      .btn-dark (white outline, lake-blue hover). Do NOT invent new button
      classes unless the design truly needs one.
   4. Nav + footer are GLOBAL (header.php / footer.php). Nav styles are scoped
      to #navbar; footer styles to .rd-footer. Do not restyle them per page.
   5. Section rhythm: wrap each converted page's body content in
      <main class="rd-page"> … </main>. Shared vertical rhythm, hero, grids and
      the decorative .section-title / .section-body live under .rd-page so they
      never leak onto the 3 out-of-scope legacy pages (checkout,
      list-your-property, 404) that keep the old CSS.
   6. Page-specific rules go in assets/css/pages/<slug>.css, scoped under a
      page wrapper class (e.g. .legal-page) so a page's local variant of a
      shared class name (like .section-title) never collides globally.
   7. Breakpoints (match the prototypes): desktop default, <=1024px tablet
      (nav-links hide, grids collapse to 1col, section padding 5rem 2rem),
      <=768px mobile (hero title shrinks, footer stacks).
   ========================================================================== */

/* ---------- Design tokens ------------------------------------------------ */
:root {
    --navy: #1A2B4A;
    --lake-blue: #5B8FA8;
    --terracotta: #A9593F;
    --gold: #C7A36B;
    --cream: #EEEEE5;
    --white: #FFFFFF;
    --text-dark: #1A2B4A;
    --text-light: #EEEEE5;

    /* Fonts (single source of truth) */
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-script: 'Italianno', cursive;
}

/* ---------- Safe global resets ------------------------------------------ *
 * Intentionally conservative: border-box is already assumed by the legacy
 * Bootstrap base, so this is additive and safe. We do NOT run a blanket
 * `* { margin:0; padding:0 }` reset here — that would break the spacing on the
 * unconverted legacy pages. Per-page zeroing happens under .rd-page instead.  */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-serif);
    color: var(--text-dark);
    line-height: 1.7;
    overflow-x: hidden; /* prototype relies on this; also kills stray h-scroll */
}

.italianno {
    font-family: var(--font-script);
    font-weight: 400;
}

/* ==========================================================================
   NAVIGATION  (header.php) — scoped to #navbar
   Fixed transparent bar over the hero; adds .scrolled (white bg + inverted
   logo + navy text) once the user scrolls. Toggled by assets/js/redesign.js.
   ========================================================================== */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.97);
    padding: 0.5rem 4rem;
    box-shadow: 0 1px 0 rgba(26, 43, 74, 0.08);
}

#navbar .nav-logo {
    height: 160px;
    margin: -40px 0;
    width: auto;
    transition: filter 0.4s ease, height 0.4s ease;
}

#navbar.scrolled .nav-logo {
    height: 120px;
    margin: -30px 0;
    filter: invert(1); /* white prototype logo -> navy when bar turns white */
}

#navbar .nav-links {
    display: flex;
    gap: 3rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

#navbar .nav-links a {
    font-family: var(--font-serif);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--white);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

#navbar.scrolled .nav-links a {
    color: var(--navy);
}

#navbar .nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: currentColor;
    transition: width 0.3s ease;
}

#navbar .nav-links a:hover::after {
    width: 100%;
}

#navbar .nav-cta {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--white);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

#navbar.scrolled .nav-cta {
    color: var(--navy);
    border-color: var(--navy);
}

#navbar .nav-cta:hover {
    background-color: var(--white);
    color: var(--navy);
}

#navbar.scrolled .nav-cta:hover {
    background-color: var(--navy);
    color: var(--white);
}

/* Mobile hamburger (bootstrap #offcanvasRight trigger) — hidden on desktop,
   shown <=1024px where .nav-links collapse. The button keeps its legacy
   .menu__btn markup/data-bs-* so the existing offcanvas keeps working. */
#navbar .rd-menu-btn {
    display: none;
    background: transparent;
    border: 0;
    padding: 0.5rem;
    cursor: pointer;
    line-height: 0;
}

#navbar .rd-menu-btn .rd-burger,
#navbar .rd-menu-btn .rd-burger::before,
#navbar .rd-menu-btn .rd-burger::after {
    display: block;
    width: 26px;
    height: 2px;
    background-color: var(--white);
    transition: background-color 0.4s ease;
    position: relative;
}

#navbar .rd-menu-btn .rd-burger::before,
#navbar .rd-menu-btn .rd-burger::after {
    content: '';
    position: absolute;
    left: 0;
}

#navbar .rd-menu-btn .rd-burger::before { top: -8px; }
#navbar .rd-menu-btn .rd-burger::after  { top: 8px; }

#navbar.scrolled .rd-menu-btn .rd-burger,
#navbar.scrolled .rd-menu-btn .rd-burger::before,
#navbar.scrolled .rd-menu-btn .rd-burger::after {
    background-color: var(--navy);
}

/* ==========================================================================
   SHARED BUTTONS
   ========================================================================== */
.btn-primary,
.btn-secondary,
.btn-light,
.btn-dark {
    font-family: var(--font-serif);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    padding: 1rem 2.5rem;
    text-decoration: none;
    display: inline-block;
    border: 1px solid;
    background: transparent;
    cursor: pointer;
    transition: all 0.4s ease;
}

/* light/ghost — for use over dark imagery/hero */
.btn-primary { color: var(--white); border-color: var(--white); }
.btn-primary:hover { background-color: var(--white); color: var(--navy); }

/* navy outline — for use on light backgrounds */
.btn-secondary { color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover { background-color: var(--navy); color: var(--white); }

/* white outline, terracotta text on hover */
.btn-light { color: var(--white); border-color: var(--white); }
.btn-light:hover { background-color: var(--white); color: var(--terracotta); }

/* white outline, lake-blue text on hover */
.btn-dark { color: var(--white); border-color: var(--white); }
.btn-dark:hover { background-color: var(--white); color: var(--lake-blue); }

/* ==========================================================================
   SECTION RHYTHM + DECORATIVE HEADINGS  (scoped to .rd-page)
   Wrap converted page content in <main class="rd-page">. These are the shared
   defaults; individual pages refine specifics in their own pages/<slug>.css.
   ========================================================================== */
.rd-page section {
    padding: 8rem 4rem;
}

/* Large decorative section heading (Playfair or add .italianno for script) */
.rd-page .section-title {
    font-family: var(--font-script);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 400;
    margin-bottom: 2rem;
}

.rd-page .section-body {
    font-size: 1.1rem;
    line-height: 1.9;
    max-width: 650px;
}

/* Scroll-reveal helpers (driven by IntersectionObserver in redesign.js) */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   FOOTER  (footer.php) — scoped to .rd-footer
   ========================================================================== */
.rd-footer {
    background-color: var(--navy);
    color: var(--white);
    padding: 4rem;
}

.rd-footer .footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 3fr 1fr 1fr;
    gap: 3rem;
}

.rd-footer .footer-brand p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    margin-top: 1.5rem;
    max-width: 300px;
}

.rd-footer .footer-logo {
    height: 140px;
    width: auto;
    margin: -35px 0 -35px -20px;
}

.rd-footer .footer-column h4 {
    font-family: var(--font-serif);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    margin-bottom: 1.5rem;
    color: var(--gold);
}

.rd-footer .footer-column ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rd-footer .footer-column li {
    margin-bottom: 0.75rem;
}

.rd-footer .footer-column a {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.rd-footer .footer-column a:hover {
    color: var(--white);
}

.rd-footer .contact-icon,
.offcanvas .contact-icon {
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.rd-footer .footer-social {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.rd-footer .footer-social a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.3s ease;
}

.rd-footer .footer-social a:hover {
    color: var(--white);
}

.rd-footer .footer-social svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.rd-footer .footer-bottom {
    max-width: 1400px;
    margin: 3rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.rd-footer .footer-bottom p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

.rd-footer .footer-bottom a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
}

.rd-footer .footer-bottom a:hover {
    color: var(--white);
}

/* ==========================================================================
   RESPONSIVE BASE  (breakpoints match the prototypes)
   ========================================================================== */
@media (max-width: 1024px) {
    #navbar {
        padding: 1rem 2rem;
    }

    #navbar.scrolled {
        padding: 0.5rem 2rem;
    }

    #navbar .nav-links,
    #navbar .nav-cta {
        display: none; /* replaced by the offcanvas hamburger on mobile/tablet */
    }

    #navbar .rd-menu-btn {
        display: inline-block;
    }

    .rd-page section {
        padding: 5rem 2rem;
    }

    .rd-footer .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .rd-footer .footer-content {
        grid-template-columns: 1fr;
    }

    .rd-footer .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}


/* ========================================================================== 
   QA REMEDIATION: ACCESSIBILITY, INTERACTION AND EDGE STATES
   ========================================================================== */
.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 10000;
    padding: 0.75rem 1rem;
    background: var(--white);
    color: var(--navy);
    border: 2px solid var(--navy);
    transform: translateY(-160%);
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

#navbar a:focus-visible,
#navbar button:focus-visible,
.rd-footer a:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-light:focus-visible,
.btn-dark:focus-visible,
.whatsapp-float:focus-visible,
.rts__back__top:focus-visible,
.offcanvas a:focus-visible,
.offcanvas button:focus-visible,
.rd-page input:focus-visible,
.rd-page select:focus-visible,
.rd-page textarea:focus-visible,
.rd-page button:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 4px;
}

#navbar a[aria-current="page"]::after {
    width: 100%;
}

.offcanvas-logo-link {
    display: block;
    width: min(180px, 55vw);
    height: auto;
}

.offcanvas-logo-link img {
    display: block;
    width: 100%;
    height: auto;
}

.whatsapp-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.loader-wrapper.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Complete state for the previously empty 404 template. */
.error-page .error-hero {
    min-height: 100vh;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 10rem 2rem 7rem;
    color: var(--white);
    background:
        linear-gradient(rgba(26, 43, 74, 0.64), rgba(26, 43, 74, 0.78)),
        url('../images/redesign/como-hero.webp') center / cover no-repeat;
}

.error-page .error-hero__inner {
    width: min(720px, 100%);
}

.error-page .error-code {
    margin: 0;
    font-family: var(--font-script);
    font-size: clamp(7rem, 22vw, 14rem);
    line-height: 0.7;
    color: var(--gold);
}

.error-page h1 {
    color: var(--white);
    margin: 2rem 0 1rem;
    font-size: clamp(2.25rem, 6vw, 4.75rem);
    font-weight: 400;
    line-height: 1.08;
}

.error-page p:not(.error-code) {
    max-width: 610px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.86);
}

.error-page .error-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2.25rem;
}

@media (max-width: 480px) {
    .error-page .error-actions a {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .fade-in,
    .villeggiatura-content,
    .testimonial {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ========================================================================== 
   QA ROUND 2 — TABLET NAVIGATION RELIABILITY
   ========================================================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    #navbar .rd-menu-btn.menu__btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        visibility: visible !important;
        opacity: 1 !important;
        width: 48px;
        height: 48px;
        flex: 0 0 48px;
        position: relative;
        z-index: 2;
    }

    #navbar .nav-links,
    #navbar .nav-cta {
        display: none !important;
    }
}

@media (max-width: 768px) {
    #navbar .rd-menu-btn.menu__btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        visibility: visible !important;
        opacity: 1 !important;
        min-width: 44px;
        min-height: 44px;
    }
}
