/* ============================================================
   Oahu Prep — blog.css
   Blog index + post detail styles
   Place in: static/main/css/blog.css
   ============================================================ */


/* ============================================================
   Blog Hero
   ============================================================ */

.blog-hero {
    background: var(--orange-light);
    padding: 2rem 0 1rem;
}

.blog-hero .hero-heading {
    font-size: clamp(2rem, 4.5vw, 2.8rem);
}

.blog-hero .hero-sub {
    font-size: 1.1rem;
    color: var(--gray-text);
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}


/* ============================================================
   Category Filters
   ============================================================ */

.blog-filters {
    background: var(--white);
    border-bottom: 1px solid var(--gray-border);
    position: sticky;
    top: 72px;
    z-index: 100;
}

.filter-bar {
    display: flex;
    gap: 0.5rem;
    padding: 0.85rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-pill {
    flex-shrink: 0;
    padding: 0.4rem 1.1rem;
    border-radius: 50rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--gray-text);
    background: var(--gray-bg);
    border: 1.5px solid var(--gray-border);
    transition: all 0.2s ease;
}

.filter-pill:hover {
    color: var(--orange);
    border-color: var(--orange);
    background: var(--orange-light);
}

.filter-pill--active {
    color: var(--white);
    background: var(--orange);
    border-color: var(--orange);
}

.filter-pill--active:hover {
    color: var(--white);
    background: var(--orange-dark);
    border-color: var(--orange-dark);
}


/* ============================================================
   Blog Card Grid
   ============================================================ */

.blog-grid-section {
    background: var(--white);
}

.blog-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.blog-card {
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.blog-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.blog-card-image {
    height: 200px;
    overflow: hidden;
    background: var(--gray-bg);
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.04);
}

.blog-card-image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--orange-light) 0%, var(--blue-light) 100%);
}

.blog-card-image--placeholder i {
    font-size: 2.5rem;
    color: var(--orange);
    opacity: 0.4;
}

.blog-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card-category {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.7rem;
    border-radius: 50rem;
    margin-bottom: 0.75rem;
    align-self: flex-start;
}

/* Category colors */
.blog-card-category--math        { background: var(--blue-light); color: var(--blue-dark); }
.blog-card-category--test-prep   { background: var(--orange-light); color: var(--orange-dark); }
.blog-card-category--admissions  { background: #f3e8ff; color: #7c3aed; }
.blog-card-category--local       { background: #e8f5e9; color: #2e7d32; }
.blog-card-category--cs          { background: #e3f2fd; color: #1565c0; }
.blog-card-category--general     { background: var(--gray-bg); color: var(--gray-text); }

.blog-card-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--dark);
    margin-bottom: 0.6rem;
}

.blog-card-excerpt {
    color: var(--gray-text);
    font-size: 0.9rem;
    line-height: 1.55;
    flex-grow: 1;
    margin-bottom: 1rem;
    /* Clamp to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-date {
    font-size: 0.8rem;
    color: var(--gray-muted);
    font-weight: 500;
    margin-top: auto;
}


/* ============================================================
   Draft State (staff preview only)
   ============================================================ */

.blog-card--draft {
    border: 2px dashed var(--orange);
    opacity: 0.85;
    position: relative;
}

.blog-card--draft:hover {
    opacity: 1;
}

.blog-card-draft-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    background: var(--orange);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.65rem;
    border-radius: 50rem;
}


/* ============================================================
   Empty State (no posts yet)
   ============================================================ */

.blog-empty {
    background: var(--white);
    padding: 2rem 0 1rem;
}

.empty-illustration {
    margin-bottom: 2rem;
}

.empty-gif {
    max-width: 280px;
    width: 100%;
}

.empty-heading {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
}

.empty-text {
    color: var(--gray-text);
    font-size: 1rem;
    max-width: 440px;
    margin: 0 auto 1.5rem;
}

.empty-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.empty-tag {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    background: var(--gray-bg);
    border: 1px solid var(--gray-border);
    border-radius: 50rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--gray-text);
}


/* ============================================================
   Blog Post Detail — Header
   ============================================================ */

.blog-post-hero {
    background: var(--orange-light);
    padding: 3rem 0 2.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gray-muted);
    text-decoration: none;
    transition: color 0.15s ease;
    margin-bottom: 1rem;
}

.back-link:hover {
    color: var(--orange);
}

.blog-post-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.2;
    margin: 0.75rem 0 1.25rem;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.blog-post-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--blue);
}

.blog-post-author {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--dark);
    display: block;
}

.blog-post-meta time {
    font-size: 0.82rem;
    color: var(--gray-muted);
}


/* ============================================================
   Blog Post Detail — Featured Image
   ============================================================ */

.blog-post-image-wrap {
    background: var(--white);
    padding: 2rem 0 0;
}

.blog-post-image {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}


/* ============================================================
   Blog Post Detail — Article Body
   ============================================================ */

.blog-post-body {
    background: var(--white);
    padding: 3rem 0;
}

/* ---- .blog-content wrapper for {{ post.content|safe }} ---- */

.blog-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--gray-text);
}

.blog-content h2 {
    font-size: 1.6rem;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-border);
}

.blog-content h3 {
    font-size: 1.25rem;
    margin: 2rem 0 0.75rem;
}

.blog-content h4 {
    font-size: 1.1rem;
    margin: 1.5rem 0 0.5rem;
}

.blog-content p {
    margin-bottom: 1.25rem;
}

.blog-content a {
    color: var(--blue-dark);
    text-decoration: underline;
    text-decoration-color: var(--gray-border);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.15s ease;
}

.blog-content a:hover {
    text-decoration-color: var(--blue-dark);
}

.blog-content ul,
.blog-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.blog-content li {
    margin-bottom: 0.4rem;
}

.blog-content blockquote {
    border-left: 4px solid var(--orange);
    background: var(--orange-light);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--dark);
}

.blog-content blockquote p:last-child {
    margin-bottom: 0;
}

.blog-content pre {
    background: var(--dark);
    color: #e8e6e3;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.blog-content code {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.88em;
}

.blog-content p code,
.blog-content li code {
    background: var(--gray-bg);
    border: 1px solid var(--gray-border);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: var(--dark);
}

.blog-content img {
    border-radius: var(--radius);
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}

.blog-content hr {
    border: none;
    height: 2px;
    background: var(--gray-border);
    margin: 2.5rem 0;
}

.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.blog-content th {
    background: var(--gray-bg);
    font-weight: 700;
    color: var(--dark);
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--gray-border);
}

.blog-content td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--gray-border);
}

.blog-content tr:hover td {
    background: var(--gray-bg);
}

/* Utility classes for use inside blog HTML content */
.blog-content .callout {
    background: var(--blue-light);
    border-left: 4px solid var(--blue);
    padding: 1.25rem 1.5rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 1.5rem 0;
}

.blog-content .callout-orange {
    background: var(--orange-light);
    border-left: 4px solid var(--orange);
    padding: 1.25rem 1.5rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 1.5rem 0;
}


/* ============================================================
   Blog Post Detail — Author Card
   ============================================================ */

.blog-post-footer {
    background: var(--white);
    padding: 0 0 3rem;
}

.author-card {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    background: linear-gradient(135deg, var(--orange-light) 0%, var(--blue-light) 100%);
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.author-card-photo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--blue);
    flex-shrink: 0;
}

.author-card-name {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

.author-card-bio {
    color: var(--gray-text);
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

@media (max-width: 576px) {
    .author-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}