/* ===========================
   REUSABLE UI COMPONENTS
   Single source of truth for all shared components
   =========================== */

/* ===========================
   SITE NAVIGATION (used on ALL pages)
   Fixed pixel values - NO relative units!
   =========================== */

.site-header {
    background: var(--color-background);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(26, 0, 0, 0.95);
    height: 80px; /* FIXED height - prevents jumping */
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%; /* Full width to spread logo and nav */
    height: 48px; /* FIXED height */
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.3s ease;
    height: 40px; /* FIXED height */
}

.logo img {
    width: 40px; /* FIXED size */
    height: 40px; /* FIXED size */
    object-fit: contain;
}

.logo:hover {
    opacity: 0.8;
}

.nav-links {
    display: flex;
    gap: 24px; /* FIXED gap */
    align-items: center;
    height: 40px; /* FIXED height */
}

/* Anchor Links (internal page navigation) */
.nav-anchor {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-weight: 400;
    font-size: 14px; /* FIXED size in pixels */
    line-height: 20px; /* FIXED line-height */
    transition: color 0.3s ease;
    white-space: nowrap;
}

.nav-anchor:hover {
    color: var(--color-text-primary);
}

.nav-anchor.active {
    color: var(--color-text-primary);
    font-weight: 500;
}

/* CTA Buttons (Blog, Login) */
.nav-cta {
    padding: 10px 20px; /* FIXED padding */
    background-color: var(--color-secondary);
    color: white !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px; /* FIXED size in pixels */
    line-height: 20px; /* FIXED line-height */
    border-radius: 4px;
    transition: all 0.3s ease;
    white-space: nowrap;
    height: 40px; /* FIXED height */
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
}

.nav-cta:hover {
    background-color: var(--color-accent-coral);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.3);
}

/* Logout Button (when subscriber) */
.nav-logout {
    padding: 10px 20px; /* FIXED padding - same as nav-cta */
    background-color: transparent;
    color: var(--color-accent-coral) !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px; /* FIXED size in pixels */
    line-height: 20px; /* FIXED line-height */
    border: 1px solid var(--color-accent-coral);
    border-radius: 4px;
    transition: all 0.3s ease;
    white-space: nowrap;
    height: 40px; /* FIXED height - same as nav-cta */
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    cursor: pointer;
}

.nav-logout:hover {
    background-color: var(--color-accent-coral);
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.3);
}

/* Mobile/Narrow Responsive */
@media (max-width: 768px) {
    .site-header {
        padding: 8px 0;
        height: auto; /* Allow natural height on mobile */
        min-height: 56px;
    }

    .main-nav {
        height: auto; /* Allow natural height */
        min-height: 40px;
        flex-wrap: wrap; /* Allow wrapping if needed */
        gap: 12px; /* Smaller gap on mobile */
    }

    .nav-links {
        flex-wrap: wrap; /* Allow buttons to wrap */
        gap: 8px; /* Smaller gap between links */
    }

    .logo img {
        width: 32px; /* Smaller logo on mobile */
        height: 32px;
    }

    .nav-anchor,
    .nav-cta,
    .nav-logout {
        font-size: 12px; /* Smaller text on mobile */
        padding: 8px 12px; /* Smaller padding */
        height: 32px; /* Smaller button height */
    }
}

/* LOGIN MODAL (used on Landing Page + Blog) */
.login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.login-modal.active {
    display: flex;
}

.login-modal-content {
    background: var(--color-bg-section);
    border: 2px solid var(--color-secondary);
    border-radius: 12px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 8px 32px rgba(196, 30, 58, 0.3);
}

.login-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
}

.login-modal-close:hover {
    color: var(--color-secondary);
}

.login-modal h3 {
    font-size: 1.8rem;
    color: var(--color-secondary);
    margin-bottom: 15px;
    text-align: center;
}

.login-modal p {
    text-align: center;
    margin-bottom: 20px;
    color: var(--color-text-secondary);
}

/* NEWSLETTER FORM (used on Landing Page + Blog Modal) */
.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.newsletter-form input[type="email"] {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: var(--color-background);
    color: var(--color-text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.newsletter-form input[type="email"]:focus {
    outline: none;
    border-color: var(--color-secondary);
}

.newsletter-form button[type="submit"] {
    width: 100%;
    cursor: pointer;
    border: none;
}

/* PAYWALL HELPER TEXT */
.paywall-help {
    margin-top: 20px;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    text-align: center;
}

.paywall-help a {
    color: var(--color-secondary);
    text-decoration: underline;
    font-weight: 600;
}

.paywall-help a:hover {
    color: var(--color-accent-coral);
}

.paywall-note {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.8;
    text-align: center;
}

/* STATUS MESSAGES (used in all forms) */
.status-message {
    margin-top: 15px;
    padding: 15px;
    border-radius: 6px;
    display: none;
    font-size: 0.95rem;
}

#modal-login-status-landing,
#modal-login-status,
#unlock-status {
    margin-top: 15px;
    padding: 15px;
    border-radius: 6px;
    display: none;
    font-size: 0.95rem;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .login-modal-content {
        padding: 30px 20px;
    }
}
