/* Cathedral-themed Custom Styles */

/* Gothic patterns and backgrounds */
.cathedral-pattern {
    background-image: 
        repeating-linear-gradient(0deg, 
            transparent, 
            transparent 40px, 
            rgba(255, 215, 0, 0.03) 40px, 
            rgba(255, 215, 0, 0.03) 80px),
        repeating-linear-gradient(90deg, 
            transparent, 
            transparent 40px, 
            rgba(255, 215, 0, 0.03) 40px, 
            rgba(255, 215, 0, 0.03) 80px);
}

/* Stained glass effect */
.stained-glass {
    background: 
        linear-gradient(45deg, 
            rgba(128, 0, 32, 0.3) 0%, 
            rgba(102, 51, 153, 0.3) 25%, 
            rgba(255, 215, 0, 0.3) 50%, 
            rgba(102, 51, 153, 0.3) 75%, 
            rgba(128, 0, 32, 0.3) 100%);
    backdrop-filter: blur(10px);
}

/* Illuminated manuscript effect for first letters */
.illuminated::first-letter {
    float: left;
    font-family: 'Cinzel', serif;
    font-size: 4rem;
    line-height: 3rem;
    padding-right: 0.25rem;
    margin-top: -0.5rem;
    color: #FFD700;
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.5),
        0 0 20px rgba(255, 215, 0, 0.3);
}

/* Gothic arch frames */
.gothic-arch {
    position: relative;
    padding: 2rem;
    background: rgba(128, 0, 32, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

/* Gold leaf texture effect */
.gold-leaf {
    background: linear-gradient(
        45deg,
        #FFD700 0%,
        #FFA500 25%,
        #FFD700 50%,
        #FFA500 75%,
        #FFD700 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

/* Ornate borders */
.ornate-border {
    position: relative;
    border: 2px solid #FFD700;
    padding: 2rem;
}

.ornate-border::before,
.ornate-border::after {
    content: "✠";
    position: absolute;
    color: #FFD700;
    font-size: 1.5rem;
}

.ornate-border::before {
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    background: #191970;
    padding: 0 0.5rem;
}

.ornate-border::after {
    bottom: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    background: #191970;
    padding: 0 0.5rem;
}

/* Scroll animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Hover effects for cards */
.typology-card {
    transition: all 0.3s ease;
}

.typology-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 10px 40px rgba(255, 215, 0, 0.2),
        0 0 60px rgba(255, 215, 0, 0.1);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #191970;
    border: 1px solid rgba(255, 215, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #FFD700, #B8860B);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #FFA500, #FFD700);
}

/* Loading animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 215, 0, 0.3) 50%,
        transparent 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Navigation styles */
#main-nav {
    transition: all 0.3s ease;
}

#main-nav.shadow-lg {
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(255, 215, 0, 0.1);
}

/* Modal styles */
#typology-modal {
    animation: fadeIn 0.3s ease-out;
}

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

#modal-content {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Line clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Cathedral window effect */
.cathedral-window {
    position: relative;
    overflow: hidden;
}

.cathedral-window::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-conic-gradient(
        from 0deg at 50% 50%,
        transparent 0deg,
        rgba(255, 215, 0, 0.1) 10deg,
        transparent 20deg
    );
    animation: rotate 60s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Text shadows for depth */
.text-shadow-gold {
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(255, 215, 0, 0.4),
        0 0 40px rgba(255, 215, 0, 0.2);
}

/* Hero image frame effect */
.hero-image-frame {
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 120px rgba(255, 215, 0, 0.2),
        inset 0 0 60px rgba(255, 215, 0, 0.1);
}

/* Hero text overlay styles */
.hero-text-overlay {
    text-shadow: 
        3px 3px 6px rgba(0, 0, 0, 0.95),
        0 0 30px rgba(0, 0, 0, 0.9),
        0 0 60px rgba(0, 0, 0, 0.8);
}

.hero-title-gold {
    color: #FFD700;
    text-shadow: 
        3px 3px 6px rgba(0, 0, 0, 1),
        0 0 40px rgba(0, 0, 0, 0.9),
        0 0 80px rgba(255, 215, 0, 0.4),
        0 0 120px rgba(255, 215, 0, 0.2);
}

/* Responsive image containers */
.image-container {
    position: relative;
    padding-bottom: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
}

.image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Timeline connector */
.timeline-connector {
    position: relative;
}

.timeline-connector::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    width: 50px;
    height: 2px;
    background: linear-gradient(to right, #FFD700, transparent);
}

/* Gothic text decoration */
.gothic-underline {
    position: relative;
    display: inline-block;
}

.gothic-underline::after {
    content: "❦";
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: #FFD700;
    font-size: 1.5rem;
}

/* Parallax effect helper */
.parallax {
    position: relative;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .no-print {
        display: none;
    }
    
    .typology-card {
        page-break-inside: avoid;
    }
}

/* Performance optimizations */
.typology-card {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.typology-card img {
  will-change: auto;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Reduce animation complexity for better performance */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Optimize font loading */
.font-cinzel, .font-crimson {
  font-display: swap;
}

/* Mobile optimization */
@media (max-width: 768px) {
    .illuminated::first-letter {
        font-size: 3rem;
        line-height: 2.5rem;
    }
    
    .gothic-arch {
        border-radius: 20px;
    }
    
    .ornate-border {
        padding: 1rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .typology-card {
        border-width: 3px;
    }
    
    .text-ivory {
        color: white;
    }
    
    .bg-burgundy\/20 {
        background: rgba(128, 0, 32, 0.4);
    }
}

/* Focus styles for accessibility */
button:focus,
a:focus {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

/* Custom tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(25, 25, 112, 0.95);
    color: #FFD700;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.tooltip:hover::after {
    opacity: 1;
}