/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #e0e0e0;
    line-height: 1.6;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem; /* reduce gap below subtitle by ~1/3 */
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    font-weight: 400;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 2rem;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

.site-footer {
    margin-top: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

/* Hugo markdown content spacing - this is the key! */
h1 {
    font-size: 2.2rem;
    color: white;
    margin: 3rem 0 2rem 0;
    text-align: center;
}

h2 {
    font-size: 1.8rem;
    color: #e0e0e0;
    margin: 2rem 0 1rem 0;
    padding-top: 0;
    border-top: none;
}

h3 {
    font-size: 1.4rem;
    color: #e0e0e0;
    margin: 2.5rem 0 1.5rem 0;
}

/* Section cards for clean spacing */
.card {
    background: transparent;
    border: none;
    border-radius: 16px;
    padding: 0 0 1rem 0;
}

.card + .card {
    margin-top: 1.75rem;
}

/* Larger spacing for specific sections */
.card.spaced {
    margin-top: 2.25rem;
}

/* Reduce space after specific cards */
.card.tight-after + .card {
    margin-top: 0.75rem;
}

/* Explicit compact top margin when needed */
.card.mt-tight {
    margin-top: 0.75rem !important;
}

.card h2 {
    margin-top: 0;
    margin-bottom: 0.33rem; /* tighter space above the subscribe line */
}

.card p:last-child {
    margin-bottom: 0;
}

/* Buttons and actions */
.actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* tighter space between buttons */
    margin-top: 0.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.85rem 1.1rem;
    border-radius: 16px;
    font-weight: 600;
    line-height: 1;
    border: 1px solid transparent;
    text-decoration: none !important;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.05s ease;
    justify-content: center;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: linear-gradient(90deg, #6b8bff 0%, #a366ff 100%);
    color: #fff;
}

.btn-primary:hover { filter: brightness(1.05); }

.btn-secondary {
    background: rgba(255, 255, 255, 0.18);
    color: #f2f3ff;
    border-color: rgba(255,255,255,0.22);
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.25); }

.btn:visited { color: inherit; }

.muted { color: #9aa0b4; }

/* Tighter list spacing inside cards */
.card ul {
    margin: 0.75rem 0 0.5rem 1.25rem;
}

/* Intro section spacing */
.welcome {
    text-align: center;
    margin-bottom: 2rem;
}

/* Paragraph spacing */
p {
    margin-bottom: 2rem;
    line-height: 1.7;
    color: #b0b0b0;
}

/* Tighter spacing for the first paragraph ("Subscribe to …") in each card */
.card > p:first-of-type {
    margin-top: 0;           /* collapse with h2 bottom margin */
    margin-bottom: 1.33rem;  /* ~1/3 less than global 2rem */
}

/* List spacing */
ul, ol {
    margin: 2.5rem 0 2.5rem 2rem;
}

li {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #b0b0b0;
}

/* Link styling */
a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:visited {
    color: #667eea;
}

a:hover {
    color: #8b9dc3;
    text-decoration: underline;
}

/* Simple spacers for explicit gaps */
.spacer-xs { height: 8px; }
.spacer-sm { height: 12px; }
.spacer-md { height: 20px; }
.spacer-lg { height: 32px; }

/* Page wrapper for sidebar layout */
.page-wrapper {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.sidebar {
    flex-shrink: 0;
    width: 300px;
    position: sticky;
    top: 2rem;
}

.sidebar-left {
    order: -1;
}

.sidebar-right {
    order: 1;
}

.ad-space {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    min-height: 250px;
}

/* Bottom banner */
.bottom-banner {
    text-align: center;
    padding: 1.5rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

.bottom-banner .ad-space {
    max-width: 728px;
    margin: 0 auto;
    padding: 1rem 0;
    background: transparent;
    min-height: auto;
}

/* Responsive design */
@media (max-width: 1024px) {
    .page-wrapper {
        flex-direction: column;
        gap: 1rem;
    }

    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
    }

    .sidebar-left,
    .sidebar-right {
        order: 0;
    }
}

@media (max-width: 768px) {
    .page-wrapper {
        padding: 1rem 0.5rem;
    }

    .sidebar {
        display: none;
    }

    .container {
        padding: 0;
    }

    .title {
        font-size: 2rem;
    }

    h1 {
        font-size: 1.8rem;
        margin: 2rem 0 1.5rem 0;
    }

    h2 {
        font-size: 1.5rem;
        margin: 1.5rem 0 1rem 0;
    }

    h3 {
        font-size: 1.3rem;
        margin: 2rem 0 1rem 0;
    }
    .card + .card { margin-top: 1.25rem; }
    .card.spaced { margin-top: 1.75rem; }
}
