/*
Theme Name: Stella Maris Premium
Theme URI: https://diocesisstellamaris.com
Author: Antigravity AI
Description: Tema premium minimalista y elegante para la Diócesis Stella Maris. Diseñado para alto rendimiento y legibilidad.
Version: 4.0.0
Text Domain: stellamaris
*/

/* ==========================================
   VARIABLES & DESIGN SYSTEM
   ========================================== */
:root {
    --navy-dark: #0A1325;
    --navy-deep: #050B14;
    --navy-light: #16223F;
    --gold: #C5A059;
    --gold-light: #E8D5A3;
    --gold-dark: #8E7544;
    --white: #FFFFFF;
    --light-bg: #F7F8FA;
    --text-dark: #1D1D1F;
    --text-muted: #6E6E73;
    
    --font-serif: "Georgia", "Didot", "Playfair Display", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    
    --transition: all 0.3s ease;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* ==========================================
   RESET & BASE STYLES
   ========================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    color: var(--gold-dark);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--gold);
}

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: normal;
    color: var(--navy-dark);
    margin-bottom: 20px;
}

/* ==========================================
   PRELOADER
   ========================================== */
#sm-epic-preloader {
    position: fixed;
    inset: 0;
    background: var(--navy-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.sm-preloader-text {
    font-family: var(--font-serif);
    color: var(--white);
    font-size: 2rem;
    letter-spacing: 2px;
}
.preloader-finish {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ==========================================
   HEADER / MENU (Classic Elegant Bar)
   ========================================== */
.sm-dock-wrapper {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 1350px; /* Increased from 1100px to give links more horizontal room */
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    z-index: 9999;
    padding: 8px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    transition: var(--transition);
}

.sm-dock {
    max-width: 1350px; /* Increased from 1100px to match wrapper */
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.sm-nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 20px; /* Increased gap to 20px for breathing room */
}

.sm-nav-list a {
    color: var(--text-dark);
    font-size: 0.8rem; /* Sized to fit comfortably in 1350px width */
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 500;
    white-space: nowrap; /* Prevent link labels from wrapping to two lines */
}

.sm-nav-list a:hover, .sm-nav-list a.active {
    color: var(--gold);
}

/* Intermediate screens fit to prevent wrapping under 1200px */
@media (max-width: 1200px) and (min-width: 769px) {
    .sm-nav-list {
        gap: 10px;
    }
    .sm-nav-list a {
        font-size: 0.72rem;
        letter-spacing: 0.5px;
    }
}

/* Desktop Dropdown Submenu Styles */
.sm-nav-list li {
    position: relative;
}

.sm-nav-list .sub-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    list-style: none;
    padding: 8px 0;
    min-width: 230px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    z-index: 10000;
    margin-top: 15px;
}

/* Arrow indicator on desktop submenu */
.sm-nav-list .sub-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: #fff;
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.sm-nav-list li:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.sm-nav-list .sub-menu li {
    width: 100%;
    margin: 0;
}

.sm-nav-list .sub-menu a {
    display: block;
    padding: 10px 20px;
    font-size: 0.78rem;
    text-transform: none;
    letter-spacing: 0.5px;
    color: var(--text-dark);
    font-weight: 500;
    white-space: nowrap;
    text-align: left;
    transition: var(--transition);
}

.sm-nav-list .sub-menu a:hover {
    background: rgba(197, 160, 89, 0.08);
    color: var(--gold-dark);
}

/* Down arrow icon styling */
.sm-nav-list .chevron-down {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 4px;
    vertical-align: middle;
    border-top: 4px solid var(--text-dark);
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    transition: transform 0.2s ease;
}

.sm-nav-list li:hover .chevron-down {
    transform: rotate(180deg);
    border-top-color: var(--gold);
}

.sm-dock-logo img {
    height: 48px;
    width: auto;
    border-radius: 50%;
}

/* Mobile Toggle */
.sm-mobile-only {
    display: none !important; /* Forces toggle hidden on desktop to override specificity rules */
}

.sm-mobile-toggle {
    cursor: pointer;
    width: 24px;
    height: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.sm-mobile-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-dark);
    transition: var(--transition);
}

/* Drawer Mobile Menu */
.sm-mobile-drawer {
    position: fixed;
    inset: 0;
    background: var(--navy-deep);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.mobile-menu-active .sm-mobile-drawer {
    opacity: 1;
    visibility: visible;
}

.sm-mobile-links {
    list-style: none;
    text-align: left;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 0 10px;
}
.sm-mobile-links li {
    margin: 15px 0;
}
.sm-mobile-links a {
    display: block;
    color: var(--white);
    font-size: 1.35rem;
    font-family: var(--font-serif);
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
    transition: var(--transition);
}
.sm-mobile-links a.active {
    color: var(--gold);
}

/* Mobile Accordion Dropdowns */
.sm-mobile-links .menu-item-has-children-mobile > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sm-mobile-links .arrow {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid rgba(255, 255, 255, 0.6);
    border-bottom: 2px solid rgba(255, 255, 255, 0.6);
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    margin-right: 8px;
}

.sm-mobile-links .menu-item-has-children-mobile.active > a .arrow {
    transform: rotate(-135deg);
    border-color: var(--gold);
}

.sm-mobile-links .sub-menu-mobile {
    list-style: none;
    padding-left: 15px;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-out;
}

.sm-mobile-links .menu-item-has-children-mobile.active .sub-menu-mobile {
    max-height: 400px;
}

.sm-mobile-links .sub-menu-mobile li {
    margin: 10px 0;
}

.sm-mobile-links .sub-menu-mobile a {
    font-size: 1.05rem;
    font-family: var(--font-sans);
    color: rgba(255, 255, 255, 0.65);
    border-bottom: none;
    padding-bottom: 0;
    text-transform: none;
}

.sm-mobile-links .sub-menu-mobile a:hover {
    color: var(--gold);
}

/* ==========================================
   HERO STYLE
   ========================================== */
.sm-hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 20px 100px;
    color: var(--white);
    text-align: center;
    overflow: hidden;
    background: radial-gradient(circle at 50% 30%, var(--navy-light) 0%, var(--navy-dark) 70%, var(--navy-deep) 100%);
}

.sm-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.sm-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sm-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(to bottom, rgba(5, 11, 20, 0.8) 0%, rgba(5, 11, 20, 0.6) 60%, rgba(5, 11, 20, 0.9) 100%);
}

.sm-hero-content {
    position: relative;
    max-width: 800px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sm-hero-subtitle {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--gold-light);
    margin-bottom: 15px;
}

.sm-hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    line-height: 1.15;
    color: var(--white);
    margin-bottom: 20px;
}

.gold-shimmer {
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

.sm-hero-motto {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 40px;
}

.btn-welcome {
    display: inline-block;
    padding: 14px 32px;
    background: var(--gold);
    color: var(--navy-deep);
    font-weight: 600;
    border-radius: 30px;
    font-size: 0.95rem;
    transition: var(--transition);
    border: 1px solid var(--gold);
}
.btn-welcome:hover {
    background: transparent;
    color: var(--gold);
}

/* ==========================================
   ANIMATED WAVES (Stella Maris Sea Motif)
   ========================================== */
.hero-waves-container {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 10;
    overflow: hidden;
    pointer-events: none;
}
.hero-waves {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
}
.wave-parallax > use {
    animation: move-wave 20s cubic-bezier(.55,.5,.45,.5) infinite;
}
.wave-parallax > use:nth-child(1) { animation-delay: -2s; animation-duration: 7s; }
.wave-parallax > use:nth-child(2) { animation-delay: -3s; animation-duration: 10s; }
.wave-parallax > use:nth-child(3) { animation-delay: -4s; animation-duration: 13s; }
.wave-parallax > use:nth-child(4) { animation-delay: -5s; animation-duration: 18s; }

@keyframes move-wave {
    0% { transform: translate3d(-90px,0,0); }
    100% { transform: translate3d(85px,0,0); }
}

/* ==========================================
   CAROUSEL
   ========================================== */
.sm-carousel {
    position: relative;
    box-shadow: var(--shadow);
    border-radius: 16px;
    overflow: hidden;
}

/* ==========================================
   GRID & CARDS
   ========================================== */
.sm-section {
    padding: 80px 0;
}
.sm-section-title {
    text-align: center;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    margin-bottom: 40px;
    position: relative;
}
.sm-section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 2px;
    background: var(--gold);
    margin: 12px auto 0;
}

.sm-grid {
    max-width: 1100px;
    margin: 0 auto;
}

.sm-card {
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.05);
}
.sm-card img {
    transition: var(--transition);
}
.sm-card:hover img {
    transform: scale(1.05);
}

/* ==========================================
   DIRECTORY
   ========================================== */
.sm-directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    max-width: 1100px;
    margin: 0 auto;
}
.btn-directory {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}
.btn-directory:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
}
.btn-directory-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.btn-directory-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.btn-directory-symbol {
    color: var(--gold);
    font-size: 1.2rem;
}

/* ==========================================
   SUBPAGES (Obispo, Diócesis, Lema y Escudo)
   ========================================== */
.sm-page-header {
    background: radial-gradient(circle at 50% 30%, var(--navy-light) 0%, var(--navy-dark) 70%, var(--navy-deep) 100%);
    padding: 160px 20px 60px;
    text-align: center;
    color: var(--white);
    position: relative;
}
.sm-page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(to top, var(--light-bg) 0%, transparent 100%);
}
.sm-page-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    color: var(--white);
}

.sm-page-content {
    max-width: 800px;
    margin: 50px auto 80px;
    padding: 0 20px;
    font-size: 1.08rem;
    color: var(--text-dark);
}
.sm-page-content p {
    margin-bottom: 20px;
}
.sm-page-content h2 {
    font-size: 1.6rem;
    margin: 35px 0 15px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    padding-bottom: 8px;
}

/* Nuestra Diócesis Specific */
.diocesis-hero {
    text-align: center;
    padding: 130px 20px 40px;
}
.epic-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
}
.diocesis-description {
    max-width: 800px;
    margin: 0 auto 50px;
    background: var(--white);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid rgba(0,0,0,0.04);
}

/* Triptych Section */
.triptych {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto 80px;
    padding: 0 20px;
}
.triptych-side {
    flex: 1;
    max-width: 320px;
}
.triptych-center {
    flex: 1.5;
}
.priest-card {
    background: var(--white);
    border-radius: 16px;
    padding: 15px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.04);
    height: 100%;
}
.priest-card img, .map-container img {
    width: 100%;
    height: 380px;
    object-fit: cover;
    border-radius: 12px;
}
.map-container {
    background: var(--white);
    border-radius: 16px;
    padding: 15px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.04);
    height: 100%;
}

/* ==========================================
   CONTACTOS PAGE STYLES
   ========================================== */
.sm-contact-card {
    background: var(--white);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.04);
    margin-top: 30px;
}
.sm-map-container {
    margin-top: 40px;
    border-radius: 16px;
    overflow: hidden;
    height: 350px;
    box-shadow: var(--shadow);
}
.cross-divider {
    text-align: center;
    margin: 50px 0;
}
.cross-divider svg {
    color: var(--gold);
}
.sm-faq-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}
.sm-faq-item {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.04);
}
.sm-faq-item h4 {
    margin-bottom: 8px;
    color: var(--navy-dark);
}

/* ==========================================
   MISSION
   ========================================== */
.sm-mission {
    border-radius: 20px;
    overflow: hidden;
}

/* ==========================================
   FOOTER
   ========================================== */
.sm-footer {
    background: var(--navy-deep);
    color: rgba(255, 255, 255, 0.7);
    padding: 60px 20px;
    text-align: center;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.sm-footer-logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--white);
    margin-bottom: 10px;
}
.sm-footer-logo span {
    color: var(--gold);
}

/* ==========================================
   RESPONSIVENESS (Media Queries)
   ========================================== */
@media (max-width: 1024px) {
    .triptych {
        flex-direction: column;
        align-items: center;
    }
    .triptych-side {
        max-width: 100%;
        width: 100%;
    }
    .priest-card img, .map-container img {
        height: 300px;
    }
}

@media (max-width: 1150px) {
    .sm-desktop-only {
        display: none !important;
    }
    .sm-mobile-only {
        display: flex !important;
    }
}

@media (max-width: 768px) {
    .sm-dock-wrapper {
        padding: 15px 0;
    }
    .sm-dock {
        position: relative;
    }
    .sm-hero {
        padding-top: 100px;
        min-height: 70vh;
    }
    .sm-hero-title {
        font-size: 2.2rem;
    }
    .sm-page-header {
        padding-top: 120px;
    }
    .sm-contact-card {
        padding: 30px 20px;
    }
}
/* =========================================
   LEMA Y ESCUDO PREMIUM SYMMETRICAL DESIGN
   ========================================= */
.premium-gold-text {
    background: linear-gradient(135deg, #F3E2B3 0%, #D4AF37 50%, #AA7B18 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0px 5px 15px rgba(212, 175, 55, 0.2);
}
.lema-shield-glow {
    box-shadow: 0 0 50px rgba(212, 175, 55, 0.15), 0 20px 40px rgba(0,0,0,0.5);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.lema-shield-glow:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 0 60px rgba(212, 175, 55, 0.25), 0 30px 50px rgba(0,0,0,0.6);
}
.lema-element-card {
    background: #FFF;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 15px 35px rgba(5,11,20,0.04);
    border: 1px solid rgba(212, 175, 55, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    text-align: center; /* Perfect Symmetry */
}
.lema-element-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 45px rgba(5,11,20,0.08);
    border-color: rgba(212, 175, 55, 0.4);
}
.lema-element-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #D4AF37, #AA7B18);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.lema-element-card:hover::before {
    opacity: 1;
}
.lema-icon-wrap {
    width: 60px;
    height: 60px;
    background: rgba(212,175,55,0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px; /* Centered for symmetry */
    border: 1px solid rgba(212, 175, 55, 0.2);
}

/* =========================================
   MOTION GRAPHICS & ANIMATIONS (LEMA)
   ========================================= */
@keyframes floatShield {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}
@keyframes pulseGlow {
    0% { box-shadow: 0 0 30px rgba(212, 175, 55, 0.2), 0 15px 30px rgba(0,0,0,0.6); }
    50% { box-shadow: 0 0 70px rgba(212, 175, 55, 0.6), 0 25px 50px rgba(0,0,0,0.8); }
    100% { box-shadow: 0 0 30px rgba(212, 175, 55, 0.2), 0 15px 30px rgba(0,0,0,0.6); }
}
@keyframes shimmerText {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}
@keyframes growDivider {
    0% { width: 0; opacity: 0; }
    100% { width: 60px; opacity: 1; }
}

.mg-floating-shield {
    animation: floatShield 5s ease-in-out infinite, pulseGlow 4s ease-in-out infinite;
}
.mg-shimmer-title {
    background: linear-gradient(90deg, #D4AF37 0%, #FFF8D6 30%, #D4AF37 60%);
    background-size: 200% auto;
    color: transparent !important;
    -webkit-background-clip: text;
    background-clip: text;
    animation: shimmerText 6s linear infinite;
}
.mg-stagger-card {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}
.reveal-visible .mg-stagger-card,
.mg-stagger-card.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}
.mg-stagger-card:nth-child(1) { transition-delay: 0.1s; }
.mg-stagger-card:nth-child(2) { transition-delay: 0.3s; }
.mg-stagger-card:nth-child(3) { transition-delay: 0.5s; }
.mg-stagger-card:nth-child(4) { transition-delay: 0.7s; }

.mg-divider {
    width: 0 !important;
    transition: width 1s cubic-bezier(0.25, 1, 0.5, 1) 0.5s, opacity 1s ease 0.5s;
    opacity: 0;
}
.reveal-visible .mg-divider,
.mg-divider.reveal-visible {
    width: 60px !important;
    opacity: 1;
}

.mg-icon-spin {
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: inline-block;
}
.mg-stagger-card:hover .mg-icon-spin {
    transform: rotate(360deg) scale(1.2);
}
