/* BACC theme: structural/behavioral CSS only. Styling is yours.
   Everything here is required for a feature to work; replace values freely, but keep the rules. */

/* Accessibility */
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 8px; top: 8px; z-index: 10001; }
.screen-reader-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Reader preferences: hooks on <html data-*>. Map these to your type scale. */
:root { --font-scale: 1; --line-height: 1.6; --content-width: 720px; }
[data-font-size="sm"] { --font-scale: .9; }   [data-font-size="lg"] { --font-scale: 1.15; }
[data-line-height="sm"] { --line-height: 1.4; } [data-line-height="lg"] { --line-height: 1.85; }
[data-content-width="sm"] { --content-width: 600px; } [data-content-width="lg"] { --content-width: 900px; }
.article-content { font-size: calc(1rem * var(--font-scale)); line-height: var(--line-height); max-width: var(--content-width); }
.segments button[aria-pressed="true"] { font-weight: bold; }

/* Dark mode: <html class="dark|light">. Put your palettes here. */
.dark .icon-light, .light .icon-dark { display: none; }

/* Breaking bar marquee */
.breaking-dismissed [data-breaking] { display: none; }
.breaking-bar { display: flex; align-items: center; }
.breaking-bar-track { flex: 1; overflow: hidden; }
.breaking-bar-items { display: flex; width: max-content; gap: 2rem; }
.breaking-bar-track.is-running .breaking-bar-items { animation: bacc-marquee 40s linear infinite; }
.breaking-bar-track:hover .breaking-bar-items { animation-play-state: paused; }
@keyframes bacc-marquee { to { transform: translateX(-50%); } }

/* Navbar */
.navbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.navbar-start { display: flex; align-items: center; gap: 1rem; flex: 1; min-width: 0; }
.navbar-nav { flex: 1; min-width: 0; overflow: hidden; }
.navbar-nav .nav { display: flex; flex-wrap: nowrap; list-style: none; margin: 0; padding: 0; }
.navbar-end { display: flex; align-items: center; gap: .5rem; }
.nav-toggle { display: none; }
@media (max-width: 900px) { .navbar-nav { display: none; } .nav-toggle { display: inline-flex; } }

/* Popovers (native popover API) */
[popover] { margin: 0; inset: auto; }
.popover::backdrop { background: transparent; }
.mobile-nav[popover] { inset: 0; width: 100%; height: 100%; }
.nav-menu-list, .bookmarks-list, .share-list, .social-links, .tag-posts-list, .composer-list, .widget-list { list-style: none; margin: 0; padding: 0; }

/* Carousels */
.carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track > * { flex: 0 0 auto; scroll-snap-align: start; }
.carousel:not(.is-scrollable) .carousel-controls { visibility: hidden; }

/* Home composer numbering */
.composer-list { counter-reset: composer; }
.composer-item { counter-increment: composer; }
.composer-item::before { content: counter(composer, decimal-leading-zero); }

/* Posts + sidebar */
.section-posts.has-sidebar { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .section-posts.has-sidebar { grid-template-columns: minmax(0, 1fr) 320px; } }

/* Post card: whole card clickable via title link */
.post-card { position: relative; }
.post-card-title a::after { content: ""; position: absolute; inset: 0; }
.post-card-actions, .post-card-tag, .post-card-by a { position: relative; z-index: 1; }
.bookmark-toggle[aria-pressed="true"] svg { fill: currentColor; }

/* Button / form states */
.when-loading, .when-success, .load-more .when-loading { display: none; }
.is-loading .when-idle, form.loading .when-idle, form.success .when-idle { display: none; }
.is-loading .when-loading, form.loading .when-loading { display: inline; }
form.success .when-success { display: inline; }
.subscribe-error:empty { display: none; }

/* Scroll progress ring */
.scroll-progress { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); opacity: 0; pointer-events: none; z-index: 900; }
.scroll-progress.is-visible { opacity: 1; pointer-events: auto; }
.scroll-progress svg { width: 40px; height: 40px; transform: rotate(-90deg); }
.scroll-progress circle { fill: none; stroke: currentColor; stroke-width: 3; stroke-dasharray: 0 100; }

/* Floating subscribe + sticky player */
.floating-subscribe { position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 950; }
.sticky-player { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 960; display: flex; align-items: center; }
.sticky-player .when-playing, .sticky-player.is-playing .when-paused { display: none; }
.sticky-player.is-playing .when-playing { display: inline; }
.sticky-player-progress { position: relative; height: 3px; }
.sticky-player-progress-bar { position: absolute; inset: 0 auto 0 0; width: 0; background: currentColor; }

/* Footer wordmark (JS sets font-size to fill width) */
.footer-title { overflow: hidden; line-height: 1; }

/* Ghost editor cards (required by Ghost) */
.kg-width-wide { width: min(1200px, 100vw - 32px); margin-left: 50%; transform: translateX(-50%); }
.kg-width-full { width: 100vw; margin-left: 50%; transform: translateX(-50%); }
.kg-width-wide img, .kg-width-full img { width: 100%; }

@media (prefers-reduced-motion: reduce) { .breaking-bar-items { animation: none !important; } }

/* Ghost custom fonts (Settings → Design → Typography). Remove if you set fonts yourself. */
body { font-family: var(--gh-font-body, inherit); }
h1, h2, h3, h4, h5, h6, .section-title, .post-card-title, .article-title { font-family: var(--gh-font-heading, inherit); }
