/*
 * Acadify Blog — Silicon Valley Premium Design System
 * Vercel/Linear Aesthetic · Ultra Dark Mode · Fluid Typography
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES (Light Mode)
   ============================================================ */
:root {
    /* Brand */
    --primary: #000000;
    --primary-hover: #333333;
    --primary-light: #f1f5f9;

    /* Neutrals */
    --bg-body: #ffffff;
    --bg-card: #ffffff;
    --bg-surface: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    /* Accents */
    --accent-glow: rgba(0, 0, 0, 0.04);

    /* Layout */
    --card-radius: 12px;
    --radius-lg: 8px;
}

/* ============================================================
   DARK MODE (Vercel / Linear Aesthetic)
   ============================================================ */
[data-theme="dark"] {
    --primary: #ffffff;
    --primary-hover: #cccccc;
    --primary-light: #1a1a1a;

    --bg-body: #000000;
    --bg-card: #0a0a0a;
    --bg-surface: #111111;
    --text-main: #ededed;
    --text-muted: #a1a1aa;
    --border-color: #222222;

    --accent-glow: rgba(255, 255, 255, 0.05);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.15s ease, color 0.15s ease;
}

/* Force Bootstrap text utilities to adapt to our custom theme variables */
.text-muted {
    color: var(--text-muted) !important;
}
.text-secondary {
    color: var(--text-muted) !important;
}
.form-text {
    color: var(--text-muted) !important;
}

/* Custom Background Utilities for Dark Mode */
.bg-surface {
    background-color: var(--bg-surface) !important;
}
.bg-card {
    background-color: var(--bg-card) !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand,
.btn {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: -0.03em;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--text-muted);
}

/* ============================================================
   NAVBAR (Frosted Glass)
   ============================================================ */
.navbar {
    background-color: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

[data-theme="dark"] .navbar {
    background-color: rgba(0, 0, 0, 0.7) !important;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main) !important;
}

.navbar-brand img {
    background: #ffffff;
    padding: 4px 8px;
    border-radius: 8px;
    object-fit: contain;
    transition: all 0.2s ease;
}

[data-theme="dark"] .navbar-brand img {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.nav-link {
    font-weight: 500;
    color: var(--text-muted) !important;
    padding: 0.5rem 0.875rem !important;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-main) !important;
    background-color: var(--primary-light);
}

/* ============================================================
   HERO SECTION (Mesh Glow)
   ============================================================ */
.hero-section {
    padding: 6rem 0 4rem;
    position: relative;
    overflow: hidden;
    background: transparent;
    border-bottom: 1px solid var(--border-color);
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
    z-index: -1;
    pointer-events: none;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 1rem;
    color: var(--text-main);
    line-height: 1.1;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
    background-color: var(--primary);
    color: var(--bg-body);
    border: none;
    font-weight: 600;
    letter-spacing: -0.01em;
    border-radius: 6px;
    padding: 0.625rem 1.25rem;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn-primary:hover {
    background-color: var(--primary);
    color: var(--bg-body);
    opacity: 0.85;
    transform: translateY(-1px);
}

.btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-main);
    background: var(--bg-card);
}

.btn-outline-secondary:hover {
    background: var(--primary-light);
    color: var(--text-main);
    border-color: var(--border-color);
}

/* ============================================================
   POST CARDS
   ============================================================ */
.post-card {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--card-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    height: 100%;
    transition: transform 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-4px);
    border-color: var(--text-muted);
}

.card-img-wrapper {
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
}

.card-img-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.post-card:hover .card-img-top {
    transform: scale(1.03);
}

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

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    color: var(--text-main) !important;
}

.card-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-main);
}

.card-body,
.card-header,
.card-footer {
    color: inherit;
    border-color: inherit;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.page-link {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-main);
    transition: all 0.2s ease;
}
.page-link:hover {
    background-color: var(--primary-light);
    border-color: var(--border-color);
    color: var(--text-main);
}
.page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--bg-body);
}
.page-item.disabled .page-link {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-muted);
    opacity: 0.6;
}

/* ============================================================
   CATEGORY & META BADGES
   ============================================================ */
.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-light);
    color: var(--text-main);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.category-badge:hover {
    border-color: var(--text-muted);
}

.reading-time-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
}

/* ============================================================
   POST CONTENT
   ============================================================ */
.post-content {
    background: var(--bg-body);
    /* seamless with body in pure aesthetic */
    padding: 2rem 0;
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-main);
}

/* Force override any rich-text inline styles so dark mode always works */
[data-theme="dark"] .post-content * {
    color: var(--text-main) !important;
    background-color: transparent !important;
}

.post-content h2 {
    margin-top: 3rem;
    margin-bottom: 1rem;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.post-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 0.875rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.post-content p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

[data-theme="dark"] .post-content p {
    color: #a1a1aa !important;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: var(--text-muted);
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content blockquote {
    border-left: 3px solid var(--text-main);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: var(--bg-surface);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    font-style: italic;
    color: var(--text-main);
}

.post-content img {
    max-width: 100%;
    border-radius: var(--card-radius);
    margin: 2rem 0;
    border: 1px solid var(--border-color);
}

.post-content a {
    color: var(--text-main);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.post-content a:hover {
    color: var(--text-muted);
}

.post-content pre {
    background: #000000;
    color: #ededed;
    border: 1px solid #333333;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    overflow-x: auto;
    font-size: 0.9rem;
    margin: 2rem 0;
}

.post-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ============================================================
   COMMENTS & FORMS
   ============================================================ */
.comment-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.form-control {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    background: var(--bg-body);
    border-color: var(--text-muted);
    box-shadow: none;
    outline: none;
}
.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* ============================================================
   SIDEBAR & WIDGETS
   ============================================================ */
.widget-title {
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer-section {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 4rem 0 2rem;
    margin-top: 5rem;
    text-align: center;
}

.social-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.125rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.social-icon-btn:hover {
    color: var(--text-main);
    border-color: var(--text-main);
}

/* ============================================================
   UTILITIES
   ============================================================ */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

::focus-visible {
    outline: 2px solid var(--text-main);
    outline-offset: 2px;
}

/* ============================================================
   PREMIUM FLOATING SHARE ICONS
   ============================================================ */
.share-btn {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-muted) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

[data-theme="dark"] .share-btn {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Base icon colors */
.share-btn .bi-facebook {
    color: #1877f2 !important;
}
.share-btn .bi-twitter-x {
    color: var(--text-main) !important;
}
.share-btn .bi-linkedin {
    color: #0077b5 !important;
}
.share-btn .bi-whatsapp {
    color: #25d366 !important;
}
.share-btn .bi-share-fill {
    color: var(--text-muted) !important;
}

/* Premium Hover Transitions */
.share-btn:hover {
    transform: translateY(-3px) scale(1.05) !important;
    background-color: var(--bg-surface) !important;
    border-color: var(--text-main) !important;
}

.share-btn:hover .bi-facebook {
    color: #1877f2 !important;
}
.share-btn:hover .bi-twitter-x {
    color: #1da1f2 !important;
}
.share-btn:hover .bi-linkedin {
    color: #00a0dc !important;
}
.share-btn:hover .bi-whatsapp {
    color: #25d366 !important;
}
.share-btn:hover .bi-share-fill {
    color: var(--text-main) !important;
}

/* Prevent iOS Safari Auto-Zoom on Form Inputs on Mobile */
@media (max-width: 767.98px) {
    input[type="text"],
    input[type="email"],
    input[type="search"],
    input[type="url"],
    textarea,
    select {
        font-size: 16px !important;
    }
}