/*
 Theme Name:   Junior Doctor Feed
 Theme URI:    https://juniordoctor.au
 Description:  Feed-first theme for juniordoctor.au. A creator-style profile front page with tabs for Medicine, Money, Tools and Cases, and an endless feed of posts.
 Author:       The Junior Doctor
 Author URI:   https://juniordoctor.au
 Version:      3.0.0
 Requires at least: 6.0
 Requires PHP: 7.4
 License:      GNU General Public License v2 or later
 License URI:  https://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  juniordoctor
*/

/* ========== Tokens ========== */
:root {
    --jd-pink: #FF9999;
    --jd-pink-strong: #F0606B;
    --jd-pink-soft: #FFF0F0;
    --jd-ink: #2D3436;
    --jd-ink-soft: #5F6B6E;
    --jd-ink-faint: #8A9598;
    --jd-bg: #FAFAFA;
    --jd-surface: #FFFFFF;
    --jd-line: #ECECEC;

    --jd-medicine: #2E86C8;
    --jd-medicine-deep: #173F73;
    --jd-money: #1E9E55;
    --jd-money-deep: #0B5E3A;
    --jd-tools: #D35400;
    --jd-tools-deep: #9C3D00;
    --jd-cases: #D9443A;
    --jd-cases-deep: #7D231C;

    --jd-accent: var(--jd-pink-strong);
    --jd-accent-deep: #C9414D;

    --jd-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --jd-display: 'Bricolage Grotesque', 'Inter', -apple-system, 'Segoe UI', sans-serif;

    --jd-radius: 16px;
    --jd-radius-sm: 10px;
    --jd-shadow: 0 1px 2px rgba(45, 52, 54, .06), 0 4px 16px rgba(45, 52, 54, .06);
    --jd-shadow-lift: 0 2px 4px rgba(45, 52, 54, .08), 0 12px 32px rgba(45, 52, 54, .12);
    --jd-top-h: 60px;
    --jd-tabs-h: 48px;
}

.jd-card--medicine, .jd-collection--medicine, .jd-hero--medicine, .jd-tab--medicine, .jd-pillar-medicine .jd-article { --jd-accent: var(--jd-medicine); --jd-accent-deep: var(--jd-medicine-deep); }
.jd-card--money, .jd-collection--money, .jd-hero--money, .jd-tab--money, .jd-pillar-money .jd-article { --jd-accent: var(--jd-money); --jd-accent-deep: var(--jd-money-deep); }
.jd-card--tools, .jd-collection--tools, .jd-hero--tools, .jd-tab--tools, .jd-pillar-tools .jd-article { --jd-accent: var(--jd-tools); --jd-accent-deep: var(--jd-tools-deep); }
.jd-card--cases, .jd-collection--cases, .jd-hero--cases, .jd-tab--cases, .jd-pillar-cases .jd-article { --jd-accent: var(--jd-cases); --jd-accent-deep: var(--jd-cases-deep); }

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--jd-top-h) + var(--jd-tabs-h) + 16px); }

body {
    margin: 0;
    background: var(--jd-bg);
    color: var(--jd-ink);
    font-family: var(--jd-font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--jd-display); color: var(--jd-ink); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: var(--jd-accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

:focus-visible { outline: 3px solid var(--jd-ink); outline-offset: 2px; border-radius: 4px; }

.screen-reader-text {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
    position: fixed; top: 8px; left: 8px; z-index: 2000; width: auto; height: auto; margin: 0;
    padding: 10px 16px; clip: auto; background: var(--jd-ink); color: #fff; border-radius: 8px;
}

.jd-wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.jd-icon { width: 1.25em; height: 1.25em; flex: none; }

/* ========== Buttons, chips ========== */
.jd-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; border-radius: 999px; border: 1.5px solid transparent;
    font: 600 15px/1.2 var(--jd-font); text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.jd-btn:hover { text-decoration: none; transform: translateY(-1px); }
.jd-btn--primary { background: var(--jd-ink); color: #fff; }
.jd-btn--primary:hover { background: #000; color: #fff; box-shadow: var(--jd-shadow); }
.jd-btn--ghost { background: transparent; color: var(--jd-ink); border-color: #D5D9DA; }
.jd-btn--ghost:hover { background: #fff; border-color: var(--jd-ink); color: var(--jd-ink); }
.jd-btn--small { padding: 9px 16px; font-size: 14px; }

.jd-chip {
    display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px;
    background: rgba(255, 255, 255, .92); color: var(--jd-accent-deep);
    font: 700 11px/1 var(--jd-font); letter-spacing: .06em; text-transform: uppercase;
}
.jd-chip--solid { background: var(--jd-accent); color: #fff; }
.jd-chip--solid:hover { background: var(--jd-accent-deep); color: #fff; text-decoration: none; }

.jd-soon {
    display: inline-flex; padding: 5px 10px; border-radius: 999px; background: #F1F2F2; color: var(--jd-ink-soft);
    font: 600 12px/1 var(--jd-font);
}

/* ========== Top bar and tabs ========== */
.jd-top {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(255, 255, 255, .92); backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--jd-line);
    transition: box-shadow .2s ease;
}
.admin-bar .jd-top { top: 32px; }
.jd-top.is-scrolled { box-shadow: 0 4px 20px rgba(45, 52, 54, .08); }

.jd-top__bar { display: flex; align-items: center; gap: 16px; height: var(--jd-top-h); }

.jd-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--jd-ink); min-width: 0; }
.jd-brand:hover { text-decoration: none; }
.jd-brand__mark {
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
    background: var(--jd-pink-soft); font-size: 19px; flex: none;
}
.jd-brand__name { font: 800 18px/1 var(--jd-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.jd-search {
    display: flex; align-items: center; gap: 8px; margin-left: auto;
    width: 240px; height: 38px; padding: 0 14px; border-radius: 999px;
    background: #F1F2F2; color: var(--jd-ink-faint); border: 1.5px solid transparent;
}
.jd-search:focus-within { background: #fff; border-color: var(--jd-ink); color: var(--jd-ink); }
.jd-search input {
    flex: 1; min-width: 0; border: 0; background: transparent; outline: 0;
    font: 500 14px/1 var(--jd-font); color: var(--jd-ink);
}
.jd-search input::placeholder { color: var(--jd-ink-faint); }

.jd-tabs { border-top: 1px solid var(--jd-line); }
.jd-tabs__inner { display: flex; gap: 4px; height: var(--jd-tabs-h); overflow-x: auto; scrollbar-width: none; }
.jd-tabs__inner::-webkit-scrollbar { display: none; }

.jd-tab {
    position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 0 16px;
    color: var(--jd-ink-soft); font: 600 15px/1 var(--jd-font); white-space: nowrap;
}
.jd-tab:hover { color: var(--jd-ink); text-decoration: none; }
.jd-tab.is-active { color: var(--jd-ink); }
.jd-tabs .jd-tab::after {
    content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px;
    border-radius: 3px 3px 0 0; background: var(--jd-accent); transform: scaleX(0); transition: transform .2s ease;
}
.jd-tabs .jd-tab:hover::after { transform: scaleX(.4); }
.jd-tabs .jd-tab.is-active::after { transform: scaleX(1); }

/* Mobile bottom bar */
.jd-bottom { display: none; }

/* ========== Profile (home) ========== */
.jd-profile { background: var(--jd-surface); border-bottom: 1px solid var(--jd-line); }
.jd-profile__cover {
    height: 200px;
    background:
        radial-gradient(circle at 12% 30%, rgba(255, 255, 255, .55) 0 46px, transparent 47px),
        radial-gradient(circle at 78% 62%, rgba(255, 255, 255, .35) 0 78px, transparent 79px),
        radial-gradient(circle at 55% 10%, rgba(255, 255, 255, .28) 0 30px, transparent 31px),
        radial-gradient(circle at 92% 12%, rgba(211, 84, 0, .28) 0 54px, transparent 55px),
        linear-gradient(120deg, #FFB3B3 0%, #FF9999 45%, #F7A072 100%);
}
.jd-profile__body {
    display: grid; grid-template-columns: auto 1fr auto; gap: 8px 24px; align-items: start;
    padding-bottom: 28px;
}
.jd-profile__avatar {
    display: grid; place-items: center; width: 128px; height: 128px; margin-top: -64px;
    border-radius: 50%; background: #fff; border: 5px solid #fff; box-shadow: var(--jd-shadow);
    font-size: 64px; line-height: 1;
    background-image: linear-gradient(135deg, #FFF0F0, #FFE1D2);
}
.jd-profile__text { padding-top: 18px; min-width: 0; }
.jd-profile__text h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; }
.jd-profile__tagline { margin: 6px 0 0; font-weight: 600; color: var(--jd-accent-deep); }
.jd-profile__bio { margin: 8px 0 0; color: var(--jd-ink-soft); max-width: 56ch; }
.jd-profile__stats { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; margin: 14px 0 0; padding: 0; color: var(--jd-ink-soft); font-size: 14px; }
.jd-profile__stats strong { color: var(--jd-ink); font-weight: 700; }
.jd-profile__actions { display: flex; gap: 10px; align-self: end; padding-bottom: 4px; }

/* ========== Sections ========== */
.jd-section { padding: 36px 0 8px; }
.jd-section__title { font-size: 22px; font-weight: 800; margin-bottom: 18px; }

/* ========== Featured ========== */
.jd-featured { margin-top: 32px; }
.jd-featured__link {
    display: grid; grid-template-columns: 1.15fr 1fr; background: var(--jd-surface); color: var(--jd-ink);
    border-radius: var(--jd-radius); overflow: hidden; box-shadow: var(--jd-shadow);
    transition: transform .2s ease, box-shadow .2s ease;
}
.jd-featured__link:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--jd-shadow-lift); }
.jd-featured__cover { position: relative; min-height: 320px; overflow: hidden; }
.jd-featured__cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.jd-featured__body { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 36px; }
.jd-featured__body h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 800; }
.jd-featured__body p { margin: 0; color: var(--jd-ink-soft); }
.jd-featured__flag {
    display: inline-flex; align-items: center; gap: 6px; color: var(--jd-accent-deep);
    font: 700 12px/1 var(--jd-font); letter-spacing: .06em; text-transform: uppercase;
}
.jd-featured__flag .jd-icon { width: 14px; height: 14px; }
.jd-featured__cta { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--jd-ink); }
.jd-featured__link:hover .jd-featured__cta .jd-icon { transform: translateX(4px); }
.jd-featured__cta .jd-icon { transition: transform .2s ease; }

/* ========== Collections ========== */
.jd-collections { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.jd-collection {
    display: flex; flex-direction: column; gap: 8px; min-height: 210px; padding: 20px;
    border-radius: var(--jd-radius); color: #fff;
    background: linear-gradient(155deg, var(--jd-accent) 0%, var(--jd-accent-deep) 100%);
    box-shadow: var(--jd-shadow); transition: transform .2s ease, box-shadow .2s ease;
}
.jd-collection:hover { text-decoration: none; color: #fff; transform: translateY(-3px); box-shadow: var(--jd-shadow-lift); }
.jd-collection__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, .18); }
.jd-collection__title { font: 800 20px/1.15 var(--jd-display); margin-top: 6px; }
.jd-collection__blurb { font-size: 14px; line-height: 1.45; opacity: .92; }
.jd-collection__count { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 8px; font: 700 13px/1 var(--jd-font); }
.jd-collection__count .jd-icon { width: 16px; height: 16px; transition: transform .2s ease; }
.jd-collection:hover .jd-collection__count .jd-icon { transform: translateX(4px); }

/* ========== Feed ========== */
.jd-feed { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.jd-card { min-width: 0; }
.jd-card__link {
    display: flex; flex-direction: column; height: 100%; background: var(--jd-surface); color: var(--jd-ink);
    border-radius: var(--jd-radius); overflow: hidden; box-shadow: var(--jd-shadow);
    transition: transform .2s ease, box-shadow .2s ease;
}
a.jd-card__link:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--jd-shadow-lift); }

.jd-card__cover { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #EEE; }
.jd-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
a.jd-card__link:hover .jd-card__cover img { transform: scale(1.04); }
.jd-card__cover .jd-chip { position: absolute; top: 14px; left: 14px; }

/* Text tile, used when a post has no featured image */
.jd-card__cover--tile {
    display: flex; align-items: flex-end; padding: 20px;
    background: linear-gradient(155deg, var(--jd-accent) 0%, var(--jd-accent-deep) 100%);
}
.jd-card__cover--tile .jd-card__title { color: #fff; font-size: clamp(20px, 2.1vw, 25px); font-weight: 800; text-wrap: balance; }
.jd-card__mark { position: absolute; right: -22px; top: -22px; color: rgba(255, 255, 255, .16); }
.jd-card__mark .jd-icon { width: 150px; height: 150px; stroke-width: 1.6; }

.jd-card__body { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px; flex: 1; }
.jd-card__body .jd-card__title { font-size: 19px; font-weight: 700; }
.jd-card__excerpt { margin: 0; color: var(--jd-ink-soft); font-size: 14.5px; line-height: 1.5; }
.jd-card__meta { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 4px; color: var(--jd-ink-faint); font-size: 13px; }
.jd-card__meta > * + *::before { content: '·'; margin-right: 12px; }

.jd-card--soon .jd-card__cover--tile { filter: saturate(.72); }
.jd-card--soon .jd-card__link { box-shadow: none; border: 1px dashed #D5D9DA; }

.jd-feed__loader { display: grid; place-items: center; padding: 32px 0; }
.jd-spinner {
    width: 28px; height: 28px; border-radius: 50%;
    border: 3px solid var(--jd-line); border-top-color: var(--jd-pink-strong);
    animation: jd-spin .8s linear infinite;
}
@keyframes jd-spin { to { transform: rotate(360deg); } }

.jd-feed__end { text-align: center; padding: 28px 0 0; color: var(--jd-ink-faint); font-size: 14px; }

.jd-empty { color: var(--jd-ink-soft); }
.jd-pagination { padding: 28px 0; }
.jd-pagination .nav-links { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.jd-pagination .page-numbers { padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--jd-line); color: var(--jd-ink); font-weight: 600; font-size: 14px; }
.jd-pagination .page-numbers.current { background: var(--jd-ink); color: #fff; border-color: var(--jd-ink); }

/* ========== Section hero (tabs other than home) ========== */
.jd-hero { background: linear-gradient(155deg, var(--jd-accent) 0%, var(--jd-accent-deep) 100%); color: #fff; padding: 44px 0 40px; }
.jd-hero h1 { color: #fff; font-size: clamp(30px, 5vw, 46px); font-weight: 800; }
.jd-hero p { margin: 10px 0 0; max-width: 56ch; font-size: 17px; opacity: .95; }
.jd-hero__icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 16px; border-radius: 14px; background: rgba(255, 255, 255, .18); }
.jd-hero .jd-btn--primary { background: #fff; color: var(--jd-ink); }

/* ========== Tools ========== */
.jd-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.jd-tool {
    display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 24px;
    background: var(--jd-surface); border-radius: var(--jd-radius); box-shadow: var(--jd-shadow);
}
.jd-tool__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: #FDF2E9; font-size: 28px; }
.jd-tool h2 { font-size: 21px; font-weight: 800; }
.jd-tool p { margin: 0; color: var(--jd-ink-soft); font-size: 15px; flex: 1; }
.jd-tool .jd-btn, .jd-tool .jd-soon { margin-top: 8px; }
.jd-tool--soon { box-shadow: none; border: 1px dashed #D5D9DA; }

/* ========== Join ========== */
.jd-join { margin: 44px 0 8px; }
.jd-join__inner {
    display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
    padding: 40px 24px; border-radius: var(--jd-radius);
    background: linear-gradient(135deg, #FFF0F0 0%, #FFE6D9 100%);
}
.jd-join__avatar { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: #fff; font-size: 30px; box-shadow: var(--jd-shadow); }
.jd-join h2 { font-size: 28px; font-weight: 800; margin-top: 6px; }
.jd-join p { margin: 0 0 10px; color: var(--jd-ink-soft); max-width: 44ch; }
.jd-join__form { width: 100%; max-width: 440px; text-align: left; }

/* ========== Article ========== */
.jd-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1100; pointer-events: none; }
.admin-bar .jd-progress { top: 32px; }
.jd-progress span { display: block; height: 100%; width: 0; background: var(--jd-pink-strong); }

.jd-article { max-width: 760px; margin: 0 auto; padding: 44px 20px 8px; }
.jd-article__header { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: 28px; }
.jd-article__header h1 { font-size: clamp(30px, 5vw, 44px); font-weight: 800; text-wrap: balance; }
.jd-article__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--jd-ink-soft); font-size: 14px; }
.jd-article__meta > * + *:not(:nth-child(2))::before { content: '·'; margin-right: 12px; }
.jd-article__avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--jd-pink-soft); font-size: 16px; }
.jd-article__meta span:nth-child(2) { font-weight: 600; color: var(--jd-ink); }
.jd-article__cover { margin: 0 0 32px; border-radius: var(--jd-radius); overflow: hidden; }
.jd-article__cover img { width: 100%; }

.jd-content { font-size: 18px; line-height: 1.75; overflow-wrap: break-word; }
.jd-content--flush { max-width: 760px; }
.jd-content > * { margin-top: 0; margin-bottom: 1.25em; }
.jd-content h2 { font-size: 28px; margin-top: 1.8em; margin-bottom: .6em; }
.jd-content h3 { font-size: 22px; margin-top: 1.6em; margin-bottom: .5em; }
.jd-content h4 { font-size: 18px; margin-top: 1.4em; margin-bottom: .4em; }
.jd-content a { text-decoration: underline; text-underline-offset: 3px; }
.jd-content ul, .jd-content ol { padding-left: 1.3em; }
.jd-content li { margin-bottom: .4em; }
.jd-content img, .jd-content figure { border-radius: var(--jd-radius-sm); }
.jd-content figure { margin-left: 0; margin-right: 0; }
.jd-content figcaption { margin-top: 8px; color: var(--jd-ink-faint); font-size: 14px; text-align: center; }
.jd-content blockquote {
    margin-left: 0; margin-right: 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--jd-accent);
    font-size: 20px; color: var(--jd-ink);
}
.jd-content hr { border: 0; border-top: 1px solid var(--jd-line); margin: 2em 0; }
.jd-content code { padding: 2px 6px; border-radius: 6px; background: #F1F2F2; font-size: .9em; }
.jd-content pre { padding: 16px; border-radius: var(--jd-radius-sm); background: #2D3436; color: #F5F5F5; overflow-x: auto; font-size: 14px; }
.jd-content pre code { padding: 0; background: none; }
.jd-content table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 15px; }
.jd-content th, .jd-content td { padding: 10px 12px; border: 1px solid var(--jd-line); text-align: left; }
.jd-content th { background: #F5F6F6; font-weight: 700; }
.jd-content .alignwide { margin-left: -40px; margin-right: -40px; max-width: none; }

.jd-disclaimer {
    margin: 2em 0; padding: 14px 18px; border-left: 4px solid #F2B705; border-radius: 0 var(--jd-radius-sm) var(--jd-radius-sm) 0;
    background: #FFF8E1; color: #5D4037; font-size: 14px; line-height: 1.6;
}
.jd-disclaimer--cases { background: #FDEDEC; border-left-color: var(--jd-cases); color: #7B241C; }

/* ========== Footer ========== */
.jd-footer { margin-top: 56px; padding: 36px 0 40px; background: var(--jd-ink); color: #B2BEC3; font-size: 13px; text-align: center; }
.jd-footer__brand { margin-bottom: 14px; color: #fff; font: 800 18px/1 var(--jd-display); }
.jd-footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; list-style: none; margin: 0 0 18px; padding: 0; }
.jd-footer a { color: #FFB3B3; font-size: 14px; }
.jd-footer p { max-width: 60ch; margin: 0 auto 6px; }

/* ========== Responsive ========== */
@media (max-width: 980px) {
    .jd-collections { grid-template-columns: repeat(2, 1fr); }
    .jd-feed, .jd-tools { grid-template-columns: repeat(2, 1fr); }
    .jd-profile__body { grid-template-columns: auto 1fr; }
    .jd-profile__actions { grid-column: 1 / -1; padding-top: 8px; }
}

@media (max-width: 782px) {
    .admin-bar .jd-top, .admin-bar .jd-progress { top: 46px; }
}

@media (max-width: 680px) {
    :root { --jd-top-h: 54px; }
    html { scroll-padding-top: calc(var(--jd-top-h) + 16px); }
    body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
    .jd-wrap { padding: 0 16px; }

    .jd-search { display: none; }
    .jd-top__bar .jd-btn { margin-left: auto; }
    .jd-tabs { display: none; }

    .jd-bottom {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
        display: grid; grid-template-columns: repeat(5, 1fr);
        padding-bottom: env(safe-area-inset-bottom);
        background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); border-top: 1px solid var(--jd-line);
    }
    .jd-bottom .jd-tab { flex-direction: column; justify-content: center; gap: 4px; height: 60px; padding: 0; font-size: 11px; font-weight: 600; color: var(--jd-ink-faint); }
    .jd-bottom .jd-tab .jd-icon { width: 23px; height: 23px; }
    .jd-bottom .jd-tab.is-active { color: var(--jd-accent-deep); }
    .jd-bottom .jd-tab--home.is-active { color: var(--jd-ink); }

    .jd-profile__cover { height: 120px; }
    .jd-profile__body { grid-template-columns: 1fr; gap: 0; padding-bottom: 22px; }
    .jd-profile__avatar { width: 92px; height: 92px; margin-top: -46px; font-size: 46px; border-width: 4px; }
    .jd-profile__text { padding-top: 12px; }
    .jd-profile__actions { padding-top: 16px; }
    .jd-profile__actions .jd-btn { flex: 1; }

    .jd-section { padding-top: 28px; }
    .jd-featured { margin-top: 20px; }
    .jd-featured__link { grid-template-columns: 1fr; }
    .jd-featured__cover { min-height: 0; aspect-ratio: 16 / 10; }
    .jd-featured__body { padding: 20px; gap: 10px; }

    /* Collections become a swipeable row */
    .jd-collections {
        display: flex; gap: 12px; margin: 0 -16px; padding: 4px 16px 12px;
        overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    }
    .jd-collections::-webkit-scrollbar { display: none; }
    .jd-collection { flex: 0 0 76%; min-height: 190px; scroll-snap-align: center; }

    /* One post per row: the scroll */
    .jd-feed, .jd-tools { grid-template-columns: 1fr; gap: 16px; }
    .jd-card__cover--tile .jd-card__title { font-size: 24px; }

    .jd-article { padding-top: 28px; }
    .jd-content { font-size: 17px; }
    .jd-content .alignwide { margin-left: 0; margin-right: 0; }
    .jd-footer { margin-top: 40px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; }
}
