/* =========================================
   HERO SECTION
========================================= */

.hero {
    position: relative;
    padding: 160px 0 60px;
    overflow: hidden;
    background: #fafafa;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 0, 0, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, .04) 1px, transparent 1px);
    background-size: 48px 48px;
}

.hero-light {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 101, 0, .16), transparent 70%);
    pointer-events: none;
}

.energy-line {
    position: absolute;
    height: 1px;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 101, 0, .35), transparent);
}

.energy-line.one {
    top: 28%;
}

.energy-line.two {
    bottom: 18%;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: "DM Mono", monospace;
    font-size: .62rem;
    letter-spacing: .14em;
    color: var(--orange);
    margin-bottom: 18px;
}

.kicker-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--orange);
}

.hero h1 {
    font-size: clamp(2.6rem, 6vw, 4.6rem);
    line-height: .95;
}

.hero .orange {
    color: var(--orange);
}

.hero-description {
    max-width: 560px;
    color: #707070;
    margin-top: 18px;
    line-height: 1.8;
}


/* =========================================
   BLOG SEARCH
========================================= */

.blog-search {
    margin-top: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 560px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 999px;
    padding: 6px 6px 6px 16px;
}

.blog-search input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    min-width: 0;
}

.blog-search button {
    border: 0;
    background: var(--orange);
    color: #fff;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 12px;
}

.blog-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.blog-cats a {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, .1);
    color: #444;
    font-size: 12px;
    font-weight: 600;
    background: #fff;
}

.blog-cats a.on {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
}


/* =========================================
   BLOG GRID AND CARDS
========================================= */

.blog-grid-wrap {
    padding: 10px 0 110px;
    background: #fff;
}

.blog-card {
    position: relative;
    display: block;
    height: 360px;
    border-radius: 24px;
    overflow: hidden;
    color: #fff;
    background: #161616;
}

.blog-card:hover {
    color: #fff;
}

.blog-cover,
.blog-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-cover {
    background: #1a1a1a;
}

.blog-glass {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 16px 16px 14px;
    border-radius: 16px;
    background: rgba(12, 12, 12, .42);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, .14);
}

.blog-meta {
    font-family: "DM Mono", monospace;
    font-size: 10px;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, .72);
    margin-bottom: 6px;
}

.blog-glass h3 {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.2;
    color: #fff;
}

.blog-glass p {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, .86);
    font-size: .88rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* =========================================
   ARTICLE HERO
========================================= */

.article-hero {
    position: relative;
    min-height: 420px;
    padding: 150px 0 50px;
    overflow: hidden;
    background: #111;
    color: #fff;
}

.article-hero-bg {
    position: absolute;
    inset: 0;
}

.article-hero-bg img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-hero-bg:after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(9, 9, 9, .35),
        rgba(9, 9, 9, .55)
    );
}

.article-hero-panel {
    max-width: 760px;
    margin-top: 8px;
    padding: 22px 24px;
    border-radius: 20px;
    background: rgba(12, 12, 12, .46);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, .14);
}

.article-hero-panel h1 {
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    line-height: 1;
    margin: 0;
    color: #fff;
}

.article-excerpt {
    margin: 14px 0 0;
    color: rgba(255, 255, 255, .88);
    line-height: 1.7;
}

.article-byline {
    margin: 14px 0 0;
    font-family: "DM Mono", monospace;
    font-size: 11px;
    letter-spacing: .06em;
    color: rgba(255, 255, 255, .7);
}


/* =========================================
   ARTICLE CONTENT
========================================= */

.article-wrap {
    padding: 40px 0 110px;
    background: #fff;
}

.article-body {
    width: 100%;
    min-width: 0;
    font-size: 1.05rem;
    line-height: 1.85;
    color: #222;
    overflow-wrap: break-word;
}

.article-body h2,
.article-body h3 {
    margin-top: 1.6em;
}

.article-body p {
    max-width: 100%;
    margin-top: 0;
    margin-bottom: 1.25em;
}

.article-body h2 {
    font-size: clamp(1.6rem, 3vw, 2rem);
    line-height: 1.3;
    margin-bottom: .7em;
}

.article-body h3 {
    font-size: clamp(1.3rem, 2.5vw, 1.55rem);
    line-height: 1.4;
    margin-bottom: .6em;
}


/* =========================================
   ARTICLE IMAGE FIX
========================================= */

/*
 * Article images preserve their original
 * uploaded aspect ratio.
 *
 * They can shrink to fit the article column,
 * but they are NEVER stretched to fill it.
 */

.article-body img {
    display: block !important;

    /* IMPORTANT:
       Do NOT force article images to 100% width.
       Let the browser calculate the natural width
       from the uploaded image dimensions.
    */
    width: auto !important;
    height: auto !important;
    inline-size: auto !important;
    block-size: auto !important;

    /* Image may shrink, but can never overflow
       the article content area.
    */
    max-width: 100% !important;
    max-height: none !important;
    max-inline-size: 100% !important;
    max-block-size: none !important;

    min-width: 0 !important;
    min-height: 0 !important;

    aspect-ratio: auto !important;

    /* No cropping or stretching */
    object-fit: contain !important;
    object-position: center !important;

    margin: 28px auto !important;

    border: 0;
    border-radius: 14px;
    box-sizing: border-box !important;

    vertical-align: middle;
}


/*
 * Images with width/height attributes inserted
 * by the editor.
 *
 * Ignore those CSS dimensions and allow the
 * browser to use the image's intrinsic ratio.
 */
.article-body img[width],
.article-body img[height],
.article-body img[width][height] {
    width: auto !important;
    height: auto !important;
    inline-size: auto !important;
    block-size: auto !important;

    max-width: 100% !important;
    max-height: none !important;
    max-inline-size: 100% !important;
    max-block-size: none !important;

    min-width: 0 !important;
    min-height: 0 !important;

    aspect-ratio: auto !important;
    object-fit: contain !important;
}


/*
 * Normalize editor-generated wrappers around images.
 *
 * The wrapper must NOT force the image itself
 * to become 100% wide.
 */
.article-body p > em:has(> img),
.article-body p > strong:has(> img),
.article-body p > a:has(> img) {
    display: block !important;

    width: auto !important;
    max-width: 100% !important;

    height: auto !important;

    margin: 0 !important;
    padding: 0 !important;

    line-height: 0 !important;
    font-size: 0 !important;
}


/*
 * Images nested inside editor formatting elements.
 */
.article-body em img,
.article-body strong img,
.article-body a img {
    display: block !important;

    width: auto !important;
    height: auto !important;
    inline-size: auto !important;
    block-size: auto !important;

    max-width: 100% !important;
    max-height: none !important;
    max-inline-size: 100% !important;
    max-block-size: none !important;

    min-width: 0 !important;
    min-height: 0 !important;

    aspect-ratio: auto !important;
    object-fit: contain !important;
}


/*
 * Prevent article content from overflowing.
 */
.article-body,
.article-body p,
.article-body em,
.article-body strong,
.article-body a {
    min-width: 0;
    max-width: 100%;
}


/*
 * FINAL ARTICLE IMAGE SIZING SAFETY RULE
 *
 * Some frameworks/themes can set logical image dimensions
 * (inline-size/block-size) even when width/height are auto.
 * Explicitly reset both forms here.
 */
.article-body img,
.article-body img[width],
.article-body img[height],
.article-body img[width][height] {
    width: auto !important;
    height: auto !important;
    inline-size: auto !important;
    block-size: auto !important;

    max-width: 100% !important;
    max-height: none !important;
    max-inline-size: 100% !important;
    max-block-size: none !important;

    min-width: 0 !important;
    min-height: 0 !important;
    min-inline-size: 0 !important;
    min-block-size: 0 !important;

    aspect-ratio: auto !important;
    object-fit: contain !important;
}


/* =========================================
   ARTICLE LISTS
========================================= */

.article-body ul,
.article-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5em;
}

.article-body li {
    margin-bottom: .45em;
}


/* =========================================
   ARTICLE LINKS
========================================= */

.article-body a {
    color: var(--orange);
}


/* =========================================
   ARTICLE BLOCKQUOTES
========================================= */

.article-body blockquote {
    margin: 28px 0;
    padding: 16px 22px;
    border-left: 4px solid var(--orange);
    background: #fafafa;
    color: #555;
    border-radius: 0 12px 12px 0;
}


/* =========================================
   ARTICLE TABLES
========================================= */

.article-body table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.article-body th,
.article-body td {
    padding: 10px 12px;
    border: 1px solid #e5e5e5;
    text-align: left;
}

.article-body th {
    background: #f7f7f7;
}


/* =========================================
   ARTICLE VIDEO AND IFRAME EMBEDS
========================================= */

.article-body iframe,
.article-body video {
    display: block;
    max-width: 100%;
    margin: 28px auto;
    border-radius: 14px;
}

.article-body iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
}

.article-body video {
    width: 100%;
    height: auto;
}


/* =========================================
   ADVERTISEMENTS AND ARTICLE TAGS
========================================= */

.ad-wrap {
    margin: 28px 0;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
}

.article-tags span {
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    color: #666;
}


/* =========================================
   RELATED ARTICLES
========================================= */

.article-lists {
    margin-top: 48px;
    display: grid;
    gap: 28px;
}

.article-list-label {
    font-family: "DM Mono", monospace;
    font-size: 11px;
    letter-spacing: .14em;
    color: var(--orange);
    margin-bottom: 14px;
}

.article-mini-grid {
    display: grid;
    gap: 10px;
}

.article-mini {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 8px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, .08);
    color: inherit;
    background: #fff;
}

.article-mini:hover {
    color: inherit;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .06);
}

.article-mini-thumb {
    width: 72px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    background: #111;
}

.article-mini-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-mini strong {
    display: block;
    font-size: .92rem;
    line-height: 1.25;
}

.article-mini span {
    display: block;
    margin-top: 4px;
    color: #888;
    font-size: 11px;
}


/* =========================================
   RESPONSIVE DESIGN
========================================= */

@media (max-width: 767px) {

    .article-wrap {
        padding: 30px 0 80px;
    }

    .article-body {
        font-size: 1rem;
        line-height: 1.8;
    }

    /*
     * MOBILE ARTICLE IMAGES
     *
     * Keep their natural aspect ratio.
     * Only shrink them when necessary to fit
     * the available screen width.
     */
    .article-body img,
    .article-body img[width],
    .article-body img[height],
    .article-body img[width][height],
    .article-body p > em > img,
    .article-body p > strong > img,
    .article-body p > a > img {
        display: block !important;

        width: auto !important;
        height: auto !important;

        max-width: 100% !important;
        max-height: none !important;

        min-width: 0 !important;
        min-height: 0 !important;

        aspect-ratio: auto !important;
        object-fit: contain !important;

        margin: 22px auto !important;

        border-radius: 10px;
    }

    .article-body table {
        display: block;
        overflow-x: auto;
    }
}


@media (max-width: 575px) {

    .hero,
    .article-hero {
        padding-top: 130px;
    }

    .blog-card {
        height: 320px;
    }

    .article-hero {
        min-height: 360px;
        padding-bottom: 35px;
    }

    .article-hero-panel {
        padding: 18px;
        border-radius: 16px;
    }

    /*
     * SMALL-SCREEN ARTICLE IMAGES
     *
     * Never force width: 100%.
     * Preserve the uploaded image ratio.
     */
    .article-body img,
    .article-body img[width],
    .article-body img[height],
    .article-body img[width][height],
    .article-body p > em > img,
    .article-body p > strong > img,
    .article-body p > a > img {
        display: block !important;

        width: auto !important;
        height: auto !important;

        max-width: 100% !important;
        max-height: none !important;

        min-width: 0 !important;
        min-height: 0 !important;

        aspect-ratio: auto !important;
        object-fit: contain !important;

        margin: 20px auto !important;

        border-radius: 10px;
    }

    .article-body blockquote {
        padding: 14px 16px;
    }

    .article-mini {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .article-mini-thumb {
        width: 64px;
        height: 52px;
    }
}