/* /App/static/css/main.css
   BRENDONATWELL.CO.ZA - Main Stylesheet
   Full production version
============================================= */

/* ── CSS Variables ────────────────────────── */
:root {
    --space-dark:    #0a0a1a;
    --space-card:    #12122a;
    --space-border:  #1e1e3a;
    --space-purple:  #6c63ff;
    --space-cyan:    #00d4ff;
    --space-muted:   #aaaacc;
    --space-faint:   #666688;
    --transition:    0.2s ease;
}

/* ── Reset & Base ─────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--space-dark);
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── Navbar ───────────────────────────────── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--space-border);
    transition: background var(--transition),
                backdrop-filter var(--transition);
}

.navbar.scrolled {
    background: rgba(10, 10, 26, 0.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--space-border);
}

.nav-link {
    position: relative;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition);
    padding-bottom: 2px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        var(--space-purple),
        var(--space-cyan)
    );
    transition: width var(--transition);
    border-radius: 2px;
}

.nav-link:hover {
    color: #ffffff;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: #ffffff;
}

.nav-link.active::after {
    width: 100%;
    background: linear-gradient(
        90deg,
        var(--space-purple),
        var(--space-cyan)
    );
}

/* ── Page Wipe Transition ─────────────────── */
#page-wipe {
    position: fixed;
    inset: 0;
    background: var(--space-dark);
    z-index: 9999;
    pointer-events: none;
    animation: wipeOut 0.4s ease forwards;
}

@keyframes wipeOut {
    0%   { transform: translateX(0);    opacity: 1; }
    100% { transform: translateX(100%); opacity: 0; }
}

/* ── Hero Section ─────────────────────────── */
.hero-gradient {
    background: radial-gradient(
        ellipse at 50% 0%,
        rgba(108, 99, 255, 0.15) 0%,
        rgba(10, 10, 26, 0) 70%
    );
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(
        135deg,
        var(--space-purple) 0%,
        var(--space-cyan)   100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Email Input (newsletter signup) ──────── */
.email-input {
    padding: 0.85rem 1.25rem;
    background: rgba(10, 10, 26, 0.9);
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    border: 1px solid var(--space-border);
    border-radius: 999px;
    outline: none;
    transition: border-color var(--transition);
}

.email-input::placeholder {
    color: var(--space-faint);
}

.email-input:focus {
    border-color: var(--space-purple);
}

/* Stop browser/password-manager autofill turning the box white */
.email-input:-webkit-autofill,
.email-input:-webkit-autofill:hover,
.email-input:-webkit-autofill:focus,
#popup-email:-webkit-autofill,
#popup-email:-webkit-autofill:hover,
#popup-email:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff;
    -webkit-box-shadow: 0 0 0 1000px var(--space-dark) inset;
    caret-color: #ffffff;
    transition: background-color 9999s ease-in-out 0s;
}

/* ── Buttons ──────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    background: linear-gradient(
        135deg,
        var(--space-purple),
        #8b5cf6
    );
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    transition: transform var(--transition),
                box-shadow var(--transition);
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 99, 255, 0.4);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    background: transparent;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--space-border);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-secondary:hover {
    border-color: var(--space-purple);
    background: rgba(108, 99, 255, 0.08);
    transform: translateY(-2px);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    background: transparent;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--space-border);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-outline:hover {
    border-color: var(--space-purple);
    background: rgba(108, 99, 255, 0.08);
    transform: translateY(-2px);
}

/* ── Cards ────────────────────────────────── */
.post-card {
    background: var(--space-card);
    border: 1px solid var(--space-border);
    border-radius: 1rem;
    overflow: hidden;
    transition: transform var(--transition),
                border-color var(--transition),
                box-shadow var(--transition);
    text-decoration: none;
    display: block;
}

.post-card:hover {
    transform: translateY(-4px);
    border-color: rgba(108, 99, 255, 0.4);
    box-shadow: 0 12px 40px rgba(108, 99, 255, 0.12);
}

.post-card-img-wrap {
    height: 190px;
    overflow: hidden;
    position: relative;
}

.post-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.post-card:hover .post-card-img {
    transform: scale(1.06);
}

.post-card-img-placeholder,
.post-card-img-wrap > div {
    width: 100%;
    height: 100%;
}

.post-placeholder-1 {
    background: linear-gradient(
        135deg, #1f0a0a 0%, #4a1515 100%
    );
}

.post-placeholder-2 {
    background: linear-gradient(
        135deg, #0a1a0a 0%, #154a20 100%
    );
}

.post-placeholder-3 {
    background: linear-gradient(
        135deg, #0a0a2a 0%, #151560 100%
    );
}

/* ── Category Badges ──────────────────────── */
.category-badge {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    background: rgba(108, 99, 255, 0.15);
    color: var(--space-purple);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    border: 1px solid rgba(108, 99, 255, 0.3);
}

.category-badge-sm {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 999px;
    border: 1px solid rgba(108, 99, 255, 0.3);
    background: rgba(108, 99, 255, 0.1);
    color: var(--space-purple);
}

/* ── Forecast Button ──────────────────────── */
.forecast-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.5rem;
    background: rgba(108, 99, 255, 0.08);
    border: 1px solid rgba(108, 99, 255, 0.3);
    border-radius: 999px;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    overflow: hidden;
    animation: forecastPulse 2.5s ease-in-out infinite;
}

.forecast-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(108, 99, 255, 0.4),
        rgba(0, 212, 255, 0.3)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.forecast-btn:hover::before {
    opacity: 1;
}

.forecast-btn:hover {
    border-color: var(--space-cyan);
    box-shadow: 0 0 20px rgba(108, 99, 255, 0.4),
                0 0 40px rgba(0, 212, 255, 0.2);
    transform: translateY(-2px);
}

@keyframes forecastPulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(108, 99, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 20px rgba(108, 99, 255, 0.8),
                    0 0 40px rgba(0, 212, 255, 0.4);
    }
}

/* ── Selection Colour ─────────────────────── */
::selection {
    background: rgba(108, 99, 255, 0.3);
    color: #ffffff;
}

/* ── Scrollbar Styling ────────────────────── */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--space-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--space-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--space-purple);
}

/* ── Back to Top Button ───────────────────── */
#back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    background: var(--space-purple);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    z-index: 450;
    display: flex;
    align-items: center;
    justify-content: center;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background: #7c73ff;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4);
}

/* ═══════════════════════════════════════════
   POST CONTENT TYPOGRAPHY
   Controls all styling inside blog posts.
   The .post-content wrapper is in post.html
   ═══════════════════════════════════════════ */

.post-content {
    color: rgba(255, 255, 255, 0.88);
    font-size: 1rem;
    line-height: 1.8;
}

/* ── Normal paragraphs ────────────────────── */
/* Each Enter in Quill = new <p> tag          */
.post-content p {
    margin-top: 0;
    margin-bottom: 0.15rem;
    line-height: 1.8;
}

/* ── Empty paragraph spacers ─────────────── */
/* Quill creates <p><br></p> on double-Enter  */
/* These must be VISIBLE blocks not hidden    */
.post-content p:has(> br:only-child) {
    display: block !important;
    height: 0.9em !important;
    line-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide truly empty p tags */
.post-content p:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ── Headings ─────────────────────────────── */
.post-content h1,
.post-content h2,
.post-content h3 {
    color: #ffffff;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.post-content h1 { font-size: 1.75rem; }
.post-content h2 { font-size: 1.4rem;  }
.post-content h3 { font-size: 1.15rem; }

.post-content h1:first-child,
.post-content h2:first-child,
.post-content h3:first-child {
    margin-top: 0;
}

/* ── Inline text styles ───────────────────── */
.post-content strong {
    color: #ffffff;
    font-weight: 700;
}

.post-content em {
    color: rgba(255, 255, 255, 0.8);
}

/* ── Blockquotes ──────────────────────────── */
.post-content blockquote {
    border-left: 3px solid #6c63ff;
    margin: 1.5rem 0;
    padding: 0.75rem 1.25rem;
    background: rgba(108, 99, 255, 0.06);
    border-radius: 0 0.5rem 0.5rem 0;
    color: rgba(255, 255, 255, 0.75);
    font-style: italic;
}

/* ── Lists ────────────────────────────────── */
.post-content ul,
.post-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.post-content li {
    margin-bottom: 0.35rem;
    line-height: 1.7;
}

/* ── Links ────────────────────────────────── */
.post-content a {
    color: #6c63ff;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.post-content a:hover {
    color: #00d4ff;
}

/* ── Images ───────────────────────────────── */
.post-content img {
    max-width: 100%;
    border-radius: 0.75rem;
    margin: 1.5rem 0;
}

/* ── Code blocks ──────────────────────────── */
.post-content pre {
    background: rgba(10, 10, 26, 0.8);
    border: 1px solid #1e1e3a;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.875rem;
}

.post-content code {
    background: rgba(108, 99, 255, 0.12);
    color: #00d4ff;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 768px) {
    .hero-title {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    .post-card-img-wrap {
        height: 160px;
    }

    .post-content {
        font-size: 0.95rem;
    }

    .post-content h1 { font-size: 1.5rem;  }
    .post-content h2 { font-size: 1.25rem; }
    .post-content h3 { font-size: 1.1rem;  }
}

/* ── Twemoji Size Control ─────────────────── */
img.emoji {
    height: 1.2em !important;
    width: 1.2em !important;
    margin: 0 0.05em !important;
    vertical-align: -0.15em !important;
    display: inline !important;
    max-width: none !important;
}
/* ── Only hide main on homepage during intro ── */
body.intro-playing main {
    opacity: 0;
    transition: opacity 0.8s ease;
}

body.intro-complete main {
    opacity: 1;
    transition: opacity 0.8s ease;
}
/* ── Podcast (YouTube) ────────────────────── */
.podcast-player {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000000;
    border: 1px solid var(--space-border);
    border-radius: 1rem;
    overflow: hidden;
}

.podcast-player iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Thumbnail shown until play is clicked (keeps pages fast) */
.podcast-facade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: #000000;
    cursor: pointer;
}

.podcast-facade img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
    transition: opacity var(--transition), transform 0.6s ease;
}

.podcast-facade:hover img {
    opacity: 1;
    transform: scale(1.03);
}

.podcast-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 72px;
    height: 72px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--space-purple);
    box-shadow: 0 10px 30px rgba(108, 99, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition);
}

.podcast-play-btn::after {
    content: '';
    margin-left: 6px;
    border-style: solid;
    border-width: 13px 0 13px 22px;
    border-color: transparent transparent transparent #ffffff;
}

.podcast-facade:hover .podcast-play-btn {
    transform: translate(-50%, -50%) scale(1.1);
}

.podcast-card-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000000;
}

.podcast-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.post-card:hover .podcast-card-thumb img {
    transform: scale(1.06);
}

.podcast-card-thumb .podcast-play-btn {
    width: 48px;
    height: 48px;
    opacity: 0;
    transition: opacity var(--transition);
}

.podcast-card-thumb .podcast-play-btn::after {
    margin-left: 4px;
    border-width: 9px 0 9px 15px;
}

.post-card:hover .podcast-card-thumb .podcast-play-btn,
.podcast-card.is-playing .podcast-play-btn {
    opacity: 1;
}

.podcast-card.is-playing {
    border-color: var(--space-purple);
}

.podcast-now-playing {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: var(--space-purple);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: none;
}

.podcast-card.is-playing .podcast-now-playing {
    display: inline-block;
}

.btn-youtube {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    background: #ff0033;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 999px;
    text-decoration: none;
    transition: transform var(--transition),
                box-shadow var(--transition);
}

.btn-youtube:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 0, 51, 0.35);
}
