/* =============================================
   Mondial City — Public Common Styles
   Light & Vacation Theme (Alpitour-inspired)
   ============================================= */

/* ——— Design Tokens ——— */
:root {
    /* Core palette — chiara, ariosa */
    --ink-deep:    #0a2a3d;
    --ink:         #1e4058;
    --ink-soft:    #4e7a94;
    --ink-muted:   #85a9bf;
    --stone:       #c5dae8;
    --edge:        #dce8f0;
    --paper:       #f1f7fa;
    --paper-warm:  #faf7f2;
    --white:       #ffffff;

    /* Brand — Azzurro mare, corallo, menta fresca */
    --brand-sky:      #2d9cdb;
    --brand-sky-light:#d4ecf9;
    --brand-ocean:    #1a7fb5;
    --brand-coral:    #ff6b6b;
    --brand-coral-light: #ffe0e0;
    --brand-mint:     #2ecc9e;
    --brand-mint-light:#d4f5e8;

    /* Gradients */
    --grad-sky:     linear-gradient(135deg, #3ba9e0 0%, #1a7fb5 100%);
    --grad-coral:   linear-gradient(135deg, #ff6b6b 0%, #e74c3c 100%);
    --grad-mint:    linear-gradient(135deg, #2ecc9e 0%, #27ae60 100%);
    --grad-warm:    linear-gradient(180deg, #ffffff 0%, #f1f7fa 100%);
    --grad-hero:    linear-gradient(135deg, rgba(15,52,78,0.7) 0%, rgba(25,90,130,0.35) 100%);

    /* Sizing */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 999px;

    /* Shadows — più leggere */
    --shadow-sm: 0 2px 6px rgba(10, 42, 61, 0.05);
    --shadow-md: 0 6px 16px rgba(10, 42, 61, 0.08);
    --shadow-lg: 0 12px 28px rgba(10, 42, 61, 0.1);
    --shadow-xl: 0 20px 44px rgba(10, 42, 61, 0.13);

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* ——— Base ——— */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.65;
    color: var(--ink);
    background: var(--paper);
    padding-top: 160px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--brand-coral-light);
    color: var(--ink-deep);
}

/* ——— Typography ——— */
h1, h2, h3, h4 {
    font-family: 'Sora', 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ink-deep);
}

/* ——— Header ——— */
header {
    background: var(--white);
    color: var(--brand-ocean);
    padding: 0;
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--edge);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-height: 92px;
    padding: 0 24px;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    transition: opacity 0.2s var(--ease);
}

.logo a:hover { opacity: 0.9; }

.header-logo {
    height: var(--header-logo-height, 56px);
    width: auto;
}

/* Il toggle e il pannello sono mobili; il desktop resta invariato. */
.menu-toggle,
.mobile-menu {
    display: none;
}

.menu-toggle {
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--edge);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--ink-deep);
    cursor: pointer;
}

.menu-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 20px;
}

.menu-icon span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.menu-toggle:focus-visible {
    outline: 3px solid var(--brand-sky);
    outline-offset: 2px;
}

.brand-title {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--brand-sky) 0%, var(--brand-ocean) 70%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
}

.contact-info {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.84rem;
    color: var(--ink-soft);
}

.contact-info p {
    margin: 0;
    padding: 0.34rem 0.75rem;
    border: 1px solid var(--edge);
    border-radius: var(--radius-pill);
    background: var(--paper);
    line-height: 1.3;
}

.contact-info a {
    color: var(--brand-ocean);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s var(--ease);
}

.contact-info a:hover { color: var(--brand-coral); }

/* ——— Main Navigation ——— */
.main-nav {
    background: var(--white);
    border-bottom: 2px solid var(--edge);
    position: fixed;
    top: 92px;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(10, 42, 61, 0.04);
    height: 68px;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
    align-items: center;
    height: 100%;
    gap: 0.2rem;
}

.nav-menu li {
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-menu a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.2rem;
    height: 44px;
    line-height: 1;
    color: var(--ink-soft);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    border-radius: var(--radius-pill);
    transition: all 0.25s var(--ease);
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 50%;
    height: 3px;
    background: var(--brand-coral);
    border-radius: 3px;
    transition: transform 0.25s var(--ease);
}

.nav-menu a:hover {
    color: var(--ink-deep);
    background: var(--brand-sky-light);
}

.nav-menu a:hover::after { transform: translateX(-50%) scaleX(1); }

/* ——— Main Content ——— */
main {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding: 0 24px;
    min-height: 60vh;
}

/* ——— Footer ——— */
footer {
    margin-top: 5rem;
    background: var(--ink-deep);
    color: #cbdfeb;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-sky) 0%, var(--brand-coral) 50%, var(--brand-mint) 100%);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 24px 2.5rem;
    text-align: center;
}

.footer-content h3 {
    font-family: 'Sora', 'Inter', sans-serif;
    margin-bottom: 0.6rem;
    font-size: 1.2rem;
    color: var(--white);
}

.footer-content p {
    margin-bottom: 0.4rem;
    color: #9bbdd1;
    font-size: 0.93rem;
}

.footer-content a {
    color: var(--brand-sky);
    text-decoration: none;
    transition: color 0.2s var(--ease);
}

.footer-content a:hover { color: var(--brand-coral); }

/* ——— Buttons (generic) ——— */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-pill);
    font-size: 0.93rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.25s var(--ease);
    gap: 0.4rem;
    line-height: 1.2;
}

.btn-primary {
    background: var(--grad-sky);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(45, 156, 219, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(45, 156, 219, 0.4);
}

.btn-coral {
    background: var(--grad-coral);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn-coral:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(255, 107, 107, 0.4);
}

/* ——— Pagination ——— */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    margin: 2.5rem 0 1rem;
    padding: 0.5rem 0;
    flex-wrap: wrap;
}

.pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--ink-soft);
    background: var(--white);
    border: 1.5px solid var(--edge);
    transition: all 0.2s var(--ease);
}

.pagination .page-link:hover {
    background: var(--brand-sky-light);
    border-color: var(--brand-sky);
    color: var(--brand-ocean);
    transform: translateY(-1px);
}

.pagination .page-link.active {
    background: var(--grad-sky);
    border-color: var(--brand-sky);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(45, 156, 219, 0.3);
}

.pagination .page-link.disabled {
    color: var(--stone);
    background: #f3f8fb;
    border-color: #dfeaf0;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination .page-link.dots {
    border: none;
    background: transparent;
    color: var(--ink-muted);
    min-width: 32px;
    cursor: default;
}

/* ——— Tools Section (Meteo, Farnesina, Links) ——— */
.tools-section {
    margin: 3.5rem 0 1rem;
}

.tools-section-kicker {
    display: inline-block;
    margin-bottom: 0.55rem;
    color: var(--brand-coral);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    font-weight: 800;
}

.tools-section-title {
    font-family: 'Sora', 'Inter', sans-serif;
    color: var(--ink-deep);
    font-size: clamp(1.3rem, 2vw, 1.65rem);
    margin-bottom: 1.4rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.tool-card {
    background: var(--white);
    border: 1px solid var(--edge);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}

.tool-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.tool-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.1rem 1.3rem 0.7rem;
    border-bottom: 1px solid var(--edge);
    flex-wrap: wrap;
}

.tool-card-header h3 {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--ink-deep);
    margin: 0;
}

.tool-card-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.tool-card-body {
    padding: 0.9rem 1.3rem 1.3rem;
    flex: 1;
}

.tool-card-desc {
    font-size: 0.88rem;
    color: var(--ink-soft);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

/* Meteo Card */
.tool-card-weather {
    border-top: 3px solid var(--brand-sky);
}

.weather-location {
    margin-left: auto;
    font-size: 0.76rem;
    color: var(--ink-soft);
    font-weight: 600;
    background: var(--brand-sky-light);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
}

.weather-current-block {
    margin-bottom: 0.85rem;
}

.weather-main {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.6rem;
}

.weather-current-icon { font-size: 2.5rem; line-height: 1; }

.weather-current-data {
    display: flex;
    flex-direction: column;
}

.weather-current-temp {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--ink-deep);
    font-family: 'Sora', 'Inter', sans-serif;
    line-height: 1.1;
}

.weather-current-desc {
    font-size: 0.85rem;
    color: var(--ink-muted);
}

.weather-details {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--ink-soft);
    padding: 0.6rem 0.75rem;
    background: var(--brand-sky-light);
    border-radius: var(--radius-sm);
}

.weather-preview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.weather-preview-day {
    text-align: center;
    padding: 0.45rem 0.2rem;
    border-radius: var(--radius-sm);
    background: var(--brand-sky-light);
    border: 1px solid #d0e5f2;
    transition: background 0.2s var(--ease);
}

.weather-preview-day:hover { background: #dcecf7; }

.wpd-dayname {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 0.15rem;
    letter-spacing: 0.04em;
}

.wpd-icon { display: block; font-size: 1.1rem; margin-bottom: 0.1rem; }

.wpd-temps { font-size: 0.72rem; color: var(--ink-muted); }

.weather-credit {
    display: block;
    font-size: 0.66rem;
    color: var(--ink-muted);
    margin-top: 0.4rem;
}

.weather-unavailable {
    padding: 1rem 0;
    text-align: center;
    color: var(--ink-muted);
    font-style: italic;
}

/* ——— Weather Search Form ——— */
.weather-search {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.weather-search-input {
    flex: 1;
    min-width: 0;
    padding: 0.45rem 0.65rem;
    border: 1.5px solid var(--edge);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-family: inherit;
    color: var(--ink);
    background: var(--white);
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
    outline: none;
}

.weather-search-input:focus {
    border-color: var(--brand-sky);
    box-shadow: 0 0 0 3px rgba(45, 156, 219, 0.12);
}

.weather-search-input::placeholder {
    color: var(--ink-muted);
    font-size: 0.76rem;
}

.weather-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--brand-sky-light);
    color: var(--brand-ocean);
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s var(--ease), transform 0.2s var(--ease);
    flex-shrink: 0;
}

.weather-search-btn:hover {
    background: var(--brand-sky);
    color: var(--white);
    transform: scale(1.05);
}

.weather-geo-status {
    font-size: 0.72rem;
    color: var(--ink-muted);
    text-align: center;
    margin-bottom: 0.4rem;
    min-height: 1.1em;
}

/* Farnesina Card */
.tool-card-farnesina {
    border-top: 3px solid var(--brand-ocean);
}

/* Link Card */
.tool-card-links {
    border-top: 3px solid var(--brand-mint);
}

/* Link list comune */
.tool-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tool-links li { margin-bottom: 0.4rem; }

.tool-links a {
    display: block;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.83rem;
    font-weight: 500;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid #e2edf2;
    transition: all 0.2s var(--ease);
}

.tool-links a:hover {
    background: var(--brand-sky-light);
    border-color: var(--brand-sky);
    color: var(--ink-deep);
    transform: translateX(3px);
}

/* ——— Responsive ——— */
@media (max-width: 1024px) {
    .tools-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
    .tools-grid { grid-template-columns: 1fr; }
    .weather-preview { grid-template-columns: repeat(2, 1fr); }
}

/* ——— Mobile header/navigation (dropdown, no layout shift) ——— */
@media (max-width: 768px) {
    body { padding-top: 0; }
    html { scroll-padding-top: 96px; }

    header {
        position: sticky;
        top: 0;
        z-index: 1100;
    }

    .header-content {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 44px;
        align-items: center;
        gap: 0.15rem 0.75rem;
        min-height: 0;
        padding: 0.45rem 16px 0.5rem;
    }

    .logo a {
        gap: 0.55rem;
        min-width: 0;
    }

    .header-logo {
        height: 40px;
    }

    .brand-title {
        font-size: 1.2rem;
        white-space: nowrap;
    }

    .menu-toggle {
        display: inline-flex;
        grid-column: 2;
        grid-row: 1;
    }

    .contact-info {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
        text-align: left;
        flex-wrap: wrap;
        gap: 0.15rem 0.35rem;
        font-size: 0.7rem;
        line-height: 1.3;
    }

    .contact-info p {
        padding: 0.15rem 0.4rem;
        overflow-wrap: anywhere;
    }

    .main-nav {
        display: none;
    }

    .mobile-menu {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1050;
        max-height: calc(100vh - 120px);
        max-height: calc(100svh - 120px);
        overflow-y: auto;
        padding: 0.35rem 0;
        background: var(--white);
        border-top: 1px solid var(--edge);
        border-bottom: 1px solid var(--edge);
        box-shadow: var(--shadow-lg);
    }

    .mobile-menu[hidden] {
        display: none;
    }

    .mobile-menu ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .mobile-menu a {
        display: flex;
        align-items: center;
        min-height: 48px;
        padding: 0 20px;
        color: var(--ink);
        text-decoration: none;
        font-size: 0.95rem;
        font-weight: 600;
        border-bottom: 1px solid var(--edge);
    }

    .mobile-menu li:last-child a {
        border-bottom: 0;
    }

    .mobile-menu a:focus-visible {
        outline: 3px solid var(--brand-sky);
        outline-offset: -3px;
        background: var(--brand-sky-light);
    }

    main { padding: 0 16px; }
    .footer-content {
        padding: 2rem 16px 1.8rem;
        text-align: center;
    }
    .footer-content p {
        font-size: 0.9rem;
        line-height: 1.7;
        overflow-wrap: anywhere;
    }
    .footer-content a {
        display: inline-block;
        padding: 0.15rem 0;
    }
}

/* ——— Utilities ——— */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ——— Accessibilità: skip link e focus visibile ——— */
.skip-link {
    position: fixed;
    top: -80px;
    left: 16px;
    z-index: 3000;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--ink-deep);
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--shadow-lg);
}

.skip-link:focus-visible {
    top: 16px;
}

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
    outline: 3px solid var(--brand-sky);
    outline-offset: 2px;
}

#main-content:focus {
    outline: none;
}
