/*
Theme Name: ATD Web App
Theme URI: https://atruckdrivers.com/
Author: American Truck Drivers Inc.
Author URI: https://atruckdrivers.com/
Description: A fast, responsive, app-inspired WordPress theme for American Truck Drivers. Built for server-rendered news, media, community and submission pages, with Yoast SEO compatibility and a mobile bottom navigation.
Version: 0.1.26
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: atd-web-app
License: Proprietary
*/

:root {
    --atd-accent: #c35214;
    --atd-accent-strong: #a9410b;
    --atd-accent-soft: #f7e7dc;
    --atd-brand-red: #f50900;
    --atd-bg: #ffffff;
    --atd-surface: #f3f3f3;
    --atd-surface-2: #fafafa;
    --atd-text: #181818;
    --atd-muted: #666b72;
    --atd-border: #d7d9dc;
    --atd-header: rgba(255, 255, 255, .94);
    --atd-shadow: 0 2px 10px rgba(0, 0, 0, .10);
    --atd-shadow-lg: 0 12px 34px rgba(0, 0, 0, .13);
    --atd-radius-sm: 12px;
    --atd-radius: 20px;
    --atd-radius-lg: 28px;
    --atd-content: 1180px;
    --atd-reading: 790px;
    --atd-bottom-nav-height: 78px;
}

html[data-theme="dark"] {
    --atd-bg: #0e0f10;
    --atd-surface: #191b1e;
    --atd-surface-2: #131517;
    --atd-text: #f5f6f7;
    --atd-muted: #aeb3ba;
    --atd-border: #34383d;
    --atd-header: rgba(14, 15, 16, .94);
    --atd-shadow: 0 2px 12px rgba(0, 0, 0, .35);
    --atd-shadow-lg: 0 16px 40px rgba(0, 0, 0, .45);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--atd-bg);
    color: var(--atd-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 17px;
    line-height: 1.62;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}
body.atd-panel-open { overflow: hidden; }
img, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .16em; }
a:hover { color: var(--atd-accent); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }

.screen-reader-text {
    position: absolute !important;
    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 !important;
    z-index: 100000;
    top: 12px; left: 12px;
    width: auto; height: auto;
    padding: 12px 16px;
    clip: auto;
    background: var(--atd-bg);
    border: 2px solid var(--atd-accent);
    border-radius: 8px;
}

.atd-container { width: min(calc(100% - 32px), var(--atd-content)); margin-inline: auto; }
.atd-reading { width: min(100%, var(--atd-reading)); margin-inline: auto; }
.atd-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.atd-site-main { min-height: 68vh; padding-block: 28px 64px; }
.atd-section { margin-block: 28px 48px; }
.atd-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.atd-section-title { margin: 0; font-size: clamp(1.25rem, 1.65vw, 1.55rem); line-height: 1.18; letter-spacing: -.025em; text-wrap: balance; }
.atd-page-title { margin: 0; font-size: clamp(1.45rem, 2.1vw, 1.9rem); line-height: 1.12; letter-spacing: -.03em; text-wrap: balance; }
.atd-page-intro { margin: 10px 0 0; color: var(--atd-muted); max-width: 760px; }

.atd-site-header {
    position: sticky;
    z-index: 1000;
    top: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--atd-border) 75%, transparent);
    background: var(--atd-header);
    backdrop-filter: saturate(180%) blur(18px);
}
.admin-bar .atd-site-header { top: 32px; }
.atd-header-row { min-height: 76px; display: flex; align-items: center; gap: 20px; }
.atd-brand { display: flex; align-items: center; gap: 12px; min-width: max-content; text-decoration: none; }
.atd-brand img, .custom-logo { width: auto; max-width: 228px; max-height: 58px; object-fit: contain; }
.atd-brand-text { display: none; font-size: 1rem; font-weight: 750; letter-spacing: -.025em; line-height: 1.1; }
.atd-primary-nav { margin-left: auto; }
.atd-primary-nav ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.atd-primary-nav a { display: block; padding: 10px 12px; border-radius: 999px; font-size: .94rem; font-weight: 700; text-decoration: none; }
.atd-primary-nav .current-menu-item > a, .atd-primary-nav a:hover { background: var(--atd-accent-soft); color: var(--atd-accent-strong); }
.atd-header-actions { display: flex; align-items: center; gap: 4px; }
.atd-icon-button {
    display: inline-grid;
    place-items: center;
    width: 44px; height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}
.atd-icon-button:hover, .atd-icon-button:focus-visible { background: var(--atd-surface); outline: none; }
.atd-icon { width: 25px; height: 25px; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.atd-mobile-menu-toggle { display: none; }

.atd-search-panel { display: none; padding: 0 0 18px; }
.atd-search-panel.is-open { display: block; }
.atd-search-form { display: flex; align-items: center; gap: 10px; }
.atd-search-field {
    width: 100%; min-height: 52px;
    padding: 12px 18px;
    color: var(--atd-text);
    border: 1px solid var(--atd-border);
    border-radius: 999px;
    background: var(--atd-bg);
}
.atd-search-field:focus { border-color: var(--atd-accent); outline: 3px solid color-mix(in srgb, var(--atd-accent) 20%, transparent); }
.atd-search-submit, .atd-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px;
    padding: 10px 18px;
    border: 1px solid var(--atd-accent);
    border-radius: 999px;
    color: #fff;
    background: var(--atd-accent);
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}
.atd-search-submit:hover, .atd-button:hover { color: #fff; background: var(--atd-accent-strong); }
.atd-button--ghost { color: var(--atd-accent); background: transparent; }
.atd-button--ghost:hover { color: #fff; }

.atd-hero { position: relative; }
.atd-hero-viewport { position: relative; }
.atd-hero-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(88%, 860px);
    gap: 18px;
    overflow-x: auto;
    padding: 2px 2px 14px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.atd-hero-track::-webkit-scrollbar { display: none; }
.atd-hero-card {
    position: relative;
    min-height: clamp(400px, 62vw, 660px);
    overflow: hidden;
    border-radius: var(--atd-radius-lg);
    background: var(--atd-surface);
    box-shadow: var(--atd-shadow);
    scroll-snap-align: start;
}
.atd-hero-card > a { display: block; height: 100%; color: #fff; text-decoration: none; }
.atd-hero-media { position: absolute; inset: 0; }
.atd-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.atd-hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.04) 38%, rgba(0,0,0,.88) 100%); }
.atd-hero-content { position: absolute; z-index: 2; inset-inline: 26px; bottom: 26px; }
.atd-hero-title { max-width: 820px; margin: 10px 0 8px; font-size: clamp(1.35rem, 2.05vw, 1.95rem); line-height: 1.1; letter-spacing: -.025em; text-wrap: balance; }
.atd-hero-excerpt { max-width: 740px; margin: 0; color: rgba(255,255,255,.86); }
.atd-hero-dots { display: flex; justify-content: center; gap: 8px; min-height: 20px; padding-top: 4px; }
.atd-hero-dot { width: 10px; height: 10px; padding: 0; border: 1px solid rgba(0,0,0,.35); border-radius: 50%; background: var(--atd-bg); cursor: pointer; }
.atd-hero-dot.is-active { border-color: var(--atd-accent); background: var(--atd-accent); }
.atd-hero-arrow {
    position: absolute; z-index: 5; top: 50%;
    display: grid; place-items: center;
    width: 48px; height: 48px;
    padding: 0;
    transform: translateY(-50%);
    border: 1px solid rgba(255,255,255,.62);
    border-radius: 50%;
    color: #fff;
    background: rgba(0,0,0,.52);
    box-shadow: 0 4px 18px rgba(0,0,0,.2);
    cursor: pointer;
    backdrop-filter: blur(8px);
}
.atd-hero-arrow:hover, .atd-hero-arrow:focus-visible { background: rgba(0,0,0,.72); outline: 2px solid #fff; outline-offset: 2px; }
.atd-hero-arrow:disabled { opacity: .34; cursor: default; }
.atd-hero-arrow--prev { left: 18px; }
.atd-hero-arrow--next { right: 18px; }
.atd-hero-arrow .atd-icon { width: 28px; height: 28px; }

.atd-badge {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 34px;
    padding: 6px 14px;
    border-radius: 999px;
    color: #fff;
    background: var(--atd-accent);
    font-size: .84rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .01em;
}
.atd-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.atd-card {
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--atd-border) 85%, transparent);
    border-radius: var(--atd-radius);
    background: var(--atd-surface);
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.atd-card:hover { box-shadow: var(--atd-shadow); transform: translateY(-1px); transition: box-shadow .18s ease, transform .18s ease; }
.atd-card-link { display: block; text-decoration: none; }
.atd-card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #ddd; }
.atd-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .28s ease; }
.atd-card:hover .atd-card-media img { transform: scale(1.025); }
.atd-card-media .atd-badge { position: absolute; z-index: 2; top: 16px; left: 16px; }
.atd-card-play { position: absolute; z-index: 2; inset: 50% auto auto 50%; display: grid; place-items: center; width: 64px; height: 64px; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(0,0,0,.68); color: #fff; }
.atd-card-play .atd-icon { width: 30px; height: 30px; fill: currentColor; stroke: none; margin-left: 4px; }
.atd-card-body { padding: 20px; }
.atd-card-title { display: -webkit-box; margin: 0 0 9px; overflow: hidden; font-size: clamp(1rem, 1.18vw, 1.16rem); line-height: 1.22; letter-spacing: -.018em; text-wrap: balance; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.atd-card-excerpt { display: -webkit-box; margin: 0 0 14px; overflow: hidden; color: var(--atd-muted); font-size: .94rem; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.atd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--atd-muted); font-size: .88rem; }
.atd-meta-item { display: inline-flex; align-items: center; gap: 6px; }
.atd-meta .atd-icon { width: 18px; height: 18px; color: var(--atd-accent); }
.atd-card--list { display: grid; grid-template-columns: minmax(220px, 36%) 1fr; }
.atd-card--list .atd-card-media { height: 100%; min-height: 230px; aspect-ratio: auto; }

.atd-category-feed { padding-top: 4px; }
.atd-archive-header { margin: 10px 0 28px; }
.atd-archive-description { max-width: 760px; color: var(--atd-muted); }
.atd-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 34px; }
.atd-pagination .nav-links, .atd-pagination ul.page-numbers { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; }
.atd-pagination ul.page-numbers { list-style: none; margin: 0; padding: 0; }
.atd-pagination ul.page-numbers > li { flex: 0 0 auto; width: auto; margin: 0; padding: 0; list-style: none; }
.atd-pagination a.page-numbers, .atd-pagination span.page-numbers { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--atd-border); border-radius: 12px; text-decoration: none; }
.atd-pagination .current, .atd-pagination a.page-numbers:hover { border-color: var(--atd-accent); background: var(--atd-accent); color: #fff; }

.atd-breadcrumbs { margin: 0 0 20px; color: var(--atd-muted); font-size: .88rem; }
.atd-breadcrumbs a { color: inherit; }
.atd-article { width: min(100%, var(--atd-reading)); margin-inline: auto; }
.atd-article-header { margin: 8px 0 24px; }
.atd-article-kicker { margin-bottom: 14px; }
.atd-article-title { margin: 0 0 16px; font-size: clamp(1.55rem, 2.35vw, 2.15rem); line-height: 1.12; letter-spacing: -.025em; text-wrap: balance; overflow-wrap: break-word; }
.atd-article-deck { margin: -4px 0 20px; color: var(--atd-muted); font-size: 1.16rem; }
.atd-article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; color: var(--atd-muted); font-size: .93rem; }
.atd-author-link { display: inline-flex; align-items: center; gap: 9px; font-weight: 750; text-decoration: none; }
.atd-author-link img { width: 36px; height: 36px; border-radius: 50%; }
.atd-featured-image { margin: 0 0 26px; overflow: hidden; border-radius: var(--atd-radius); background: var(--atd-surface); }
.atd-featured-image img { display: block; width: 100%; max-height: 760px; object-fit: cover; }
.atd-featured-image figcaption { padding: 8px 14px; color: var(--atd-muted); font-size: .82rem; }


/* Post CTA row: three compact, equal pills kept on one line. */
.atd-post-cta {
    width: min(100%, 460px);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    gap: 6px;
    margin: -10px auto 22px;
}
.atd-post-cta--double {
    width: min(100%, 310px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.atd-post-cta--single {
    width: min(100%, 150px);
    grid-template-columns: minmax(0, 1fr);
}
.atd-post-cta__button {
    min-width: 0;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 8px;
    border: 1px solid var(--atd-border);
    border-radius: 999px;
    background: var(--atd-surface-2);
    color: var(--atd-text) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
    text-decoration: none !important;
    font-size: .73rem;
    font-weight: 750;
    line-height: 1;
    transition: transform .15s ease, border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.atd-post-cta__button:hover,
.atd-post-cta__button:focus-visible {
    background: var(--atd-surface);
    border-color: color-mix(in srgb, var(--atd-border) 65%, var(--atd-text));
    box-shadow: 0 2px 7px rgba(0, 0, 0, .10);
    transform: translateY(-1px);
}
.atd-post-cta__button:focus-visible {
    outline: 2px solid var(--atd-accent);
    outline-offset: 2px;
}
.atd-post-cta__icon {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.atd-post-cta__icon svg {
    display: block;
    width: 100%;
    height: 100%;
}
.atd-post-cta__icon--play {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
}
.atd-post-cta__label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.atd-post-cta__share,
.atd-post-cta__primary,
.atd-post-cta__play {
    width: 100%;
}
.atd-post-cta__share {
    border: 1px solid var(--atd-border);
    font-family: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
.atd-post-cta__icon--share .atd-icon {
    width: 18px;
    height: 18px;
}
.atd-entry-content { font-size: 1.08rem; }
.atd-entry-content > * { max-width: 100%; }
.atd-entry-content p { margin: 0 0 1.35em; }

/* Respect alignment choices made in the WordPress editor. */
.atd-entry-content .has-text-align-left { text-align: left; }
.atd-entry-content .has-text-align-center { text-align: center; }
.atd-entry-content .has-text-align-right { text-align: right; }
.atd-entry-content .has-text-align-justify { text-align: justify; }

/* Classic Editor and block-image alignment helpers. */
.atd-entry-content img.aligncenter,
.atd-entry-content figure.aligncenter,
.atd-entry-content .wp-caption.aligncenter,
.atd-entry-content .aligncenter:not(.alignwide):not(.alignfull) {
    display: block;
    float: none;
    clear: both;
    margin-left: auto;
    margin-right: auto;
}
.atd-entry-content img.alignleft,
.atd-entry-content figure.alignleft,
.atd-entry-content .wp-caption.alignleft,
.atd-entry-content .alignleft {
    float: left;
    margin: .35em 1.5em 1em 0;
}
.atd-entry-content img.alignright,
.atd-entry-content figure.alignright,
.atd-entry-content .wp-caption.alignright,
.atd-entry-content .alignright {
    float: right;
    margin: .35em 0 1em 1.5em;
}
.atd-entry-content img.alignnone,
.atd-entry-content figure.alignnone,
.atd-entry-content .wp-caption.alignnone {
    float: none;
    margin-left: 0;
    margin-right: 0;
}
.atd-entry-content .wp-caption,
.atd-entry-content figure {
    max-width: 100%;
}
.atd-entry-content .wp-caption img,
.atd-entry-content figure img {
    max-width: 100%;
    height: auto;
}
.atd-entry-content::after {
    content: "";
    display: table;
    clear: both;
}
.atd-entry-content h2, .atd-entry-content h3, .atd-entry-content h4 { margin: 1.6em 0 .55em; line-height: 1.16; letter-spacing: -.028em; }
.atd-entry-content h2 { font-size: clamp(1.7rem, 3vw, 2.35rem); }
.atd-entry-content h3 { font-size: clamp(1.4rem, 2.5vw, 1.85rem); }
.atd-entry-content blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--atd-accent); color: var(--atd-muted); font-size: 1.15em; }
.atd-entry-content img { border-radius: 14px; }
.atd-entry-content iframe { width: 100%; border: 0; border-radius: 14px; }
.atd-entry-content .wp-block-embed__wrapper { position: relative; overflow: hidden; border-radius: 14px; }
.atd-entry-content table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; }
.atd-entry-content th, .atd-entry-content td { padding: 10px 12px; border: 1px solid var(--atd-border); }
.atd-entry-content a { color: var(--atd-accent-strong); }
.atd-entry-content .alignwide { width: min(100vw - 32px, 1040px); max-width: none; margin-left: 50%; transform: translateX(-50%); }
.atd-entry-content .alignfull { width: 100vw; max-width: none; margin-left: 50%; transform: translateX(-50%); }
.atd-article-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 28px 0; }
.atd-article-actions .atd-button { width: 100%; }
.atd-ad-slot { margin: 26px 0; padding: 12px; border: 1px dashed var(--atd-border); border-radius: var(--atd-radius); text-align: center; }
.atd-ad-slot:empty { display: none; }
.atd-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0; }
.atd-tags a { padding: 7px 12px; border: 1px solid var(--atd-border); border-radius: 999px; color: var(--atd-muted); font-size: .86rem; text-decoration: none; }
.atd-tags a:hover { border-color: var(--atd-accent); color: var(--atd-accent); }
.atd-author-box { display: grid; grid-template-columns: auto 1fr; gap: 18px; margin: 34px 0; padding: 22px; border-radius: var(--atd-radius); background: var(--atd-surface); }
.atd-author-box img { width: 78px; height: 78px; border-radius: 50%; }
.atd-author-box h2 { margin: 0 0 6px; font-size: 1.25rem; }
.atd-author-box p { margin: 0; color: var(--atd-muted); }
.atd-post-navigation { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 34px 0; }
.atd-post-navigation a { display: block; height: 100%; padding: 18px; border: 1px solid var(--atd-border); border-radius: var(--atd-radius); text-decoration: none; }
.atd-post-navigation a:hover { border-color: var(--atd-accent); }
.atd-nav-label { display: block; margin-bottom: 6px; color: var(--atd-muted); font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }

.atd-comments { width: min(100%, var(--atd-reading)); margin: 44px auto 0; }
.atd-comments-title { font-size: 1.6rem; }
.comment-list { list-style: none; padding: 0; }
.comment-list .comment { margin: 0 0 18px; padding: 18px; border-radius: var(--atd-radius); background: var(--atd-surface); }
.comment-author { display: flex; align-items: center; gap: 10px; }
.comment-author .avatar { border-radius: 50%; }
.comment-metadata { margin: 4px 0 12px 46px; color: var(--atd-muted); font-size: .82rem; }
.comment-content p:last-child { margin-bottom: 0; }
.reply { margin-top: 10px; }
.comment-reply-link { color: var(--atd-accent); font-weight: 750; }
.comment-form label { display: block; margin-bottom: 5px; font-weight: 700; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
    width: 100%; padding: 12px 14px; color: var(--atd-text); border: 1px solid var(--atd-border); border-radius: 12px; background: var(--atd-bg);
}
.comment-form textarea { min-height: 150px; }
.comment-form .submit { min-height: 46px; padding: 10px 18px; border: 0; border-radius: 999px; color: #fff; background: var(--atd-accent); font-weight: 800; cursor: pointer; }


/* Shortcode / app-like utility pages.
 * The plugin UI receives the full theme canvas. Page-level breadcrumbs and
 * duplicate theme headings are intentionally omitted in page.php. */
.atd-page-wide--shortcode { width: 100%; }
.atd-page-shortcode-content {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}
.atd-page-shortcode-content > .wp-block-shortcode,
.atd-page-shortcode-content > .wp-block-shortcode > :first-child,
.atd-page-shortcode-content > :first-child {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.atd-page-card { padding: clamp(20px, 4vw, 44px); border: 1px solid var(--atd-border); border-radius: var(--atd-radius-lg); background: var(--atd-surface-2); }
.atd-empty { padding: 38px; border: 1px dashed var(--atd-border); border-radius: var(--atd-radius); text-align: center; }
.atd-empty h2 { margin-top: 0; }

.atd-site-footer { margin-top: 44px; padding: 42px 0 110px; border-top: 1px solid var(--atd-border); background: var(--atd-surface-2); }
.atd-footer-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 30px; align-items: start; }
.atd-footer-brand img { width: auto; max-width: 260px; max-height: 80px; }
.atd-footer-brand p { max-width: 540px; color: var(--atd-muted); }
.atd-footer-menu ul { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 18px; list-style: none; margin: 0; padding: 0; }
.atd-footer-menu a { color: var(--atd-muted); text-decoration: none; }
.atd-copyright { grid-column: 1 / -1; padding-top: 22px; border-top: 1px solid var(--atd-border); color: var(--atd-muted); font-size: .86rem; }

.atd-mobile-nav { display: none; }
.atd-more-backdrop { position: fixed; z-index: 1990; inset: 0; display: none; background: rgba(0,0,0,.48); }
.atd-more-backdrop.is-open { display: block; }
.atd-more-panel {
    position: fixed; z-index: 2000;
    right: 0; top: 0; bottom: 0;
    width: min(92vw, 430px);
    padding: 24px;
    overflow-y: auto;
    background: var(--atd-bg);
    box-shadow: var(--atd-shadow-lg);
    transform: translateX(102%);
    transition: transform .22s ease;
}
.atd-more-panel.is-open { transform: translateX(0); }
.admin-bar .atd-more-panel { top: 32px; }
.atd-more-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 28px; }
.atd-more-header h2 { margin: 0; font-size: 2rem; }
.atd-profile-card { padding: 22px; border-radius: var(--atd-radius); background: var(--atd-surface); text-align: center; }
.atd-profile-card img { border-radius: 50%; }
.atd-profile-card h3 { margin: 10px 0 2px; }
.atd-profile-card p { margin: 0 0 14px; color: var(--atd-muted); }
.atd-more-menu ul { list-style: none; margin: 22px 0 0; padding: 0; }
.atd-more-menu a { display: flex; align-items: center; min-height: 50px; padding: 10px 12px; border-bottom: 1px solid var(--atd-border); font-weight: 700; text-decoration: none; }

@media (max-width: 980px) {
    .atd-primary-nav { display: none; }
    .atd-mobile-menu-toggle { display: inline-grid; }
    .atd-brand-text { display: inline; }
    .atd-brand img, .atd-brand .custom-logo { display: none; }
    .atd-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .atd-footer-grid { grid-template-columns: 1fr; }
    .atd-footer-menu ul { justify-content: flex-start; }
}

@media (max-width: 782px) {
    .admin-bar .atd-site-header { top: 46px; }
    .admin-bar .atd-more-panel { top: 46px; }
}

@media (max-width: 720px) {
    :root { --atd-radius: 18px; --atd-radius-lg: 22px; --atd-bottom-nav-height: 82px; }
    body { font-size: 16px; padding-bottom: calc(var(--atd-bottom-nav-height) + env(safe-area-inset-bottom)); }
    .atd-container { width: min(calc(100% - 24px), var(--atd-content)); }
    .atd-site-main { padding-block: 18px 32px; }
    .atd-header-row { min-height: 72px; gap: 8px; }
    .atd-brand-text { max-width: 50vw; overflow: hidden; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
    .atd-header-actions { margin-left: auto; }
    .atd-header-actions .atd-search-toggle { display: none; }
    .atd-icon-button { width: 42px; height: 42px; }
    .atd-section { margin-block: 22px 36px; }
    .atd-page-title { font-size: 1.45rem; }
    .atd-hero-track { grid-auto-columns: 100%; gap: 12px; }
    .atd-hero-card { min-height: 470px; border-radius: 20px; }
    .atd-hero-content { inset-inline: 20px; bottom: 22px; }
    .atd-hero-title { font-size: 1.32rem; line-height: 1.12; }
    .atd-hero-excerpt { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
    .atd-hero-arrow { width: 42px; height: 42px; }
    .atd-hero-arrow--prev { left: 10px; }
    .atd-hero-arrow--next { right: 10px; }
    .atd-card-grid { grid-template-columns: 1fr; gap: 18px; }
    .atd-card--list { display: block; }
    .atd-card--list .atd-card-media { min-height: 0; aspect-ratio: 16 / 10; }
    .atd-card-body { padding: 18px; }
    .atd-card-title { font-size: 1.08rem; line-height: 1.23; -webkit-line-clamp: 3; }
    .atd-article-title { font-size: 1.48rem; line-height: 1.14; }
    .atd-entry-content { font-size: 1.04rem; }
    .atd-page-wide--shortcode { width: 100%; }
    .atd-page-shortcode-content { width: 100%; max-width: none; }

    .atd-featured-image { margin-inline: -4px; border-radius: 16px; }
    .atd-post-navigation { grid-template-columns: 1fr; }
    .atd-author-box { grid-template-columns: 1fr; text-align: center; }
    .atd-author-box img { margin-inline: auto; }
    .atd-site-footer { padding-bottom: 48px; }
    .atd-mobile-nav {
        position: fixed; z-index: 1500;
        left: 0; right: 0; bottom: 0;
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        min-height: calc(var(--atd-bottom-nav-height) + env(safe-area-inset-bottom));
        padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--atd-border);
        background: color-mix(in srgb, var(--atd-bg) 94%, transparent);
        box-shadow: 0 -4px 18px rgba(0,0,0,.08);
        backdrop-filter: saturate(180%) blur(18px);
    }
    .atd-mobile-nav a, .atd-mobile-nav button {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        min-width: 0;
        padding: 5px 2px;
        border: 0;
        border-radius: 18px;
        color: var(--atd-muted);
        background: transparent;
        font-size: .68rem;
        font-weight: 750;
        line-height: 1.05;
        text-decoration: none;
        cursor: pointer;
    }
    .atd-mobile-nav .atd-icon { width: 25px; height: 25px; }
    .atd-mobile-nav .is-active { color: var(--atd-accent); background: var(--atd-accent-soft); }
    .atd-mobile-nav-label { overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 420px) {
    .atd-brand-text { max-width: 45vw; font-size: .92rem; }
    .atd-mobile-nav a, .atd-mobile-nav button { font-size: .62rem; }
    .atd-mobile-nav .atd-icon { width: 23px; height: 23px; }
    .atd-article-actions { grid-template-columns: 1fr; }
}

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

/* v0.1.3: cleaner article/mobile header and stronger useful internal linking. */
.atd-related { margin: 34px 0; }
.atd-related-heading { margin: 0 0 14px; font-size: 1.22rem; line-height: 1.2; letter-spacing: -.02em; }
.atd-related-list { display: grid; gap: 12px; }
.atd-related-item {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    min-height: 88px;
    padding: 10px;
    border: 1px solid var(--atd-border);
    border-radius: 16px;
    background: var(--atd-surface-2);
    text-decoration: none;
}
.atd-related-item:hover { border-color: var(--atd-accent); }
.atd-related-thumb { overflow: hidden; width: 112px; aspect-ratio: 16 / 10; border-radius: 11px; background: var(--atd-surface); }
.atd-related-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.atd-related-copy { min-width: 0; }
.atd-related-title { display: -webkit-box; margin: 0; overflow: hidden; font-size: .98rem; line-height: 1.25; font-weight: 800; letter-spacing: -.015em; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.atd-related-meta { display: block; margin-top: 5px; color: var(--atd-muted); font-size: .78rem; }

/* Long single-post headlines should read like the app, not like a billboard. */
.atd-article-title { font-size: clamp(1.42rem, 2vw, 1.92rem); line-height: 1.13; }

@media (max-width: 980px) {
    /* Use the real ATD logo in the compact header. */
    .atd-brand-text { display: none; }
    .atd-brand img, .atd-brand .custom-logo {
        display: block;
        width: auto;
        max-width: 168px;
        max-height: 45px;
    }
}

@media (max-width: 720px) {
    /* The bottom bar already owns More on phones, so the duplicate hamburger is unnecessary. */
    .atd-mobile-menu-toggle { display: none; }
    .atd-header-row { min-height: 66px; }
    .atd-brand { min-width: 0; }
    .atd-brand img, .atd-brand .custom-logo { max-width: 154px; max-height: 42px; }
    .atd-article-title { font-size: 1.30rem; line-height: 1.16; letter-spacing: -.02em; }
    .atd-article-header { margin-top: 2px; }
    .atd-related { margin: 28px 0; }
    .atd-related-item { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; min-height: 78px; padding: 9px; }
    .atd-related-thumb { width: 96px; }
    .atd-related-title { font-size: .93rem; -webkit-line-clamp: 3; }
}

@media (max-width: 420px) {
    .atd-brand img, .atd-brand .custom-logo { max-width: 142px; max-height: 40px; }
    .atd-article-title { font-size: 1.24rem; }
}

/* v0.1.4: centered phone logo and non-sticky phone header. */
@media (max-width: 720px) {
    /* The top strip should scroll away with the article instead of covering reading space. */
    .atd-site-header {
        position: relative;
        top: auto;
    }
    .admin-bar .atd-site-header { top: auto; }

    /* Keep the official logo geometrically centered even with the theme toggle on the right. */
    .atd-header-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: center;
        gap: 8px;
    }
    .atd-brand {
        grid-column: 2;
        justify-self: center;
        min-width: 0;
    }
    .atd-header-actions {
        grid-column: 3;
        justify-self: end;
        margin-left: 0;
    }
}


/* v0.1.5: single article header is intentionally minimal; author identity lives in the footer author box. */
.atd-article-header .atd-article-meta { margin-top: 2px; }

/* v0.1.10: PageSpeed/Lighthouse performance and accessibility polish. */
[hidden] { display: none !important; }

/* Keep the visual carousel dots small while giving each control a comfortable touch target. */
.atd-hero-dots { gap: 0; }
.atd-hero-dot {
    position: relative;
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
}
.atd-hero-dot::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 10px;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(0,0,0,.35);
    border-radius: 50%;
    background: var(--atd-bg);
}
.atd-hero-dot.is-active { background: transparent; }
.atd-hero-dot.is-active::before {
    border-color: var(--atd-accent-strong);
    background: var(--atd-accent-strong);
}

@media (max-width: 720px) {
    .atd-mobile-nav a,
    .atd-mobile-nav button { min-height: 58px; }
    .atd-mobile-nav .is-active {
        color: var(--atd-accent-strong);
        background: var(--atd-accent-soft);
    }
}



@media (max-width: 560px) {
    .atd-post-cta {
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
        margin-top: -10px;
        margin-bottom: 20px;
    }
    .atd-post-cta--double {
        width: min(100%, 300px);
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .atd-post-cta--single {
        width: min(100%, 145px);
        grid-template-columns: minmax(0, 1fr);
    }
    .atd-post-cta__button {
        width: 100%;
        min-width: 0;
        height: 36px;
        gap: 4px;
        padding: 0 5px;
        font-size: .66rem;
    }
    .atd-post-cta__icon {
        width: 16px;
        height: 16px;
        flex: 0 0 16px;
    }
    .atd-post-cta__icon--play {
        width: 15px;
        height: 15px;
        flex-basis: 15px;
    }
    .atd-post-cta__icon--share .atd-icon {
        width: 15px;
        height: 15px;
    }
}

@media (max-width: 360px) {
    .atd-post-cta {
        gap: 4px;
    }
    .atd-post-cta__button {
        height: 34px;
        gap: 3px;
        padding: 0 3px;
        font-size: .61rem;
    }
    .atd-post-cta__icon {
        width: 14px;
        height: 14px;
        flex-basis: 14px;
    }
}

/* v0.1.25: Desktop homepage hero uses a more compact editorial mosaic; mobile keeps the original slider. */
.atd-hero-desktop { display: none; }

@media (min-width: 981px) {
    .atd-hero--mobile { display: none; }
    .atd-hero-desktop { display: block; }
    .atd-hero-desktop-grid {
        display: grid;
        grid-template-columns: minmax(0, 1.7fr) repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(2, minmax(220px, 1fr));
        gap: 18px;
    }
    .atd-hero-desktop-card {
        position: relative;
        overflow: hidden;
        min-height: 236px;
        border-radius: var(--atd-radius-lg);
        background: var(--atd-surface);
        box-shadow: var(--atd-shadow);
    }
    .atd-hero-desktop-card--feature {
        grid-row: 1 / span 2;
        min-height: 492px;
    }
    .atd-hero-desktop-card > a {
        display: block;
        height: 100%;
        color: #fff;
        text-decoration: none;
    }
    .atd-hero-desktop-media {
        position: absolute;
        inset: 0;
    }
    .atd-hero-desktop-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .atd-hero-desktop-media::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(0,0,0,.04) 28%, rgba(0,0,0,.84) 100%);
    }
    .atd-hero-desktop-content {
        position: absolute;
        z-index: 2;
        right: 20px;
        bottom: 20px;
        left: 20px;
    }
    .atd-hero-desktop-title {
        margin: 10px 0 0;
        color: #fff;
        line-height: 1.08;
        letter-spacing: -.025em;
        text-wrap: balance;
    }
    .atd-hero-desktop-card--feature .atd-hero-desktop-title {
        font-size: clamp(1.95rem, 2.2vw, 3rem);
    }
    .atd-hero-desktop-card--compact .atd-hero-desktop-title {
        font-size: clamp(1.08rem, 1.15vw, 1.45rem);
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
    }
    .atd-hero-desktop-excerpt {
        margin: 12px 0 0;
        max-width: 92%;
        color: rgba(255,255,255,.88);
        font-size: 1rem;
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
    }
}

@media (min-width: 981px) and (max-width: 1240px) {
    .atd-hero-desktop-grid {
        grid-template-columns: minmax(0, 1.55fr) repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
    .atd-hero-desktop-card--feature {
        min-height: 452px;
    }
    .atd-hero-desktop-card {
        min-height: 214px;
    }
    .atd-hero-desktop-content {
        right: 18px;
        bottom: 18px;
        left: 18px;
    }
    .atd-hero-desktop-card--feature .atd-hero-desktop-title {
        font-size: clamp(1.7rem, 2vw, 2.3rem);
    }
}
