/* ===========================
   DISCOVER PAGE STYLES
   =========================== */

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

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', 'Roboto', sans-serif;
    color: #f7fafc;
    overflow-x: hidden;
    line-height: 1.6;
    background: linear-gradient(180deg, 
        hsl(215, 65%, 22%) 0%, 
        hsl(210, 50%, 18%) 50%, 
        hsl(205, 45%, 16%) 100%);
    min-height: 100vh;
    position: relative;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: #d4af37;
    color: #1a1a1a;
    padding: 12px 20px;
    z-index: 9999;
    transition: top 0.3s ease;
    text-decoration: none;
    font-weight: 600;
    border-bottom-right-radius: 8px;
}

.skip-link:focus { 
    top: 0; 
    outline: 3px solid #ffffff; 
}

/* Screen reader only */
.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;
}

/* Watermark */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('watermark-square-compass.png');
    background-size: 60vw 60vw;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

/* Subtle background texture */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(212, 175, 55, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.01) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* Z-index layering */
.header, .section, .footer, .header-container, .footer-container, 
section, header, footer, main, nav, article, aside, .content, 
.container {
    position: relative;
    z-index: 10;
}

/* Keyboard navigation visibility */
.keyboard-navigation *:focus {
    outline: 3px solid #d4af37 !important;
    outline-offset: 2px !important;
}

/* ===========================
   PROGRESS NAVIGATION
   =========================== */

.progress-nav {
    position: fixed;
    top: 50%;
    right: 2rem;
    transform: translateY(-50%);
    z-index: 1000;
    background: rgba(26, 32, 44, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 15px;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.progress-nav.visible {
    opacity: 1;
    visibility: visible;
}

.progress-nav h4 {
    color: #d4af37;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.nav-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 8px;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    color: inherit;
}

.nav-item:last-child {
    margin-bottom: 0;
}

.nav-item:hover {
    background: rgba(212, 175, 55, 0.1);
}

/* UPDATED: focus-visible for keyboard users without over-highlighting mouse clicks */
.nav-item:focus {
    outline: none;
}
.nav-item:focus-visible {
    outline: 3px solid #d4af37;
    outline-offset: 2px;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.5);
    margin-right: 0.8rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
}

.nav-item.active .nav-dot {
    background: #d4af37;
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.nav-label {
    font-size: 0.75rem;
    color: #cbd5e0;
    white-space: nowrap;
}

.nav-item.active .nav-label {
    color: #d4af37;
    font-weight: 500;
}

/* ===========================
   HEADER
   =========================== */

.header {
    background: linear-gradient(135deg, 
        hsl(225, 55%, 15%) 0%, 
        hsl(220, 60%, 17%) 25%, 
        hsl(218, 62%, 19%) 50%, 
        hsl(216, 64%, 21%) 75%, 
        hsl(215, 65%, 22%) 100%);
    padding: 2rem 0;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.lodge-text {
    display: flex;
    flex-direction: column;
}

/* UPDATED: clamp badge sizes for smoother responsiveness across mid-widths */
.lodge-badge {
    width: clamp(96px, 12vw, 156px);
    height: clamp(96px, 12vw, 156px);
    object-fit: contain;
}

.right-badge {
    width: clamp(80px, 10vw, 130px);
    height: clamp(80px, 10vw, 130px);
    object-fit: contain;
}

.lodge-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.lodge-subtitle {
    font-size: 1.1rem;
    color: #d4af37;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.lodge-details-header {
    font-size: 0.9rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap; /* UPDATED: prevents awkward overflow on mid widths */
    justify-content: center;
}

.nav-link {
    color: #cbd5e0;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem;
    display: inline-block;
}

.nav-link:hover, 
.nav-link.active {
    color: #d4af37;
}

.nav-link:focus {
    outline: 3px solid #d4af37;
    outline-offset: 2px;
}

/* ===========================
   CONTENT SECTIONS
   =========================== */

.section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 6rem 4rem;
}

.section-header {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 3rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.section-subtitle {
    font-size: 1.2rem;
    color: #94a3b8;
    max-width: 600px;
}

/* ===========================
   PAGE HERO
   =========================== */

.page-hero {
    text-align: center;
    padding: 4rem 0 2rem;
}

.page-hero h2 {
    font-size: 3.5rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.page-hero p {
    font-size: 1.3rem;
    color: #94a3b8;
    max-width: 800px;
    margin: 0 auto;
}

/* ===========================
   FREEMASONRY SECTION
   =========================== */

.freemasonry-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.freemasonry-content {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #cbd5e0;
}

.freemasonry-content p {
    margin-bottom: 1.5rem;
}

.highlight {
    color: #d4af37;
    font-weight: 500;
}

.video-container {
    background: rgba(255, 255, 255, 0.05);
    padding: 3rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    height: fit-content;
}

/* UPDATED: make the YouTube embed properly fluid; works even if iframe keeps height attr */
.video-container iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: 12px;
}

/* ===========================
   VALUES SECTION
   =========================== */

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 2rem;
}

.value-card {
    background: rgba(212, 175, 55, 0.1);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    text-align: center;
    transition: all 0.3s ease;
}

.value-card:hover {
    transform: translateY(-5px);
    border-color: rgba(212, 175, 55, 0.4);
    background: rgba(212, 175, 55, 0.15);
}

.value-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #d4af37, #b8941f);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.5rem;
}

.value-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #d4af37;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.value-description {
    color: #cbd5e0;
    line-height: 1.6;
}

/* ===========================
   FEMALE FREEMASONRY
   =========================== */

.female-freemasonry {
    background: rgba(212, 175, 55, 0.05);
    padding: 3rem;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.female-content {
    font-size: 1.1rem;
    color: #cbd5e0;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.female-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.female-link {
    padding: 0.75rem 1.5rem;
    background: rgba(212, 175, 55, 0.2);
    color: #d4af37;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.female-link:hover {
    background: rgba(212, 175, 55, 0.3);
    transform: translateY(-1px);
}

.female-link:focus {
    outline: 3px solid #d4af37;
    outline-offset: 2px;
}

/* ===========================
   CTA BUTTONS
   =========================== */

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #c53030 0%, #9c2a2a 100%);
    color: #fff;
    padding: 1.2rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(197, 48, 48, 0.3);
    border: 2px solid transparent;
    width: fit-content;
    margin-top: 2rem;
    min-height: 55px;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(197, 48, 48, 0.4);
    border-color: rgba(212, 175, 55, 0.5);
}

.cta-button:focus {
    outline: 3px solid #d4af37;
    outline-offset: 2px;
}

.cta-button.secondary {
    background: linear-gradient(135deg, #d4af37 0%, #b8941f 100%);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
    color: #1a1a1a;
}

.cta-button.secondary:hover {
    box-shadow: 0 12px 35px rgba(212, 175, 55, 0.4);
    border-color: rgba(197, 48, 48, 0.5);
}

/* ===========================
   FOOTER
   =========================== */

.footer {
    background: linear-gradient(135deg, 
        hsl(225, 55%, 15%) 0%, 
        hsl(220, 60%, 17%) 25%, 
        hsl(218, 62%, 19%) 50%, 
        hsl(216, 64%, 21%) 75%, 
        hsl(215, 65%, 22%) 100%);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: #d4af37;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.footer-section p,
.footer-section a {
    color: #cbd5e0;
    font-size: 0.9rem;
    line-height: 1.6;
    text-decoration: none;
}

.footer-section a:hover {
    color: #d4af37;
}

.footer-section a:focus {
    outline: 3px solid #d4af37;
    outline-offset: 2px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.8rem;
}

/* ===========================
   PRINT STYLES
   =========================== */

@media print {
    body { 
        background: white; 
        color: black; 
    }
    
    .header, 
    .footer, 
    .progress-nav, 
    .cta-button, 
    .video-container { 
        display: none; 
    }
    
    .section { 
        padding: 0; 
        margin: 0; 
    }
    
    a { 
        text-decoration: underline; 
        color: black; 
    }
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

@media (min-width: 1920px) {
    .section, 
    .header-container, 
    .footer-container {
        max-width: 1600px;
    }
}

@media (max-width: 1200px) {
    .header-container, 
    .section, 
    .footer-container {
        padding: 0 3rem;
    }
    
    .section {
        padding: 5rem 3rem;
    }
}

@media (min-width: 769px) and (max-width: 1199px) {
    .freemasonry-grid,
    .values-grid {
        gap: 3rem;
    }
    
    .section-title, 
    .page-hero h2 {
        font-size: 2.5rem;
    }

    .section-subtitle, 
    .page-hero p {
        font-size: 1.1rem;
    }
}

/* Compact mode navigation */
@media screen and (max-width: 1600px) {
    .progress-nav {
        right: 1rem;
        padding: 0.75rem 0.5rem;
    }
    
    .progress-nav h4, 
    .nav-label {
        display: none; 
    }
    
    .nav-item {
        justify-content: center;
        padding: 0.5rem 0;
    }
    
    .nav-dot {
        margin-right: 0;
        width: 12px;
        height: 12px;
    }
}

@media (max-width: 768px) {
    .progress-nav { 
        display: none; 
    }
    
    body::after {
        background-size: 75vw 75vw;
    }

    .header-container {
        padding: 0 2rem;
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .logo-section, 
    .lodge-info {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
        width: 100%;
        flex-direction: column;
    }
    
    .nav-link {
        padding: 0.8rem 1rem;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 6px;
        width: 100%;
        text-align: center;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .section {
        padding: 4rem 2rem;
    }

    .lodge-title {
        font-size: 2rem;
    }

    .section-title, 
    .page-hero h2 {
        font-size: 2.2rem;
    }

    .freemasonry-grid, 
    .values-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .female-links {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .female-link {
        width: 100%;
        text-align: center;
    }

    .footer-container {
        padding: 0 2rem;
    }
    
    /* Keep your explicit mobile sizes; clamp above handles in-betweens */
    .lodge-badge, 
    .right-badge {
        width: 120px;
        height: 120px;
    }
    
    .cta-button {
        width: 100%;
    }

    /* UPDATED: if iframe keeps a fixed height attribute, this still caps it nicely */
    .video-container iframe {
        max-height: 250px;
    }
}

@media (max-width: 480px) {
    body::after {
        background-size: 90vw 90vw;
        opacity: 0.02;
    }

    .lodge-title {
        font-size: 1.75rem;
    }

    .section {
        padding: 3rem 1.5rem;
    }

    .section-title, 
    .page-hero h2 {
        font-size: 1.8rem;
    }

    .page-hero p {
        font-size: 1.1rem;
    }

    .value-card {
        padding: 1.5rem;
    }

    .female-freemasonry {
        padding: 2rem;
    }

    .footer-container {
        padding: 0 1.5rem;
    }
    
    .lodge-badge, 
    .right-badge {
        width: 96px;
        height: 96px;
    }

    .video-container {
        padding: 1.5rem;
    }

    /* UPDATED: if iframe keeps a fixed height attribute, this still caps it nicely */
    .video-container iframe {
        max-height: 200px;
    }
}

/* UPDATED: improve watermark behaviour on short/landscape viewports */
@media (max-height: 500px) {
    body::after {
        background-size: 45vh 45vh;
    }
}
