/* ==========================================================
   My Workout AI  -  BLOG

   Loaded only on /blog and /blog/{slug}.

   An article page has one job: be easy to read on a phone. So the
   column is narrow, the text is bigger than the rest of the site,
   and the line spacing is loose.
   ========================================================== */


/* ==========================================================
   THE LIST PAGE
   ========================================================== */

/* ---------- hero ---------- */
.blog-hero {
    padding: 62px 0 44px;
    text-align: center;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
}

.blog-hero .kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--brand);
    margin-bottom: 14px;
}

.blog-hero h1 {
    font-family: 'Barlow Condensed', Arial, sans-serif;
    font-size: 52px;
    line-height: 1.06;
    max-width: 760px;
    margin: 0 auto 16px;
}

.blog-hero p {
    max-width: 600px;
    margin: 0 auto 28px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.65;
}

.blog-search {
    display: flex;
    max-width: 520px;
    margin: 0 auto;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 6px 6px 22px;
}

.blog-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: none;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
}

.blog-search input:focus {
    outline: none;
}

.blog-search button {
    flex: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.blog-search button:hover {
    background: var(--brand-dark);
}


/* ---------- category chips ---------- */
.cat-strip {
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
}

.cat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.cat {
    padding: 9px 18px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: var(--card);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
}

.cat:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.cat.on {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.cat b {
    opacity: 0.7;
    font-weight: 600;
    margin-left: 3px;
}


/* ---------- the list layout ---------- */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    align-items: start;
}


/* ---------- the newest post ---------- */
.post-latest {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    margin-bottom: 20px;
    transition: border-color 0.2s, transform 0.2s;
}

.post-latest:hover {
    border-color: var(--brand);
    transform: translateY(-3px);
}

.pl-img {
    position: relative;
    min-height: 260px;
    background: var(--bg-soft);
}

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

.latest-tag {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 4px 13px;
    border-radius: 20px;
    background: var(--brand);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.pl-in {
    padding: 30px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pl-meta,
.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 12px;
}

.pl-cat {
    color: var(--brand);
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-size: 11px;
}

.pl-in h2 {
    font-family: 'Barlow Condensed', Arial, sans-serif;
    font-size: 33px;
    line-height: 1.14;
    margin: 0 0 11px;
}

.pl-in p {
    margin: 0 0 18px;
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--muted);
}

.read-more {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand);
}


/* ---------- the grid ---------- */
.post-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.post-grid.three {
    grid-template-columns: repeat(3, 1fr);
}

.post {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s, transform 0.2s;
}

.post:hover {
    border-color: var(--brand);
    transform: translateY(-3px);
}

.post-img {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-soft);
}

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

.post-in {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-in h3 {
    font-family: 'Barlow Condensed', Arial, sans-serif;
    font-size: 22px;
    line-height: 1.2;
    margin: 0 0 9px;
}

.post-in p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--muted);
}

.post-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 16px;
    font-size: 12px;
    color: var(--muted);
}

.post-foot .arrow {
    color: var(--brand);
    font-size: 16px;
}


/* ---------- sidebar ---------- */
.blog-side {
    position: sticky;
    top: 92px;
}

.side-cta {
    background: linear-gradient(140deg, var(--brand), var(--brand-2));
    border-radius: 16px;
    padding: 26px 24px;
    text-align: center;
    color: #fff;
    margin-bottom: 16px;
}

.sc-icon {
    display: block;
    font-size: 28px;
    margin-bottom: 10px;
}

.side-cta b {
    display: block;
    font-family: 'Barlow Condensed', Arial, sans-serif;
    font-size: 23px;
    margin-bottom: 8px;
}

.side-cta p {
    font-size: 13.5px;
    line-height: 1.6;
    margin: 0 0 18px;
    opacity: 0.92;
}

.side-cta .btn-fill {
    background: #fff;
    color: #2b1206;
    box-shadow: none;
}

.side-cta .btn-fill:hover {
    background: #ffeede;
    color: #2b1206;
}

.side-box {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px 24px;
    margin-bottom: 16px;
}

.side-box h3 {
    font-family: 'Barlow Condensed', Arial, sans-serif;
    font-size: 19px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin: 0 0 14px;
}

.side-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.side-list li {
    border-bottom: 1px solid var(--line);
}

.side-list li:last-child {
    border-bottom: 0;
}

.side-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 0;
    font-size: 14px;
    color: var(--muted);
    text-decoration: none;
}

.side-list a:hover,
.side-list a.on {
    color: var(--brand);
}

.side-list b {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.7;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tag-cloud a {
    padding: 6px 12px;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: var(--bg);
    font-size: 12.5px;
    color: var(--muted);
    text-decoration: none;
}

.tag-cloud a:hover {
    border-color: var(--brand);
    color: var(--brand);
}


/* ---------- nothing found ---------- */
.blog-empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--card);
    border: 2px dashed var(--line);
    border-radius: 18px;
}

.blog-empty .big {
    font-size: 42px;
    margin-bottom: 14px;
}

.blog-empty b {
    display: block;
    font-family: 'Barlow Condensed', Arial, sans-serif;
    font-size: 24px;
    margin-bottom: 8px;
}

.blog-empty p {
    color: var(--muted);
    margin: 0;
}


/* ==========================================================
   THE ARTICLE PAGE
   ========================================================== */

.crumb-bar {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    background: var(--bg-soft);
}

.crumb {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    font-size: 13px;
    color: var(--muted);
}

.crumb a {
    color: var(--muted);
    text-decoration: none;
}

.crumb a:hover {
    color: var(--brand);
}

.article-top {
    padding-top: 42px;
}

.container.narrow {
    max-width: 760px;
}

.art-head {
    text-align: center;
    margin-bottom: 30px;
}

.art-meta-top {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 18px;
}

.art-head h1 {
    font-family: 'Barlow Condensed', Arial, sans-serif;
    font-size: 50px;
    line-height: 1.07;
    margin: 0 0 18px;
}

.art-sum {
    font-size: 18px;
    line-height: 1.65;
    color: var(--muted);
    max-width: 640px;
    margin: 0 auto;
}

.art-img {
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 36px;
    aspect-ratio: 16 / 8;
    background: var(--bg-soft);
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

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


/* ---------- on this page ---------- */
.toc {
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 34px;
}

.toc b {
    display: block;
    font-size: 11px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 12px;
}

.toc ol {
    margin: 0;
    padding-left: 20px;
}

.toc li {
    margin-bottom: 7px;
}

.toc a {
    font-size: 14.5px;
    color: var(--text);
    text-decoration: none;
}

.toc a:hover {
    color: var(--brand);
}


/* ---------- the written article ---------- */
.art-body {
    font-size: 17px;
    line-height: 1.8;
}

.art-body p {
    margin: 0 0 22px;
}

.art-body h2 {
    font-family: 'Barlow Condensed', Arial, sans-serif;
    font-size: 33px;
    line-height: 1.15;
    margin: 44px 0 16px;
    scroll-margin-top: 100px;
}

.art-body h3 {
    font-family: 'Barlow Condensed', Arial, sans-serif;
    font-size: 25px;
    margin: 34px 0 13px;
}

.art-body h4 {
    font-size: 17px;
    margin: 26px 0 10px;
}

.art-body ul,
.art-body ol {
    margin: 0 0 24px;
    padding-left: 24px;
}

.art-body li {
    margin-bottom: 10px;
}

.art-body strong {
    color: var(--text);
    font-weight: 700;
}

.art-body a:not(.btn) {
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.art-body a:hover {
    color: var(--brand-dark);
}

.art-body code {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 2px 7px;
    font-family: Consolas, Menlo, monospace;
    font-size: 14.5px;
    color: var(--brand);
}

.art-body blockquote {
    margin: 0 0 24px;
    padding: 4px 0 4px 22px;
    border-left: 3px solid var(--brand);
}

.art-body blockquote p {
    margin: 0;
    font-size: 18px;
    color: var(--muted);
    font-style: italic;
}

.art-body hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 36px 0;
}

.art-body img {
    max-width: 100%;
    border-radius: 12px;
    margin-bottom: 22px;
}

/* a table has to be able to scroll sideways on a phone */
.art-body .table-wrap {
    overflow-x: auto;
    margin-bottom: 26px;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.art-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    min-width: 440px;
}

.art-body th,
.art-body td {
    text-align: left;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
}

.art-body tr:last-child td {
    border-bottom: 0;
}

.art-body th {
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--card);
}


/* ---------- tags ---------- */
.art-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-top: 30px;
    margin-top: 12px;
    border-top: 1px solid var(--line);
}

.tag-label {
    font-size: 11px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--muted);
    margin-right: 4px;
}

.art-tags a {
    padding: 6px 13px;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: var(--card);
    font-size: 12.5px;
    color: var(--muted);
    text-decoration: none;
}

.art-tags a:hover {
    border-color: var(--brand);
    color: var(--brand);
}


/* ---------- copy link, back, author ---------- */
.art-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.art-author {
    margin-left: auto;
    font-size: 13px;
    color: var(--muted);
}


/* ---------- the box at the end ---------- */
.art-cta {
    margin: 40px 0 10px;
    padding: 36px 32px;
    border-radius: 18px;
    border: 2px dashed var(--line);
    text-align: center;
}

.art-cta h3 {
    font-family: 'Barlow Condensed', Arial, sans-serif;
    font-size: 29px;
    margin: 0 0 10px;
}

.art-cta p {
    color: var(--muted);
    max-width: 440px;
    margin: 0 auto 24px;
    font-size: 15px;
    line-height: 1.65;
}


/* ==========================================================
   SMALLER SCREENS
   ========================================================== */
@media (max-width: 1000px) {

    .blog-layout {
        grid-template-columns: 1fr;
    }

    .blog-side {
        position: static;
    }

    .post-grid.three {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 820px) {

    .blog-hero h1 {
        font-size: 38px;
    }

    .post-latest {
        grid-template-columns: 1fr;
    }

    .pl-img {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .pl-in {
        padding: 24px 22px;
    }

    .pl-in h2 {
        font-size: 26px;
    }

    .art-head h1 {
        font-size: 35px;
    }

    .art-sum {
        font-size: 16px;
    }
}

@media (max-width: 620px) {

    .blog-hero {
        padding: 44px 0 34px;
    }

    .blog-hero h1 {
        font-size: 31px;
    }

    .cat-row {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .cat {
        white-space: nowrap;
    }

    .post-grid,
    .post-grid.three {
        grid-template-columns: 1fr;
    }

    .art-body {
        font-size: 16px;
    }

    .art-body h2 {
        font-size: 27px;
        margin-top: 34px;
    }

    .art-body h3 {
        font-size: 22px;
    }

    .art-cta {
        padding: 28px 20px;
    }

    .art-author {
        margin-left: 0;
        width: 100%;
    }
}
