/* Reset e base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Fonts */
@font-face {
    font-display: swap;
    font-family: "Nunito";
    src: url('Nunito-Regular.woff2') format('woff2'),
         url('Nunito-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-display: swap;
    font-family: "Lato";
    src: url('Lato-Bold.woff2') format('woff2'),
         url('Lato-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-display: swap;
    font-family: "Hanken Grotesk";
    src: url('HankenGrotesk_wght_.woff2') format('woff2'),
         url('HankenGrotesk_wght_.woff') format('woff');
    font-weight: 400;
    font-style: normal;
}

/* Variabili CSS */
:root {
    --navbar-bg: rgba(24, 39, 43, 0.95);
    --navbar-solid: #18272b;
    --button-bg: #193d4a;
    --button-hover: rgba(255, 255, 255, 0.1);
    --text-light: #e6e4e4;
    --text-dark: #0e0000;
    --accent-orange: rgba(222, 116, 28, 0.62);
    --backdrop-blur: blur(10px);

    --font-nunito: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-lato: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-hanken: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Immagini */
    --hero-bg-image: url('../images/background chiesa.png');
}

body {
    font-family: var(--font-hanken);
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* Navbar moderna */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--navbar-bg);
    backdrop-filter: var(--backdrop-blur);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    min-height: 80px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-light);
}

.navbar-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.navbar-logo:hover {
    transform: scale(1.05);
}

.navbar-title {
    font-family: var(--font-nunito);
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0;
    white-space: nowrap;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-item {
    padding: 0.75rem 1rem;
    background: var(--button-bg);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 6px;
    font-family: var(--font-lato);
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.2;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.navbar-item:hover {
    background: var(--button-hover);
    transform: translateY(-2px);
}

.navbar-item.active {
    background: var(--button-hover);
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--button-bg);
    border-radius: 6px;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1001;
    margin-top: 0.5rem;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-light);
    text-decoration: none;
    font-family: var(--font-lato);
    font-size: 0.85rem;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--button-hover);
}

/* Mobile menu */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background: var(--navbar-bg);
    backdrop-filter: var(--backdrop-blur);
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 999;
}

.mobile-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-menu a {
    display: block;
    padding: 1rem 0;
    color: var(--text-light);
    text-decoration: none;
    font-family: var(--font-lato);
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: color 0.3s ease;
}

.mobile-menu a:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Main content */
main {
    margin-top: 80px;
}

/* Hero section con foto chiesa */
.hero {
    min-height: 70vh;
    background: linear-gradient(
        rgba(24, 39, 43, 0.3),
        rgba(24, 39, 43, 0.3)
    ),
    var(--hero-bg-image);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-light);
    position: relative;
}

.hero-content {
    max-width: 800px;
    padding: 2rem;
    backdrop-filter: var(--backdrop-blur);
    background: rgba(24, 39, 43, 0.4);
    border-radius: 12px;
    animation: fadeIn 1s ease-out;
}

.hero h1 {
    font-family: var(--font-nunito);
    font-size: 3rem;
    font-weight: 400;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.passa-parola-btn {
    padding: 0.8rem 2rem;
    background: var(--button-bg);
    color: var(--text-light);
    border: none;
    border-radius: 6px;
    font-family: var(--font-lato);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.passa-parola-btn:hover {
    background: var(--navbar-solid);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.oratorio-ghost-btn {
    display: inline-block;
    margin-top: 0.75rem;
    margin-left: 0.75rem;
    padding: 0.8rem 2rem;
    background: transparent;
    color: var(--text-light);
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    font-family: var(--font-lato);
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.oratorio-ghost-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--text-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.oratorio-estivo-hero-btn {
    display: block;
    margin-top: 1.5rem;
    margin-bottom: 1.25rem;
    padding: 1.1rem 2.5rem;
    background: #de741c;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: var(--font-lato);
    font-weight: 700;
    font-size: 1.15rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(222, 116, 28, 0.4);
}

.oratorio-estivo-hero-btn:hover {
    background: #c4651a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(222, 116, 28, 0.5);
}

/* Sezione orari */
.schedule-section {
    padding: 4rem 2rem;
    background: var(--navbar-solid);
    color: var(--text-light);
    text-align: center;
}

.schedule-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    align-items: center;
}

.schedule-info h2 {
    font-family: var(--font-nunito);
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-light);
}

.schedule-times {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: var(--backdrop-blur);
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid var(--button-bg);
}

.schedule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin: 0.5rem 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.schedule-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(10px);
}

.schedule-item strong {
    font-family: var(--font-lato);
    font-weight: 700;
}

.schedule-item span {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Sezione avvisi homepage */
.home-notices-section {
    padding: 3rem 2rem;
    background: #f8f9fa;
}

.home-notices-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.home-notices-title {
    font-family: var(--font-nunito);
    font-size: 2.2rem;
    color: var(--navbar-solid);
    margin-bottom: 1rem;
}

.home-notices-subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
}

.home-notices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.home-notice-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: left;
    transition: all 0.3s ease;
}

.home-notice-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.home-notice-card.clickable {
    cursor: pointer;
}

.home-notice-card.clickable:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.home-notice-card.important {
    border-left: 4px solid #3498db;
}

.home-notice-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.home-notice-title {
    font-family: var(--font-lato);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--navbar-solid);
}

.home-notice-badge {
    background: #3498db;
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.home-poster-icon {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.2rem;
    background: rgba(25, 61, 74, 0.1);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    color: #193d4a;
}

.home-poster-icon:hover {
    background: rgba(25, 61, 74, 0.2);
    transform: scale(1.05);
}

.home-notice-content {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
}

.home-notices-link {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: var(--button-bg);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 6px;
    font-family: var(--font-lato);
    font-weight: 700;
    transition: all 0.3s ease;
}

.home-notices-link:hover {
    background: var(--navbar-solid);
    transform: translateY(-2px);
}

.home-notices-hidden {
    display: none;
}

/* Footer */
footer {
    background: var(--navbar-solid);
    color: var(--text-light);
    padding: 3rem 2rem 2rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    align-items: start;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.footer-logo img {
    width: 80px;
    height: 80px;
}

.footer-section h3 {
    font-family: var(--font-lato);
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-section p {
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.footer-section a {
    color: var(--text-light);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.footer-section a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Animazioni */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
        min-height: 70px;
    }

    .navbar-title {
        font-size: 1.2rem;
    }

    .navbar-logo {
        width: 40px;
        height: 40px;
    }

    .navbar-menu {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

    main {
        margin-top: 70px;
    }

    .mobile-menu {
        top: 70px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-content {
        margin: 1rem;
        padding: 1.5rem;
    }

    .oratorio-ghost-btn {
        display: block;
        margin-left: 0;
        margin-top: 0.75rem;
    }

    .schedule-section {
        padding: 3rem 1rem;
    }

    .schedule-info h2 {
        font-size: 2rem;
    }


    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .home-notices-section {
        padding: 2rem 1rem;
    }

    .home-notices-title {
        font-size: 1.8rem;
    }

    .home-notices-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Le media queries per l'immagine hero sono state rimosse perché ridondanti - l'immagine è già definita nella classe .hero principale usando la variabile --hero-bg-image */

/* Responsive per schermi molto stretti */
@media (max-width: 480px) {
    .hero {
        background-size: auto 100%;
        min-height: 50vh;
    }
}

@media (max-width: 320px) {
    .hero {
        background-size: auto 120%;
        background-position: center top;
    }
}

/* Popup per locandine */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.popup-overlay.active {
    display: flex;
}

.popup-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    background: white;
    border-radius: 8px;
    overflow: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.popup-content.pdf-mode {
    width: 95vw;
    max-width: 95vw;
    max-height: 95vh;
}

.popup-image {
    width: 100%;
    height: auto;
    display: block;
    min-height: auto;
}

.popup-pdf {
    width: 100%;
    height: 90vh;
    border: none;
}

.pdf-viewer-container {
    width: 100%;
    height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: #525252;
    display: none;
    padding: 1rem;
}

.pdf-page-canvas {
    display: block;
    margin: 0 auto 1rem auto;
    max-width: 100%;
    height: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pdf-controls {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    z-index: 11;
}

.pdf-controls button {
    background: var(--button-bg);
    color: var(--text-light);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-lato);
    font-weight: 700;
    transition: all 0.2s ease;
}

.pdf-controls button:hover:not(:disabled) {
    background: var(--navbar-solid);
}

.pdf-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pdf-page-info {
    color: white;
    font-family: var(--font-hanken);
}

.pdf-loading {
    text-align: center;
    padding: 2rem;
    color: white;
    font-family: var(--font-hanken);
}

.popup-close {
    position: sticky;
    top: 10px;
    left: calc(100% - 45px);
    margin-bottom: -35px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.popup-close:hover {
    background: rgba(0, 0, 0, 0.95);
}

@media (max-width: 768px) {
    .popup-content {
        max-width: 98vw;
        max-height: 90vh;
        margin: 1rem;
    }

    .popup-close {
        width: 40px;
        height: 40px;
        top: 5px;
        left: calc(100% - 50px);
        margin-bottom: -40px;
    }
}

/* =============================================
   Animazione hero → navbar "Passa Parola"
   ============================================= */

/* Bottone mobile nel menu */
.navbar-passa-parola-mobile {
    display: block;
    width: 100%;
    padding: 1rem 0;
    color: var(--text-light);
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-family: var(--font-lato);
    font-weight: 700;
    font-size: inherit;
    text-align: left;
    cursor: pointer;
    transition: color 0.3s ease;
}
.navbar-passa-parola-mobile:hover { color: rgba(255, 255, 255, 0.8); }

/* Clone volante */
.passa-parola-flying-clone {
    position: fixed;
    z-index: 1500;
    pointer-events: none;
    background: var(--button-bg);
    color: var(--text-light);
    border: none;
    border-radius: 6px;
    font-family: var(--font-lato);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    cursor: default;
}

/* Hero collapse */
.hero-collapsing {
    overflow: hidden;
    transition: height 0.6s ease-in, opacity 0.6s ease-in, padding 0.6s ease-in;
}

/* Fade-out animazioni */
@keyframes fadeOutUp {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-24px); }
}
.hero-text-fadeout { animation: fadeOutUp 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

@keyframes fadeOutShrink {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.75); }
}
.hero-btn-fadeout { animation: fadeOutShrink 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .hero-text-fadeout,
    .hero-btn-fadeout,
    .passa-parola-flying-clone,
    .hero-collapsing {
        transition: none !important;
        animation: none !important;
    }
}
