/* =========================================================
   Aganta Foundry — Blog CSS (Hugo)
   Tailwind parity + matched design system
   ========================================================= */

/* -------------------------
   Root tokens (shared)
   ------------------------- */
:root {
    --bg-dark: #171717;
    --panel: #0f0f0f;
    --aganta-white: #ffffff;
    --muted: #f3f4f6;
    --neon-green: #9cff00;
    --aganta-purple: #b700ff;
}

/* -------------------------
   Base
   ------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body.blog {
    background-color: var(--bg-dark);
    color: var(--aganta-white);
    margin: 0;
    font-family:
        "Bricolage Grotesque",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
}

/* -------------------------
   Layout
   ------------------------- */
.blog-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

/* -------------------------
   Typography
   ------------------------- */
.blog h1 {
    font-size: clamp(2.4rem, 5vw, 3rem);
    margin-bottom: 2rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.blog h2 {
    margin-top: 3.5rem;
    margin-bottom: 1.25rem;
    font-size: 1.6rem;
}

.blog h3 {
    margin-top: 2.5rem;
    font-size: 1.25rem;
}

.blog p {
    margin-top: 1.25rem;
    line-height: 1.65;
    color: var(--muted);
}

/* -------------------------
   Links
   ------------------------- */
.blog a {
    color: var(--neon-green);
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 2px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.2s ease;
}

.blog a:hover {
    background-size: 100% 2px;
}

/* -------------------------
   Lists
   ------------------------- */
.blog ul,
.blog ol {
    margin-top: 1.5rem;
    padding-left: 1.25rem;
    color: var(--muted);
}

.blog li {
    margin-top: 0.5rem;
}

/* -------------------------
   Code blocks
   ------------------------- */
.blog pre {
    background-color: var(--panel);
    padding: 1.25rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin-top: 2rem;
    font-size: 0.9rem;
}

.blog code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* -------------------------
   Blog list
   ------------------------- */
.post-list {
    list-style: none;
    padding: 0;
    margin-top: 3rem;
}

.post-list li {
    margin-bottom: 1.5rem;
}

.post-list a {
    display: block;
    padding: 1.25rem;
    border-radius: 0.75rem;
    background-color: var(--panel);
    transition:
        transform 0.15s ease,
        box-shadow 0.2s ease;
}

.post-list a:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* =========================================================
   NAV (Tailwind → CSS parity)
   ========================================================= */

.blog .header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.blog .logo-link {
    display: inline-block;
    flex-shrink: 0;
}

.blog .logo {
    height: 40px;
    width: auto;
    max-width: 180px;
    display: block;
    object-fit: contain;
    opacity: 0.9;
}

.blog .nav {
    display: none;
    gap: 2rem;
    align-items: center;
    font-size: 0.875rem;
}

.blog .nav a {
    color: #d1d5db;
}

.blog .nav a:hover {
    color: #ffffff;
}

/* CTA */
.blog .cta {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    color: #ffffff;
    background: transparent;
    border: 1px solid #4b5563;
    transition:
        transform 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.blog .cta:hover {
    transform: translateY(-2px);
    background-color: var(--aganta-purple);
    border-color: var(--aganta-purple);
}

/* Desktop nav */
@media (min-width: 768px) {
    .blog .nav {
        display: flex;
    }
}

/* =========================================================
   FOOTER (Tailwind → CSS parity)
   ========================================================= */

.blog .site-footer {
    margin-top: 6rem;
}

/* Top */
.blog .footer-top {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.blog .footer-brand {
    max-width: 360px;
}

.blog .footer-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.blog .footer-tagline {
    margin-top: 0.5rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.blog .footer-email {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.blog .footer-email a {
    color: var(--neon-green);
}

/* Links */
.blog .footer-links {
    display: flex;
    gap: 3rem;
}

.blog .footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog .footer-heading {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.blog .footer-column li {
    margin-bottom: 0.5rem;
}

.blog .footer-column a {
    font-size: 0.9rem;
    color: var(--muted);
}

.blog .footer-column a:hover {
    text-decoration: underline;
}

/* Desktop footer */
@media (min-width: 768px) {
    .blog .footer-top {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
}

/* Bottom */
.blog .footer-bottom {
    border-top: 1px solid #111827;
    margin-top: 2rem;
}

.blog .footer-bottom-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #6b7280;
}

/* -------------------------
   Responsive
   ------------------------- */
@media (max-width: 768px) {
    .blog-wrapper {
        padding: 3rem 1.25rem;
    }
}

/* =========================================================
   Blog Cards (Image + Title + Description)
   ========================================================= */

.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 3rem;
}

@media (min-width: 768px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.blog-card {
    background-color: var(--panel);
    border-radius: 1rem;
    overflow: hidden;
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.blog-card-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blog-card-content {
    padding: 1.25rem 1.5rem 1.5rem;
}

/*.blog-card-title {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.3;
    color: var(--neon-green);
}*/

.blog-card-description {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--muted);
}

/* =========================================================
   FEATURED EDITORIAL LAYOUT
   ========================================================= */

.blog-featured {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
    margin-bottom: 4rem;
}

/* Main featured */
.featured-main {
    display: block;
}

.featured-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 1rem;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.featured-text {
    margin-top: 1.25rem;
    max-width: 56ch;
}

/* Side column */
.featured-side {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.featured-card {
    background-color: var(--panel);
    border-radius: 1rem;
    overflow: hidden;
}

.featured-card-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.featured-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.featured-card-content {
    padding: 1rem 1.25rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .blog-featured {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Articles header
   ========================================================= */

.blog-header {
    margin-bottom: 3rem;
    max-width: 48ch;
    padding: 0 1.25rem; /* mobile safety */
}

.blog-header h1 {
    margin: 0;
    font-size: clamp(2.5rem, 4vw, 3rem);
    line-height: 1.1;
}

.blog-intro {
    margin-top: 0.75rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--aganta-white);
}

/* =========================================================
   Article width + spacing (FIXED)
   ========================================================= */

.blog-article {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 1.25rem; /* THIS fixes mobile edge-to-edge */
}

/* =========================================================
   Full-width images (desktop editorial)
   ========================================================= */

.blog-articleimage .full-width {
    max-width: 1200px;
    margin-left: calc(50% - 600px);
    margin-right: calc(50% - 600px);
}

/* =========================================================
   Image handling
   ========================================================= */

.blog-article img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Image size utilities */
.img-sm {
    max-width: 360px;
}
.img-md {
    max-width: 500px;
}
.img-lg {
    max-width: 760px;
}
.img-xl {
    max-width: 1200px;
}

/* =========================================================
   Mobile overrides (CRITICAL)
   ========================================================= */

@media (max-width: 768px) {
    .blog-header {
        padding: 0 1.25rem;
    }

    .blog-article {
        padding: 0 1.25rem;
    }

    /* Disable full-bleed on mobile */
    .blog-articleimage .full-width {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

/*table*/

.blog-article table {
    width: 100%;
    max-width: 760px;
    margin: 2.5rem auto;
    border-collapse: collapse;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Header */
.blog-article thead th {
    text-align: left;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* Body cells */
.blog-article tbody td {
    padding: 0.75rem 1rem;
    vertical-align: top;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Row separation */
.blog-article tbody tr:last-child td {
    border-bottom: none;
}

/* Optional: subtle row hover */
.blog-article tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.blog-article th:not(:last-child),
.blog-article td:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

/*Text color override*/
.blog strong,
.blog em {
    color: var(--aganta-white);
}

.blog .blog-article > p:first-of-type {
    color: var(--aganta-white);
}

/* =========================================================
   Post eyebrow + title styling (FIXED & CLEAN)
   ========================================================= */

/* Eyebrow (Design Systems) → GREEN */
.blog .post-eyebrow {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--aganta-purple);
}

/* Post titles → PURPLE */
.blog .post-title {
    color: var(--neon-green);
}

/* Base link styling */
.blog a {
    color: var(--neon-green);
    text-decoration: none;
}

/* Title underline system */
.blog .post-title {
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 2px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.2s ease;
}

/* Hover triggers underline on title */
.blog a:hover .post-title {
    background-size: 100% 2px;
}

/* =========================================================
   Related Articles (Scoped)
   ========================================================= */

/* Divider line */
.related-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4rem 0 2.5rem;
}

/* Section heading */
.related-heading {
    font-size: 1.4rem;
    margin-bottom: 2rem;
    letter-spacing: -0.01em;
}

/* Grid (keeps existing layout if already defined) */
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}

/* Card */
.related-card {
    background: transparent;
}

/* Smaller thumbnail */
.related-image {
    aspect-ratio: 16 / 9;
    max-height: 120px;
    overflow: hidden;
    border-radius: 0.5rem;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Content tightening */
.related-content h3 {
    font-size: 0.95rem;
    line-height: 1.35;
    margin-top: 0.5rem;
}

.related-content p {
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--muted);
}

/*highlight*/
.blog mark {
    background: rgba(156, 255, 0, 0.25); /* neon green glow */
    color: var(--aganta-white);
    padding: 0.05em 0.2em;
    border-radius: 0.2em;
}

/* ===============================
   MOBILE SAFETY FIX (FINAL)
   =============================== */

@media (max-width: 768px) {
    .blog-article,
    .blog-header {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .blog-articleimage .full-width {
        margin-left: 0;
        margin-right: 0;
        max-width: 100%;
    }
}

/* ===============================
   FOOTER COLOR OVERRIDE (DEEP BLACK)
   =============================== */

.blog .site-footer {
    background-color: #0b0b0b;
}

.blog .footer-bottom {
    border-top: 1px solid #111;
}
