
*, *::before, *::after { box-sizing: border-box; }
body, h1,h2,h3,h4,h5,h6,figure,form,fieldset,ul,ol,dl,pre { margin:0; padding:0; }

body {
    background: var(--bg, #fff);
    color: var(--link, #000);
    font-family: var(--font-body, Arial, sans-serif);
    font-size: var(--size-link, 13px);
    line-height: 1.4;
}

a              { color: var(--link, #000); text-decoration: none; }
a:hover        { color: var(--hover, #cc0000); text-decoration: underline; }
a:visited      { color: var(--link, #000); }
img            { max-width: 100%; height: auto; display: block; }

/* ── Top nav ── */
.apd-topnav {
    background: var(--topbar-bg, #000);
    text-align: center;
    padding: 3px 0;
}
.apd-topnav a {
    color: var(--topbar-link, #ccc) !important;
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin: 0 10px;
    text-decoration: none;
}
.apd-topnav a:hover { color: #fff !important; text-decoration: none; }

/* ── Header ── */
.apd-header {
    background: var(--header-bg, #fff);
    text-align: center;
    padding: 10px 16px 8px;
    border-bottom: 3px double var(--rule, #000);
}
.apd-sitename {
    font-family: var(--font-hl, "Arial Black", Arial, sans-serif);
    font-weight: 900;
    font-size: var(--size-sn, 52px);
    text-transform: uppercase;
    color: #000 !important;
    display: block;
    text-decoration: none !important;
    line-height: 1;
}
.apd-tagline {
    font-size: 11px;
    color: #666;
    letter-spacing: .1em;
    text-transform: uppercase;
    display: block;
    margin-top: 3px;
}
.apd-clock {
    font-size: 11px;
    color: #666;
    display: block;
    margin-top: 2px;
}

/* ── Grid ── */
.apd-grid {
    display: grid;
    max-width: var(--max-width, 1060px);
    margin: 0 auto;
    border-left: 1px solid var(--col-bdr, #ccc);
    border-right: 1px solid var(--col-bdr, #ccc);
    border-top: 2px solid #000;
    align-items: start;
}
.apd-col {
    padding: 8px 10px 14px;
    min-width: 0;
}
.apd-col-left  { border-right: 1px solid var(--col-bdr, #ccc); }
.apd-col-center {
    text-align: center;
    border-right: 1px solid var(--col-bdr, #ccc);
}

/* ── Labels ── */
.apd-col-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--label, #666);
    border-bottom: 1px solid var(--col-bdr, #ccc);
    padding-bottom: 4px;
    margin-bottom: 8px;
}

/* ── Links ── */
.apd-link {
    display: block;
    font-size: var(--size-link, 13px);
    font-weight: var(--weight-link, 400);
    color: var(--link, #000) !important;
    line-height: 1.35;
    margin-bottom: 6px;
    padding-bottom: 5px;
    border-bottom: 1px dotted #e0e0e0;
    text-decoration: none;
    word-break: break-word;
}
.apd-link:hover { color: var(--hover, #cc0000) !important; text-decoration: underline; }
.apd-link:last-child { border-bottom: none; }

/* ── Top headline ── */
.apd-top-img {
    width: 100%;
    max-width: 500px;
    height: auto;
    object-fit: cover;
    margin: 0 auto 8px;
    border: 1px solid #ddd;
    aspect-ratio: 16/9;
}
.apd-main-headline {
    display: block;
    font-family: var(--font-hl, "Arial Black", Arial, sans-serif);
    font-weight: 900;
    font-size: var(--size-hl, 26px);
    text-transform: uppercase;
    color: var(--hl, #cc0000) !important;
    line-height: 1.15;
    text-decoration: none;
    margin-bottom: 8px;
    word-break: break-word;
}
.apd-main-headline:hover { opacity: .85; text-decoration: none !important; }
.apd-center-rule {
    border: none;
    border-top: 2px solid #000;
    margin: 10px 0;
}
.apd-center-link {
    display: block;
    font-size: var(--size-cl, 14px);
    font-weight: 700;
    color: var(--link, #000) !important;
    line-height: 1.3;
    margin-bottom: 8px;
    padding-bottom: 7px;
    border-bottom: 1px dotted #ccc;
    text-decoration: none;
    word-break: break-word;
}
.apd-center-link:hover { color: var(--hover, #cc0000) !important; text-decoration: underline; }
.apd-center-img {
    width: 100%;
    max-width: 440px;
    margin: 0 auto 6px;
    border: 1px solid #ddd;
}

/* ── Badges ── */
.apd-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 1px 5px 2px;
    border-radius: 2px;
    color: #fff;
    margin-right: 3px;
    vertical-align: middle;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── Footer ── */
.apd-footer {
    background: var(--footer-bg, #000);
    color: var(--footer-text, #888);
    text-align: center;
    padding: 10px;
    font-size: 11px;
    margin-top: 0;
    border-top: 2px solid #000;
}
.apd-footer-links { margin-bottom: 6px; }
.apd-footer-links a {
    color: var(--footer-text, #888) !important;
    margin: 0 8px;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: .08em;
}
.apd-footer-links a:hover { color: #fff !important; text-decoration: none; }
.apd-copyright { font-size: 10px; }

/* ── Article / single post ── */
.apd-article {
    max-width: 760px;
    margin: 20px auto;
    padding: 0 20px 40px;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
}
.apd-article-title {
    font-family: var(--font-hl, "Arial Black", Arial, sans-serif);
    font-weight: 900;
    font-size: clamp(20px, 3vw, 28px);
    text-transform: uppercase;
    line-height: 1.15;
    color: #000;
    margin: 16px 0 12px;
}
.apd-article-meta {
    font-size: 12px;
    color: #666;
    border-top: 2px solid #000;
    border-bottom: 1px solid #ddd;
    padding: 8px 0;
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.apd-article-meta a { color: #666 !important; }
.apd-article-meta a:hover { color: var(--hover, #cc0000) !important; }
.apd-byline { font-weight: 700; color: #000 !important; }
.apd-sep { color: #ccc; }
.apd-article-img {
    width: 100%;
    height: auto;
    margin-bottom: 20px;
    border: 1px solid #ddd;
}

/* ── Article body — paragraph spacing is the whole point ── */
.apd-article-body {
    font-family: var(--font-article, Georgia, serif);
    font-size: var(--size-article, 17px);
    line-height: 1.75;
    color: #1a1a1a;
}
.apd-article-body p {
    margin-top: 0;
    margin-bottom: 1.3em;
}
.apd-article-body p:last-child { margin-bottom: 0; }
.apd-article-body h2 {
    font-family: var(--font-hl, "Arial Black", Arial, sans-serif);
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
    margin: 1.8em 0 .6em;
    color: #000;
    border-bottom: 1px solid #ddd;
    padding-bottom: 4px;
}
.apd-article-body h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 1.4em 0 .5em;
}
.apd-article-body blockquote {
    border-left: 3px solid var(--hl, #cc0000);
    margin: 1.4em 0;
    padding: 4px 16px;
    color: #444;
    font-style: italic;
}
.apd-article-body ul, .apd-article-body ol {
    margin: .8em 0 1em 1.4em;
}
.apd-article-body li { margin-bottom: .4em; }
.apd-article-body a {
    color: #000 !important;
    text-decoration: underline !important;
}
.apd-article-body a:hover { color: var(--hover, #cc0000) !important; }
.apd-article-body img {
    max-width: 100%;
    height: auto;
    margin: 1em auto;
    border: 1px solid #ddd;
}
.apd-source-line {
    margin-top: 24px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
    font-size: 12px;
    color: #888;
}
.apd-source-line a { color: #888 !important; text-decoration: underline !important; }
.apd-article-nav {
    margin-top: 24px;
    padding-top: 12px;
    border-top: 2px solid #000;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* ── Responsive ── */
@media (max-width: 700px) {
    .apd-grid {
        grid-template-columns: 1fr !important;
        border: none;
    }
    /* Center column first on mobile */
    .apd-col-center { order: -1; text-align: left; }
    .apd-col-left, .apd-col-center, .apd-col-right {
        border-right: none !important;
        border-bottom: 1px solid #ccc;
        padding: 12px 14px;
    }
    /* Show ALL links on mobile — never hide or truncate */
    .apd-link, .apd-center-link { display: block !important; }
    .apd-article { border: none; padding: 12px 14px 30px; }
    .apd-header-search { display: none; }
}

/* ── Inner pages (search, category) ── */
.apd-inner-page {
    max-width: 860px;
    margin: 20px auto;
    padding: 0 20px 40px;
}
.apd-inner-title {
    font-family: var(--font-hl, "Arial Black", Arial, sans-serif);
    font-size: 22px;
    font-weight: 900;
    text-transform: uppercase;
    border-bottom: 3px double var(--rule, #000);
    padding-bottom: 8px;
    margin-bottom: 16px;
    color: #000;
}
.apd-inner-title em { font-style: normal; color: var(--hl, #cc0000); }

/* ── Search form ── */
.apd-search-form {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.apd-search-form input[type=text] {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #000;
    font-size: 15px;
    font-family: var(--font-body, Arial, sans-serif);
    border-radius: 0;
}
.apd-search-form input:focus { outline: none; border-color: var(--hl, #cc0000); }
.apd-search-form button {
    background: #000;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    cursor: pointer;
}
.apd-search-form button:hover { background: var(--hl, #cc0000); }
.apd-search-count { font-size: 12px; color: #888; margin-bottom: 16px; }

/* ── Search results ── */
.apd-search-result {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #eee;
}
.apd-search-result:last-child { border-bottom: none; }
.apd-search-thumb {
    flex-shrink: 0;
    width: 120px;
    height: 80px;
    overflow: hidden;
    display: block;
}
.apd-search-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid #ddd;
    display: block;
}
.apd-search-body { flex: 1; min-width: 0; }
.apd-search-title {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--link, #000) !important;
    line-height: 1.3;
    margin-bottom: 4px;
    text-decoration: none;
}
.apd-search-title:hover { color: var(--hover, #cc0000) !important; text-decoration: underline; }
.apd-search-meta { font-size: 11px; color: #888; margin-bottom: 5px; }
.apd-search-meta a { color: #888 !important; text-decoration: underline; }
.apd-search-excerpt { font-size: 13px; color: #555; line-height: 1.45; margin: 0; }
.apd-no-results { color: #888; font-size: 14px; padding: 20px 0; }

/* ── Category nav ── */
.apd-cat-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}
.apd-cat-tag {
    display: inline-block;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    border: 1px solid #ccc;
    color: #444 !important;
    text-decoration: none;
    border-radius: 2px;
}
.apd-cat-tag:hover, .apd-cat-tag.active {
    background: #000;
    border-color: #000;
    color: #fff !important;
    text-decoration: none !important;
}

/* ── Pagination ── */
.apd-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}
.apd-page-btn {
    padding: 6px 14px;
    border: 1px solid #ccc;
    font-size: 12px;
    font-weight: 600;
    color: #333 !important;
    text-decoration: none;
    background: #fff;
}
.apd-page-btn:hover, .apd-page-btn.active {
    background: #000;
    border-color: #000;
    color: #fff !important;
    text-decoration: none !important;
}

/* ── Breaking ticker ── */
.apd-ticker {
    background: var(--ticker-bg, #cc0000);
    color: var(--ticker-text, #fff);
    display: flex;
    align-items: center;
    overflow: hidden;
    height: 32px;
    max-width: var(--max-width, 1060px);
    margin: 0 auto;
}
.apd-ticker-label {
    flex-shrink: 0;
    background: #000;
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .15em;
    text-transform: uppercase;
    padding: 0 12px;
    height: 100%;
    display: flex;
    align-items: center;
}
.apd-ticker-track {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
}
.apd-ticker-inner {
    display: flex;
    align-items: center;
    height: 100%;
    animation: ticker-scroll 30s linear infinite;
    white-space: nowrap;
}
.apd-ticker-inner a {
    color: #fff !important;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    margin-right: 48px;
    flex-shrink: 0;
}
.apd-ticker-inner a:hover { text-decoration: underline; }
@keyframes ticker-scroll {
    0%   { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}
.apd-ticker:hover .apd-ticker-inner { animation-play-state: paused; }

/* ── Header search ── */
.apd-header-search {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}
.apd-header-search input {
    padding: 5px 10px;
    border: 1px solid #ccc;
    font-size: 12px;
    width: 220px;
}
.apd-header-search button {
    background: #000;
    color: #fff;
    border: none;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
}

/* ── Dark mode ── */
.apd-dark-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #000;
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
body.dark-mode {
    --bg: #111;
    --link: #e0e0e0;
    --header-bg: #111;
    --col-bdr: #333;
    --label: #888;
    background: #111;
    color: #e0e0e0;
}
body.dark-mode a, body.dark-mode a:visited { color: #e0e0e0 !important; }
body.dark-mode a:hover { color: var(--hover, #cc0000) !important; }
body.dark-mode .apd-link { border-color: #2a2a2a; }
body.dark-mode .apd-center-link { border-color: #2a2a2a; }
body.dark-mode .apd-article { border-color: #333; }
body.dark-mode .apd-article-body { color: #ddd; }
body.dark-mode .apd-grid { border-color: #333; }
body.dark-mode .apd-col-left, body.dark-mode .apd-col-center { border-color: #333; }
body.dark-mode .apd-header { background: #111; border-color: #444; }
body.dark-mode .apd-sitename { color: #fff !important; }
body.dark-mode .apd-inner-page { color: #ddd; }
body.dark-mode .apd-search-form input { background: #222; color: #ddd; border-color: #444; }
body.dark-mode .apd-search-result { border-color: #2a2a2a; }
body.dark-mode .apd-search-title { color: #e0e0e0 !important; }
body.dark-mode .apd-search-excerpt { color: #aaa; }
body.dark-mode .apd-dark-toggle { background: #fff; color: #000; }

/* ── Reading progress bar ── */
#apd-progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--hl, #cc0000); width: 0; z-index: 9999; }

/* ── Share buttons ── */
.apd-share {
    display: flex;
    gap: 8px;
    margin: 16px 0;
    flex-wrap: wrap;
}
.apd-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    text-decoration: none !important;
    border-radius: 2px;
    cursor: pointer;
    border: none;
}
.apd-share-x       { background: #000; color: #fff !important; }
.apd-share-fb      { background: #1877f2; color: #fff !important; }
.apd-share-copy    { background: #666; color: #fff !important; cursor: pointer; }
.apd-share-btn:hover { opacity: .85; text-decoration: none !important; }

/* ── Related stories ── */
.apd-related {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 2px solid #000;
}
.apd-related-title {
    font-family: var(--font-hl, "Arial Black", Arial, sans-serif);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #000;
    margin-bottom: 10px;
}
.apd-related-list { list-style: none; margin: 0; padding: 0; }
.apd-related-list li {
    padding: 6px 0;
    border-bottom: 1px dotted #ddd;
    font-size: 13px;
}
.apd-related-list li:last-child { border: none; }
.apd-related-list a { color: var(--link, #000) !important; }
.apd-related-list a:hover { color: var(--hover, #cc0000) !important; }

/* ── Video embed ── */
.apd-video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 16px 0;
    background: #000;
}
.apd-video-wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

/* ── Andy's Take post type ── */
.apd-andystake {
    border-left: 4px solid #1a3a6b;
    padding-left: 12px;
    margin-bottom: 6px;
}
.apd-andystake-label {
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #1a3a6b;
    display: block;
    margin-bottom: 2px;
}

/* ── Podcast sticky player ── */
.apd-podcast-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    color: #fff;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 998;
    font-size: 12px;
}
.apd-podcast-bar-title { font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apd-podcast-bar iframe { border: none; height: 32px; flex: 2; min-width: 200px; }
.apd-podcast-bar-close { background: none; border: none; color: #888; font-size: 18px; cursor: pointer; padding: 0 4px; }
.apd-podcast-bar-close:hover { color: #fff; }

/* ── Reading time ── */
.apd-reading-time {
    font-size: 11px;
    color: #999;
    font-style: italic;
}

/* Print styles ── */
@media print {
    .apd-topnav, .apd-header-search, .apd-ticker, .apd-share,
    .apd-related, .apd-podcast-bar, .apd-dark-toggle,
    .apd-footer, #apd-progress, .apd-article-nav,
    header .apd-tagline, header .apd-clock { display: none !important; }
    body { background: #fff; color: #000; font-size: 12pt; }
    .apd-article { max-width: 100%; border: none; padding: 0; }
    .apd-article-title { font-size: 20pt; }
    .apd-article-body { font-size: 11pt; line-height: 1.6; }
    a { color: #000 !important; text-decoration: none; }
    .apd-article-body a::after { content: ' (' attr(href) ')'; font-size: 9pt; color: #666; }
}

@media (max-width: 700px) {
    .apd-search-thumb { width: 80px; height: 60px; }
    .apd-header-search { display: none; }
    .apd-share-btn { font-size: 11px; padding: 5px 10px; }
}

/* External link indicator */
.apd-ext-label {
    font-size: 9px;
    color: #999;
    font-weight: 400;
    letter-spacing: 0;
    margin-left: 3px;
}

/* ── Email bottom bar — redesigned ── */
.apd-email-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #1a1a1a;
  color: #fff;
  z-index: 9990;
  transform: translateY(100%);
  transition: transform .4s ease;
  border-top: 3px solid var(--hl, #cc0000);
}
.apd-email-bar.show { transform: translateY(0); }

.apd-email-bar-close {
  position: absolute;
  top: 10px; right: 14px;
  background: #333; border: 1px solid #555;
  color: #ccc; font-size: 16px;
  cursor: pointer; line-height: 1;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
}
.apd-email-bar-close:hover { background: #555; color: #fff; }

.apd-email-bar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 56px 14px 20px;
  flex-wrap: wrap;
}
.apd-email-bar-text { flex-shrink: 0; }
.apd-email-bar-title {
  font-family: var(--font-hl, "Arial Black", Arial, sans-serif);
  font-size: 14px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
}
.apd-email-bar-sub { font-size: 12px; color: #aaa; margin-top: 2px; }
.apd-email-bar-form {
  display: flex; gap: 8px;
  flex: 1; min-width: 220px;
}
.apd-email-bar-form input[type=email] {
  flex: 1; padding: 9px 12px;
  border: 1px solid #444; font-size: 13px;
  background: #2a2a2a; color: #fff;
  border-radius: 3px; min-width: 0;
}
.apd-email-bar-form input[type=email]::placeholder { color: #666; }
.apd-email-bar-form input[type=email]:focus { outline: none; border-color: var(--hl, #cc0000); }
.apd-email-bar-form button[type=submit] {
  background: var(--hl, #cc0000); color: #fff;
  border: none; padding: 9px 18px;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  cursor: pointer; border-radius: 3px; white-space: nowrap;
}
.apd-email-bar-form button:hover { opacity: .9; }
.apd-email-bar-success { font-size: 13px; color: #4caf50; font-weight: 700; }

@media (max-width: 600px) {
  .apd-email-bar-inner { flex-direction: column; align-items: stretch; padding: 14px 50px 14px 14px; gap: 10px; }
  .apd-email-bar-form { width: 100%; }
  .apd-dark-toggle { bottom: 80px !important; }
}

/* ── Dark mode pre-paint (avoids flash) ── */
html.dark-mode-pre { background: #111; }
html.dark-mode-pre body { background: #111; color: #e0e0e0; }
