/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&display=swap');

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

body {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    line-height: 1.6;
    color: #2c1810;
    background: linear-gradient(135deg, #faf8f3 0%, #f0ead6 50%, #e8dcc0 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header styles */
.page-header {
    position: relative;
    height: 60vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.header-content {
    text-align: center;
    color: white;
    z-index: 3;
    position: relative;
}

.header-content h1 {
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 8px rgba(218, 165, 32, 0.8), 0 0 20px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 215, 0, 0.4);
    letter-spacing: 2px;
}

.header-content p {
    font-size: 1.3rem;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* Navigation */
.main-nav {
    background: linear-gradient(135deg, rgba(44, 24, 16, 0.95) 0%, rgba(101, 67, 33, 0.95) 100%);
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(218, 165, 32, 0.3), 0 2px 10px rgba(0,0,0,0.2);
    border-bottom: 2px solid rgba(218, 165, 32, 0.4);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.main-nav a {
    color: #f5f3e7;
    text-decoration: none;
    font-weight: 500;
    font-family: 'Cinzel', serif;
    padding: 0.8rem 1.5rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    letter-spacing: 0.5px;
}

.main-nav a:hover,
.main-nav a.active {
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.3) 0%, rgba(255, 215, 0, 0.2) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(218, 165, 32, 0.4);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

/* Main content */
.main-content {
    padding: 3rem 0;
}

.intro-section {
    text-align: center;
    margin-bottom: 4rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 248, 243, 0.9) 100%);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(218, 165, 32, 0.15), 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid rgba(218, 165, 32, 0.2);
}

.intro-section h2 {
    font-family: 'Cinzel', serif;
    font-size: 2.8rem;
    font-weight: 600;
    color: #654321;
    margin-bottom: 1.5rem;
    position: relative;
    text-shadow: 2px 2px 4px rgba(218, 165, 32, 0.3), 0 0 15px rgba(255, 215, 0, 0.2);
    letter-spacing: 1px;
}

.intro-section h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #d4af37 0%, #ffd700 50%, #daa520 100%);
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(218, 165, 32, 0.4);
}

.intro-text {
    font-size: 1.2rem;
    color: #555;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Timeline styles */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #DAA520, #8B4513);
    transform: translateX(-50%);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    width: 100%;
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-left: 0;
    margin-right: 55%;
    text-align: right;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: 55%;
    margin-right: 0;
    text-align: left;
}

.timeline-marker {
    position: absolute;
    left: 50%;
    top: 20px;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #d4af37, #ffd700);
    border: 4px solid #f5f3e7;
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 10;
    box-shadow: 0 0 0 4px rgba(218, 165, 32, 0.6), 0 4px 15px rgba(218, 165, 32, 0.3);
}

.timeline-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 248, 243, 0.95) 100%);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(218, 165, 32, 0.1), 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(218, 165, 32, 0.15);
    position: relative;
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 25px;
    width: 0;
    height: 0;
    border: 15px solid transparent;
}

.timeline-item:nth-child(odd) .timeline-content::before {
    right: -30px;
    border-left-color: rgba(255, 255, 255, 0.95);
}

.timeline-item:nth-child(even) .timeline-content::before {
    left: -30px;
    border-right-color: rgba(255, 255, 255, 0.95);
}

.timeline-content h3 {
    font-family: 'Cinzel', serif;
    color: #654321;
    font-size: 1.6rem;
    margin-bottom: 1rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(218, 165, 32, 0.2);
    letter-spacing: 0.5px;
}

.timeline-content p {
    color: #2c1810;
    line-height: 1.7;
    font-size: 1rem;
}

/* Padre Serafino section */
.padre-serafino-section {
    margin-top: 4rem;
    padding: 3rem 0;
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.08) 0%, rgba(255, 215, 0, 0.05) 100%);
    border-radius: 20px;
    border: 1px solid rgba(218, 165, 32, 0.1);
}

.padre-serafino-section h2 {
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: 2.8rem;
    font-weight: 600;
    color: #654321;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(218, 165, 32, 0.3), 0 0 15px rgba(255, 215, 0, 0.2);
    letter-spacing: 1px;
}

.subtitle {
    text-align: center;
    font-style: italic;
    color: #d4af37;
    font-size: 1.3rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(218, 165, 32, 0.3);
}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-top: 2rem;
}

.text-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: #2c1810;
    font-size: 1.1rem;
}

.text-content strong {
    color: #654321;
    font-weight: bold;
}

.image-content {
    text-align: center;
}

.padre-image {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(218, 165, 32, 0.2), 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(218, 165, 32, 0.3);
    transition: all 0.3s ease;
}

.padre-image:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(218, 165, 32, 0.3), 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Gallery Section */
.gallery-section {
    margin: 4rem 0;
    padding: 3rem 0;
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.05) 0%, rgba(255, 215, 0, 0.08) 100%);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(218, 165, 32, 0.1);
}

.gallery-section h2 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    color: #2c1810;
    text-align: center;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 3px rgba(218, 165, 32, 0.3);
}

.gallery-intro {
    text-align: center;
    font-size: 1.2rem;
    color: #654321;
    margin-bottom: 3rem;
    font-style: italic;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 0 1rem;
}

.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: #fff;
    aspect-ratio: 4/3;
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(218, 165, 32, 0.3), 0 5px 15px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* Specific positioning for images with faces/important content at top */
.gallery-item img[alt="Tradizione ortodossa"] {
    object-position: center 70%;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(44, 24, 16, 0.9));
    color: white;
    padding: 2rem 1.5rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-caption {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    display: block;
}

/* Certificate styles */
.certificate-container {
    margin-top: 2rem;
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.08) 0%, rgba(255, 215, 0, 0.12) 100%);
    border-radius: 15px;
    border: 2px solid rgba(218, 165, 32, 0.2);
    box-shadow: 0 8px 25px rgba(218, 165, 32, 0.15);
}

.certificate-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 3px solid rgba(218, 165, 32, 0.3);
    cursor: pointer;
}

.certificate-image:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 30px rgba(218, 165, 32, 0.3);
}

.certificate-caption {
    margin-top: 1rem;
    font-style: italic;
    color: #654321;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Responsive adjustments for gallery */
@media (max-width: 768px) {
    .photo-gallery {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .gallery-section {
        margin: 2rem 0;
        padding: 2rem 0;
    }
    
    .gallery-section h2 {
        font-size: 2rem;
    }
    
    .gallery-intro {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
    
    .certificate-container {
        margin-top: 1.5rem;
        padding: 1rem;
    }
    
    .certificate-caption {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .photo-gallery {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .gallery-item {
        aspect-ratio: 3/2;
    }
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    width: 90vw;
    height: 90vh;
    margin: auto;
    animation: zoomIn 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 2px solid rgba(218, 165, 32, 0.5);
    overflow: auto;
    padding: 20px;
    box-sizing: border-box;
}

.modal-image {
    width: auto;
    height: auto;
    min-width: 100%;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(218, 165, 32, 0.3);
    border: 3px solid rgba(218, 165, 32, 0.5);
    display: block;
    margin: 0 auto;
}

.close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #daa520;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.close:hover {
    color: #fff;
    transform: scale(1.1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95vw;
        height: 85vh;
        padding: 15px;
    }
    
    .close {
        top: -35px;
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98vw;
        height: 90vh;
        padding: 10px;
    }
    
    .close {
        top: -30px;
        font-size: 25px;
    }
}

/* Footer */
.main-footer {
    background: linear-gradient(135deg, #2c1810 0%, #654321 50%, #8b4513 100%);
    color: #f5f3e7;
    text-align: center;
    padding: 2.5rem 0;
    margin-top: 3rem;
    box-shadow: 0 -4px 20px rgba(218, 165, 32, 0.2);
    border-top: 2px solid rgba(218, 165, 32, 0.3);
}

.main-footer h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(218, 165, 32, 0.4), 0 0 10px rgba(255, 215, 0, 0.3);
    letter-spacing: 1px;
}

.main-footer p {
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    font-size: 1.1rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .header-content h1 {
        font-size: 2.5rem;
    }
    
    .header-content p {
        font-size: 1.1rem;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-marker {
        left: 20px;
    }
    
    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        margin-left: 50px;
        margin-right: 0;
        text-align: left;
    }
    
    .timeline-item:nth-child(odd) .timeline-content::before,
    .timeline-item:nth-child(even) .timeline-content::before {
        left: -30px;
        right: auto;
        border-right-color: rgba(255, 255, 255, 0.95);
        border-left-color: transparent;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .intro-section h2 {
        font-size: 2rem;
    }
    
    .intro-text {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }
    
    .timeline-content {
        padding: 1.5rem;
    }
    
    .intro-section {
        padding: 1.5rem;
    }
}