html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

:root {
    --bg-dark: #0b0f19; /* Deep dark background */
    --text-main: #f8f9fa;
    --text-muted: #a0aab2;
    --brand-purple: #6a4bff;
    --brand-purple-hover: #5538e0;
    --card-bg: #151a28;
    --border-color: #2a3143;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
}

/* --- Hero Layout --- */
.hero-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
    gap: 4rem;
}

.hero-content {
    flex: 1;
    max-width: 50%;
}

    .hero-content h1 {
        font-size: 3.5rem;
        font-weight: 700;
        line-height: 1.1;
        margin-bottom: 1.5rem;
    }

    .hero-content p {
        font-size: 1.1rem;
        color: var(--text-muted);
        line-height: 1.6;
        margin-bottom: 2.5rem;
    }

/* --- Buttons --- */
.hero-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--brand-purple);
    color: white;
    border: none;
}

    .btn-primary:hover {
        background-color: var(--brand-purple-hover);
    }

.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

    .btn-secondary:hover {
        border-color: var(--text-main);
    }

/* --- Animated Gradient Border --- */
.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
}

.gradient-border-wrapper {
    /* The color changing fat border */
    background: linear-gradient(45deg, #ff9a9e, #fecfef, #a18cd1, #fbc2eb);
    background-size: 300% 300%;
    animation: gradientShift 6s ease infinite;
    padding: 12px; /* Controls the 'fatness' of the border */
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.visual-inner {
    background-color: #0d1117;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
}

    .visual-inner img {
        max-width: 100%;
        height: auto;
        display: block;
    }

/* --- Wide Blog Cards --- */
.blog-feed {
    max-width: 1000px;
    margin: 4rem auto;
    padding: 0 5px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.blog-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .blog-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 20px rgba(0,0,0,0.2);
        border-color: var(--brand-purple);
    }

.blog-card-content h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.4rem;
}

.blog-excerpt {
    color: var(--text-muted);
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
}

.blog-date {
    font-size: 0.85rem;
    color: #6c757d;
}

.read-more {
    color: var(--brand-purple);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

/* Ensure content columns stay organized layout-wise */
.blog-card {
    display: flex;
    flex-direction: column; /* Stack main card row and full body vertically */
    cursor: pointer;
}

.blog-card-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Base style for the expand button replacing the anchor tag */
.expand-btn {
    background: none;
    border: none;
    color: var(--brand-purple);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

    .expand-btn .arrow {
        transition: transform 0.3s ease;
    }

/* Expansion Wrapper Architecture */
.blog-card-full-body {
    display: grid;
    grid-template-rows: 0fr; /* Collapsed state */
    transition: grid-template-rows 0.3s ease-in-out;
    overflow: hidden;
}

    .blog-card-full-body > div {
        min-height: 0; /* Necessary fix for grid container item sizing */
    }

.card-divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.full-content-markdown {
    color: var(--text-main);
    line-height: 1.7;
    font-size: 1rem;
    padding-bottom: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    /* Crucial fix: Tells the browser to respect the \n line breaks from your C# string */
    white-space: pre-line;
}

/* --- Expanded Active States --- */
.blog-card.is-expanded {
    border-color: var(--brand-purple);
}

    .blog-card.is-expanded .blog-card-full-body {
        grid-template-rows: 1fr; /* Expands smoothly to exactly its content size */
    }

    .blog-card.is-expanded .card-divider,
    .blog-card.is-expanded .full-content-markdown {
        opacity: 1;
    }

    .blog-card.is-expanded .expand-btn {
        color: var(--text-muted);
    }

        .blog-card.is-expanded .expand-btn .arrow {
            transform: rotate(180deg); /* Rotates arrow upward */
        }
/* --- Updated Wide Blog Cards with Hover Gradients --- */
.blog-card {
    position: relative; /* Essential for containing the border spacing */
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

    /* On hover, we mimic the gradient-border-wrapper settings exactly */
    .blog-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
        border-color: transparent; /* Hide standard border to let gradient show through */
        /* Pull the exact same background settings from your hero wrapper */
        background: linear-gradient(45deg, #ff9a9e, #fecfef, #a18cd1, #fbc2eb);
        background-size: 300% 300%;
        animation: gradientShift 6s ease infinite; /* Reuses your existing @keyframes */
        /* Slightly pad the content inward to make a "fat border" effect */
        padding: calc(1.5rem + 3px) calc(2rem + 3px);
    }

    /* This layer forces the dark card interior to stay dark, hiding the center of the gradient */
    .blog-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--card-bg);
        border-radius: 11px; /* Slightly tighter radius so it conforms neatly */
        z-index: 1;
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .blog-card:hover::before {
        opacity: 1;
        /* Inset the dark background mask slightly on hover to expose the thick animated edge */
        top: 4px;
        left: 4px;
        right: 4px;
        bottom: 4px;
    }

/* Force all your card contents to sit safely above the background mask layer */
.blog-card-main,
.blog-card-full-body {
    position: relative;
    z-index: 2;
}

/* Smooth out the interior transitions when moving mouse away */
.blog-card, .blog-card::before {
    transition: all 0.25s ease-in-out;
}

.blog-card-full-body {
    display: grid;
    grid-template-rows: 0fr; /* Starts completely collapsed */
    transition: grid-template-rows 0.3s ease-in-out;
}

/* This masks the large paragraph text while the card is closed */
.body-overflow-mask {
    overflow: hidden;
    min-height: 0; /* Prevents text from forcing its parent open */
}