@import url('https://fonts.googleapis.com/css?family=Droid+Sans+Mono');

:root {
    --primary: #0f172a;
    --secondary: #475569;
    --accent: #2563eb;
    --bg: #ffffff;
    --surface: #f8fafc;
    --border: #e2e8f0;
    --radius-lg: 1rem;
    --radius-md: 0.75rem;
    --radius-sm: 0.375rem;
    --nav-height: 54px;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--primary);
    background-color: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* WCAG Focus States */
*:focus-visible {
    outline: 3px solid var(--accent) !important;
    outline-offset: 2px !important;
}

/* Custom Thin Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.serif {
    font-family: 'Playfair Display', serif;
}

/* Feature Header */
.featured-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 0 0 4rem 4rem;
}

.featured-image-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(15, 23, 42, 0.4) 0%, transparent 50%);
    z-index: 1;
    border-radius: inherit;
}

/* Post Cards */
/* Post List Style - Modern Card-based List */
.post-list-item {
    display: grid !important;
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
    padding: 1.75rem;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 20px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.post-list-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    border-color: #e2e8f0;
}

.post-thumbnail-wrapper {
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
}

.post-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-list-item:hover .post-thumbnail {
    transform: scale(1.05);
}

.post-thumbnail-wrapper {
    width: 100%;
}

.post-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 8px;
}

.post-content-column {
    display: flex;
    flex-direction: column;
}

.post-excerpt-list {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--secondary);
    font-size: 0.95rem;
    margin-bottom: 0;
}

@media (max-width: 991px) {
    .post-list-item {
        grid-template-columns: 220px 1fr;
        gap: 1.5rem;
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    .post-list-item {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding: 1.25rem;
    }
}

.category-pill {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f1f5f9;
    color: #64748b;
    padding: 0.35rem 0.85rem;
    border-radius: 100px;
    transition: all 0.3s ease;
}

.post-list-item:hover .category-pill {
    background: #e2e8f0;
    color: var(--primary);
}

.pinned-badge {
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-weight: 700;
}

/* Affiliate Table Customization */
.affiliate-comparison table {
    border-collapse: separate;
    border-spacing: 0;
}

.affiliate-comparison th {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--secondary);
}

/* Chrome Promo */
.chrome-promo {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(37, 99, 235, 0.1) 100%);
}

/* Email Capture */
.email-capture-box {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.email-capture-box:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

/* Pagination Custom Circles */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    padding-left: 0;
    margin: 0;
    list-style: none;
}

.pagination .page-item {
    margin: 0;
}

.pagination .page-link {
    min-width: 45px;
    height: 45px;
    margin: 0;
    padding: 0 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 600;
    white-space: nowrap;
}

.pagination .page-link {
    box-sizing: border-box;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary);
    color: white;
}

@media (max-width: 768px) {
    .pagination {
        gap: 0.35rem;
    }

    .pagination .page-link {
        min-width: 38px;
        height: 38px;
        padding: 0 0.75rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    .pagination {
        justify-content: center;
        gap: 0.25rem;
    }

    .pagination .page-link {
        min-width: 34px;
        height: 34px;
        padding: 0 0.6rem;
        font-size: 0.9rem;
    }
}

/* Tools Page Items */
.tool-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.tool-card:hover {
    border-color: var(--accent);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Navbar styles - Ultra Solid & Minimal Header */
.navbar {
    height: var(--nav-height);
    background: #ffffff !important;
    border-bottom: 1px solid #f1f5f9;
    z-index: 2000;
}

.nav-link {
    font-size: 0.9rem;
    color: var(--primary) !important;
    height: var(--nav-height);
    display: flex;
    align-items: center;
}

/* Custom Hamburger Animation */
.hamburger {
    width: 22px;
    height: 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--primary) !important;
    border-radius: 4px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.navbar-toggler[aria-expanded="true"] .hamburger span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.navbar-toggler[aria-expanded="true"] .hamburger span:nth-child(2) {
    transform: scaleX(0);
}

.navbar-toggler[aria-expanded="true"] .hamburger span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Compact & Premium Mobile Menu Dropdown */
@media (max-width: 991.98px) {
    .navbar-collapse {
        position: absolute !important;
        top: var(--nav-height) !important;
        left: 1rem !important;
        right: 1rem !important;
        width: calc(100% - 2rem) !important;
        max-width: 400px !important;
        margin-left: auto !important;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(10px);
        border: 1px solid var(--border) !important;
        border-radius: 1.5rem !important;
        padding: 1.5rem !important;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
        z-index: 1000 !important;
        display: block !important;
        opacity: 0 !important;
        transform: translateY(-10px) scale(0.95) !important;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
        pointer-events: none !important;
        overflow: hidden !important;
    }

    .navbar-collapse.show {
        opacity: 1 !important;
        transform: translateY(12px) scale(1) !important;
        pointer-events: auto !important;
    }

    .navbar-nav {
        flex-direction: column !important;
        gap: 0.25rem !important;
        align-items: stretch !important;
    }

    .nav-link {
        height: auto !important;
        padding: 0.6rem 1rem !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        color: var(--primary) !important;
        border-radius: 0.75rem !important;
        margin: 0 !important;
    }

    .nav-link:hover {
        background: var(--surface) !important;
        color: var(--accent) !important;
    }

    .nav-link::after {
        display: none !important;
    }

    /* Modern CTA for Mobile */
    .navbar-nav .btn {
        margin-top: 1rem !important;
        padding: 0.8rem !important;
        width: 100% !important;
        display: block !important;
        text-align: center !important;
    }

    /* Remove backdrop entirely */
    body.show-nav::after {
        display: none !important;
    }

    body.show-nav {
        overflow: auto !important;
        /* Allow scroll if menu is small */
    }
}

/* Ensure the toggler is visible if it was hidden by Bootstrap's mobile default */
@media (max-width: 991.98px) {
    .navbar-toggler {
        display: block !important;
    }
}

/* Footer & Newsletter Adjustments */
.hover-primary:hover {
    color: var(--accent) !important;
}

.ls-1 {
    letter-spacing: 0.1em;
}

.newsletter-group {
    border-color: var(--border) !important;
    background: white;
}

.newsletter-group input::placeholder {
    color: var(--secondary);
    opacity: 0.5;
}

/* Fallback Image Placeholder */
.img-placeholder {
    background: #f1f5f9;
    background-image: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    position: relative;
}

.img-placeholder::after {
    content: 'IMAGE PENDING';
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.navbar-toggler:focus {
    box-shadow: none !important;
}

.nav-link {
    font-weight: 500;
    color: var(--primary) !important;
    margin: 0 0.5rem;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10px;
    right: 10px;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-link:hover::after {
    transform: scaleX(1);
}

/* Post Content & Readability Optimized for Wider Layouts */
.post-body {
    color: #1e293b;
}

.post-body p,
.content-area p,
.privacy-content p,
.terms-content p,
.disclaimer-content p {
    margin-bottom: 2rem;
    font-size: clamp(1.1rem, 1.05rem + 0.25vw, 1.25rem);
    line-height: 1.7;
    color: #334155;
    text-align: justify;
}

.post-body h2 {
    font-size: clamp(1.8rem, 1.5rem + 1vw, 2.8rem);
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-weight: 800;
}

.post-body h3 {
    font-size: clamp(1.4rem, 1.2rem + 0.5vw, 2rem);
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
    color: var(--primary);
    font-weight: 700;
}

.post-body img {
    border-radius: 0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    margin: 1rem 0;
    max-width: 100%;
    height: auto;
}

.post-body blockquote {
    border-left: 5px solid var(--accent);
    padding: 2rem 2.5rem;
    background: #f8fafc;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 3.5rem 0;
    font-style: italic;
    color: #475569;
}

.post-body blockquote p {
    margin-bottom: 0px;
    font-size: 1.4rem;
}

.post-body ul,
.post-body ol {
    margin-bottom: 2.5rem;
    padding-left: 1.5rem;
}

.post-body li {
    font-size: 1.15rem;
    margin-bottom: 1rem;
    color: #334155;
}

@media (min-width: 768px) {
    .post-body table {
        display: table;
        overflow-x: unset;
    }
}

/* Ensure images in post body are not too constrained */
@media (min-width: 1200px) {
    .post-post .container {
        max-width: 1200px;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .featured-header {
        border-radius: 0 0 2rem 2rem;
    }
}

/* Custom styling for the line numbers */
.hljs-ln-numbers {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    text-align: center;
    color: #ccc;
    border-right: 1px solid #ccc;
    vertical-align: top;
    padding-right: 8px !important;
}

.hljs-ln-code {
    padding-left: 10px !important;
}

pre code.hljs {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px !important;
    background-color: #fdfeff !important;
    /* Slightly distinct background */
}

.gist .gist-file {
  margin-bottom: 0;
}

.gist .blob-wrapper {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
}

.gist .highlight {
  background-color: #fdfeff !important;
  font-family: 'Droid Sans Mono', monospace !important;
  font-size: 14px !important;
  padding-top: 15px !important;
}

.gist .highlight td {
  padding: 5px 15px !important;
  line-height: 1;
  font-family: inherit;
  font-size: inherit !important;
}

.gist tr:first-child td {
  padding-top: 15px !important;
}

.gist tr:last-child td {
  padding-bottom: 15px !important;
}

.gist .blob-num {
  pointer-events: none;
  padding: 15px !important;
  border-right: 1px solid var(--border) !important;
}

.gist .gist-meta {
  display: none;
}

/* Social Icons */
.social-icon img {
    transition: transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
    opacity: 0.6;
}

.social-icon:hover img {
    transform: translateY(-3px);
    opacity: 1;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* ── Related Posts Cards ─────────────────────────────────────────────── */
.related-post-card {
    border-radius: 1rem !important;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.related-post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px -8px rgba(15, 23, 42, 0.14), 0 4px 8px rgba(15, 23, 42, 0.06);
}

.related-card-img-link {
    display: block;
    overflow: hidden;
}

.related-card-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.related-card-category {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: rgba(37, 99, 235, 0.08);
    padding: 0.25rem 0.65rem;
    border-radius: 100px;
}

.related-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-card-readmore {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    transition: gap 0.2s ease, opacity 0.2s ease;
    opacity: 0.8;
}

.related-card-readmore:hover {
    gap: 0.55rem;
    opacity: 1;
    color: var(--accent);
}

/* Remove blue border on search input focus */
#search-input:focus {
    box-shadow: none !important;
   /* border-color: var(--bs-dark) !important; */
}