@import url("site-footer-legal.css");

:root {
    --bg-dark: #0a0b10;
    --primary: #00d2ff;
    --primary-glow: rgba(0, 210, 255, 0.6);
    --secondary: #ffd700;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    
    /* NUOVI FONT V3/V9 */
    --font-tech: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

/* ─── Accessibility defaults ────────────────────────────────────────── */
:focus-visible {
    outline: 3px solid rgba(0, 210, 255, 0.95);
    outline-offset: 3px;
}

/* Screen-reader only (for labels/skip link) */
.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;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: 12px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    text-decoration: none;
    transform: translateY(-200%);
    transition: transform 0.2s ease;
    z-index: 9999;
}
.skip-link:focus {
    transform: translateY(0);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    /* IMPOSTAZIONI PER CENTRATURA VERTICALE */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 0 20px 0;
    overflow-x: hidden;
}

.background-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 10% 20%, rgba(0, 210, 255, 0.1) 0%, transparent 20%),
                radial-gradient(circle at 90% 80%, rgba(255, 215, 0, 0.05) 0%, transparent 20%);
    z-index: -1;
}

/* CONTAINER CENTRALE */
.container { 
    width: 95%; 
    max-width: 1400px; 
    flex: 1; /* Prende lo spazio disponibile spingendo il footer in basso */
    padding: 20px; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; 
}

.container.home-container {
    position: relative;
    padding: 20px;
}

/* Barra sotto il logo: lingua + donazioni affiancate, stessa altezza e stile coerente */
.home-top-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 560px;
    margin: 20px auto 4px;
    padding: 0 8px;
    box-sizing: border-box;
}

.home-header .lang-switch {
    position: static;
    flex: 1 1 240px;
    min-width: min(100%, 200px);
    max-width: calc(50% - 6px);
}

.home-top-actions .btn-donate {
    flex: 1 1 240px;
    min-width: min(100%, 200px);
    max-width: calc(50% - 6px);
    box-sizing: border-box;
    margin-top: 0;
    white-space: nowrap;
    border-radius: 12px;
    min-height: 44px;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.home-header .lang-switch .site-lang {
    width: 100%;
}

.home-header .lang-switch .site-lang__trigger {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.lang-switch {
    position: static;
    width: auto;
    min-width: 0;
    max-width: none;
}

.lang-switch .site-lang { width: 100%; }

.lang-select {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
    padding: 6px 10px;
    font-family: var(--font-tech);
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 6px;
    width: 100%;
    outline: none;
    transition: 0.3s;
    cursor: pointer;
}
.lang-select:hover, .lang-select:focus {
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 15px var(--primary-glow);
}
.lang-select option { background-color: #0a0b10; color: white; }

/* HEADER STYLES */
.header-section { text-align: center; margin-bottom: 22px; margin-top: 0; width: 100%; }

.home-brand-heading {
    margin: 8px 0 0;
    line-height: 0;
}

/* Logo orizzontale — dimensioni più leggibili */
.home-logo {
    display: block;
    margin: 0 auto;
    width: auto;
    max-width: min(96vw, 920px);
    height: auto;
    max-height: clamp(56px, 11vw, 96px);
    object-fit: contain;
    object-position: center;
}

.highlight { color: var(--primary); }

/* GRID LAYOUT */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 20px; 
    width: 100%;
    justify-content: center;
}

@media (min-width: 1240px) {
    .tools-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* TOOL CARDS */
.tool-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 25px 20px; 
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    position: relative; overflow: hidden;
    height: 100%;
    min-height: 260px; 
}

.tool-card:hover { transform: translateY(-5px); background: rgba(255, 255, 255, 0.07); }

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    width: 70px; height: 70px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.1); transition: 0.3s;
}

.card-content h2, .card-content h3 { font-family: var(--font-tech); font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; text-transform: uppercase; }
.card-content p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 15px; line-height: 1.4; font-family: var(--font-body); }

.btn-action {
    margin-top: auto; display: inline-block; padding: 10px 25px;
    border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 6px;
    font-size: 0.85rem; font-weight: 700; font-family: var(--font-tech);
    transition: 0.3s; text-transform: uppercase; letter-spacing: 1px;
}

/* COLORS */
/* SPLIT - YELLOW */
.card-split:hover { border-color: var(--secondary); box-shadow: 0 0 25px rgba(255, 215, 0, 0.15); }
.card-split .card-icon { color: var(--secondary); }
.card-split:hover .card-icon { background: rgba(255, 215, 0, 0.1); border-color: var(--secondary); box-shadow: 0 0 20px rgba(255, 215, 0, 0.4); }
.card-split:hover .btn-action { background: var(--secondary); color: #000; border-color: var(--secondary); }

/* FLIGHT - BLUE */
.card-flight:hover { border-color: var(--primary); box-shadow: 0 0 25px rgba(0, 210, 255, 0.15); }
.card-flight .card-icon { color: var(--primary); }
.card-flight:hover .card-icon { background: rgba(0, 210, 255, 0.1); border-color: var(--primary); box-shadow: 0 0 20px rgba(0, 210, 255, 0.4); }
.card-flight:hover .btn-action { background: var(--primary); color: #000; border-color: var(--primary); }

/* EXPEDITION - PURPLE */
.card-expedition:hover { border-color: #d8b4fe; box-shadow: 0 0 25px rgba(216, 180, 254, 0.15); }
.card-expedition .card-icon { color: #d8b4fe; }
.card-expedition:hover .card-icon { background: rgba(216, 180, 254, 0.1); border-color: #d8b4fe; box-shadow: 0 0 20px rgba(216, 180, 254, 0.4); }
.card-expedition:hover .btn-action { background: #d8b4fe; border-color: #d8b4fe; color: #000; }

/* MINES - GREEN */
.card-mines:hover { border-color: #4ade80; box-shadow: 0 0 25px rgba(74, 222, 128, 0.15); }
.card-mines .card-icon { color: #4ade80; }
.card-mines:hover .card-icon { background: rgba(74, 222, 128, 0.1); border-color: #4ade80; box-shadow: 0 0 20px rgba(74, 222, 128, 0.4); }
.card-mines:hover .btn-action { background: #4ade80; border-color: #4ade80; color: #000; }

/* TRADE - ORANGE */
.card-trade:hover { border-color: #ff9f43; box-shadow: 0 0 25px rgba(255, 159, 67, 0.15); }
.card-trade .card-icon { color: #ff9f43; }
.card-trade:hover .card-icon { background: rgba(255, 159, 67, 0.1); border-color: #ff9f43; box-shadow: 0 0 20px rgba(255, 159, 67, 0.4); }
.card-trade:hover .btn-action { background: #ff9f43; border-color: #ff9f43; color: #000; }

/* MOON - RED */
.card-moon:hover { border-color: #ff4757; box-shadow: 0 0 25px rgba(255, 71, 87, 0.15); }
.card-moon .card-icon { color: #ff4757; }
.card-moon:hover .card-icon { background: rgba(255, 71, 87, 0.1); border-color: #ff4757; box-shadow: 0 0 20px rgba(255, 71, 87, 0.4); }
.card-moon:hover .btn-action { background: #ff4757; border-color: #ff4757; color: #000; }

/* LIFEFORMS - CYAN/TEAL */
.card-lifeforms:hover { border-color: #22d3ee; box-shadow: 0 0 25px rgba(34, 211, 238, 0.15); }
.card-lifeforms .card-icon { color: #22d3ee; }
.card-lifeforms:hover .card-icon { background: rgba(34, 211, 238, 0.1); border-color: #22d3ee; box-shadow: 0 0 20px rgba(34, 211, 238, 0.4); }
.card-lifeforms:hover .btn-action { background: #22d3ee; border-color: #22d3ee; color: #000; }

/* OSTATS - LIGHT BLUE / CYAN GLOW */
.card-ostats:hover { border-color: #00d2ff; box-shadow: 0 0 25px rgba(0, 210, 255, 0.15); }
.card-ostats .card-icon { border-color: rgba(0, 210, 255, 0.2); }
.card-ostats:hover .card-icon { background: rgba(0, 210, 255, 0.1); border-color: #00d2ff; box-shadow: 0 0 20px rgba(0, 210, 255, 0.4); }
.card-ostats:hover .btn-action { background: #00d2ff; border-color: #00d2ff; color: #000; }

.logo-ostats { padding: 5px; overflow: hidden; }
.logo-ostats img { width: 100%; height: 100%; object-fit: contain; }

/* OVALUE - GOLD/YELLOW */
.card-ovalue:hover { border-color: #ffd700; box-shadow: 0 0 25px rgba(255, 215, 0, 0.15); }
.card-ovalue .card-icon { border-color: rgba(255, 215, 0, 0.2); padding: 5px; overflow: hidden; }
.card-ovalue .card-icon img { width: 100%; height: 100%; object-fit: contain; }
.card-ovalue:hover .card-icon { background: rgba(255, 215, 0, 0.1); border-color: #ffd700; box-shadow: 0 0 20px rgba(255, 215, 0, 0.4); }
.card-ovalue:hover .btn-action { background: #ffd700; border-color: #ffd700; color: #000; }

.footer-info { display: none; } 

/* DONATION BUTTON */
.btn-donate {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 0; padding: 8px 16px;
    min-height: 40px;
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid #ffd700; color: #ffd700; 
    border-radius: 50px; text-decoration: none;
    font-family: var(--font-tech); font-weight: 700; font-size: 0.8rem;
    letter-spacing: 1px; transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
}
.btn-donate:hover {
    background: #ffd700; color: #000;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
    transform: translateY(-2px);
}
.btn-donate i { font-size: 1.05rem; }


@media (max-width: 768px) {
    /* Su mobile riabilitiamo lo scroll */
    body { height: auto; display: block; overflow-y: auto; padding-top: 40px; }
    .container { height: auto; display: block; max-height: none; }
    .home-logo { max-height: clamp(48px, 14vw, 80px); }
    .home-top-actions {
        max-width: none;
        margin-top: 16px;
        margin-bottom: 8px;
        padding: 0 4px;
    }
    .home-header .lang-switch,
    .home-top-actions .btn-donate {
        max-width: calc(50% - 6px);
    }
    .tools-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .home-top-actions {
        flex-direction: column;
        align-items: stretch;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
    .home-header .lang-switch,
    .home-top-actions .btn-donate {
        flex: none;
        max-width: 100%;
        width: 100%;
        min-width: 0;
    }
}

/* --- Home: blocco SEO (discreto, indicizzabile) --- */
.seo-blurb {
    width: 100%;
    max-width: 42rem;
    margin: 1.25rem auto 0;
    padding: 0.75rem 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
    box-sizing: border-box;
}

.seo-blurb__text {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.22);
    font-weight: 400;
    letter-spacing: 0.01em;
}

.seo-blurb__text strong {
    color: rgba(255, 255, 255, 0.34);
    font-weight: 600;
}

@media (max-width: 768px) {
    .seo-blurb {
        margin-top: 1rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .seo-blurb__text {
        font-size: 0.68rem;
    }
}

/* ── 360–480px tweaks (home) ─────────────────────────────── */
@media (max-width: 480px) {
    body { padding-top: 20px; }

    .container {
        width: 100%;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .home-logo {
        max-height: clamp(44px, 16vw, 72px);
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .tool-card {
        min-height: auto;
        padding: 18px 14px;
    }

    .card-icon {
        width: 54px;
        height: 54px;
        font-size: 2rem;
    }

    .footer-links {
        gap: 8px;
    }
}