/* ==========================================================
   Zine: loud, cheeky and handmade-looking. Thin black
   outlines, hard drop shadows that pop on hover, hot pink
   with yellow and mint stickers, Space Grotesk throughout.
   On the Classic styles.
   ========================================================== */

[data-bs-theme="light"] .theme-zine {
    --zn-bg: #f4f4f0;            /* off-white paper */
    --zn-ink: #000000;           /* outlines, text, shadows */
    --zn-text: #000000;
    --zn-muted: #4a4a46;         /* 8:1 on the paper */
    --zn-card: #ffffff;
    --zn-line: #000000;
    --zn-soft: #ffffff;          /* quotes, table stripes */
    --zn-cover: #000000;         /* front cover panel */
    --zn-link: color-mix(in srgb, var(--fc-accent) 30%, #6b1d5c);
}
[data-bs-theme="dark"] .theme-zine {
    --zn-bg: #000000;
    --zn-ink: #ffffff;
    --zn-text: #f2f2f2;
    --zn-muted: #b8b8b2;
    --zn-card: #242423;
    --zn-line: rgba(255, 255, 255, .35);
    --zn-soft: #242423;
    --zn-cover: #242423;
    --zn-link: var(--fc-accent);
}

.theme-zine {
    --zn-yellow: #ffc900;
    --zn-shadow: 4px 4px 0 var(--zn-ink);
    --bs-body-bg: var(--zn-bg);
    --bs-body-color: var(--zn-text);
    --bs-emphasis-color: var(--zn-ink);
    --bs-secondary-color: var(--zn-muted);
    --bs-border-color: var(--zn-line);
    --bs-tertiary-bg: var(--zn-soft);
    background: var(--zn-bg);
    color: var(--zn-text);
}
.theme-zine h1, .theme-zine h2, .theme-zine h3, .theme-zine h4 { color: var(--zn-ink); font-weight: 500; letter-spacing: -.025em; }
.theme-zine .navbar-brand { font-weight: 700 !important; letter-spacing: -.03em; }
.theme-zine.width-wide .container { max-width: 1320px; }

/* ---- Buttons: outlined blocks that pop ------------------------------------ */
.theme-zine .btn { border-radius: 4px; border: 1px solid #000 !important; font-weight: 500; font-size: 1.05rem; padding: .75rem 1.4rem; transition: transform .12s, box-shadow .12s; }
.theme-zine .btn:hover { transform: translate(-3px, -3px); box-shadow: 3px 3px 0 #000; }
.theme-zine .btn:active { transform: none; box-shadow: none; }
.theme-zine .btn-primary {
    --bs-btn-bg: var(--fc-accent); --bs-btn-color: #000; --bs-btn-hover-bg: var(--fc-accent); --bs-btn-hover-color: #000;
    --bs-btn-active-bg: var(--fc-accent); --bs-btn-active-color: #000;
}
.zn-btn-outline { --bs-btn-bg: var(--zn-card); --bs-btn-color: var(--zn-ink); --bs-btn-hover-bg: var(--zn-card); --bs-btn-hover-color: var(--zn-ink); --bs-btn-active-bg: var(--zn-card); --bs-btn-active-color: var(--zn-ink); }
[data-bs-theme="dark"] .theme-zine .zn-btn-outline { border-color: var(--zn-line) !important; }
[data-bs-theme="dark"] .theme-zine .btn:hover { box-shadow: 3px 3px 0 var(--fc-accent); }
.theme-zine .zn-btn-outline-light { --bs-btn-bg: transparent; --bs-btn-color: #fff; --bs-btn-hover-bg: #fff; --bs-btn-hover-color: #000; --bs-btn-active-bg: #fff; --bs-btn-active-color: #000; border-color: #fff !important; }
.theme-zine .zn-btn-outline-light:hover { box-shadow: 3px 3px 0 var(--fc-accent); }
.zn-btn-ink { --bs-btn-bg: #000; --bs-btn-color: #fff; --bs-btn-hover-bg: #000; --bs-btn-hover-color: #fff; --bs-btn-active-bg: #000; --bs-btn-active-color: #fff; }
.theme-zine .zn-band .btn:hover { box-shadow: 3px 3px 0 #fff; }

/* ---- Header: a black bar with pill links ------------------------------------ */
.theme-zine .site-header { background: #000; border-bottom: 1px solid #000 !important; }
[data-bs-theme="dark"] .theme-zine .site-header { border-bottom-color: var(--zn-line) !important; }
.theme-zine .site-header .navbar-brand, .theme-zine .site-header .navbar-brand i { color: #fff !important; }
.theme-zine .site-header .nav-underline { --bs-nav-underline-border-width: 0; }
.theme-zine .site-header .nav-link { color: #fff !important; border: 1px solid transparent; border-radius: 999px; padding: .4rem 1rem; font-weight: 500; }
.theme-zine .site-header .nav-link:hover { border-color: rgba(255, 255, 255, .5); }
.theme-zine .site-header .nav-link.active { background: #fff; color: #000 !important; }
.theme-zine.header-split .site-header + .mb-4 { margin-bottom: 0 !important; }
@media (max-width: 575.98px) { .theme-zine .site-header .nav { gap: .1rem !important; } .theme-zine .site-header .nav-link { padding: .35rem .6rem; } }

/* ---- Home: shared ------------------------------------------------------- */
.zn-home { padding-top: 1.5rem; padding-bottom: 1rem; }
.zn-section { margin: 4rem 0; }
.zn-h1 { font-size: clamp(2.3rem, 1.2rem + 3.6vw, 4.6rem); line-height: 1; margin-bottom: 1.1rem; overflow-wrap: anywhere; }
.zn-h2 { font-size: clamp(1.9rem, 1.2rem + 2vw, 3rem); line-height: 1.05; margin-bottom: 1rem; }
.zn-lead { font-size: 1.2rem; line-height: 1.5; color: var(--zn-muted); max-width: 40rem; }
.zn-meta { color: var(--zn-muted); font-size: .88rem; margin: 0; }

/* Stickers: outlined tags in five colours, each topic keeps its own */
.zn-sticker { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 500; color: #000; border: 1px solid #000; border-radius: 999px; padding: .25rem .75rem; margin: 0 0 .75rem; }
.zn-tint-0 { background: #ff90e8; }
.zn-tint-1 { background: #ffc900; }
.zn-tint-2 { background: #90e8c1; }
.zn-tint-3 { background: #ff8a65; }
.zn-tint-4 { background: #b8a8ff; }

/* ---- 1. Front cover ---------------------------------------------------------- */
.zn-cover { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: clamp(1.5rem, 4vw, 3.5rem); background: var(--zn-cover); color: #fff; border: 1px solid #000; border-radius: 4px; padding: clamp(1.75rem, 5vw, 4.5rem); overflow: hidden; }
[data-bs-theme="dark"] .zn-cover { border-color: var(--zn-line); }
.zn-cover-plain { grid-template-columns: 1fr; text-align: center; }
.zn-cover-plain .zn-cover-text { max-width: 54rem; margin: 0 auto; }
.zn-cover-plain .zn-lead { margin-left: auto; margin-right: auto; }
.zn-cover-plain .d-flex { justify-content: center; }
.zn-cover-text { position: relative; z-index: 1; }
.zn-cover .zn-h1, .zn-cover .zn-h1 a { color: #fff; text-decoration: none; }
.zn-cover .zn-h1 a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: .1em; text-decoration-color: var(--fc-accent); }
.zn-cover .zn-lead { color: rgba(255, 255, 255, .82); margin-bottom: 1.75rem; }
.zn-cover-pic { position: relative; z-index: 1; }
.zn-cover-img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid #fff; border-radius: 4px; box-shadow: 8px 8px 0 var(--fc-accent); transform: rotate(-1.5deg); }
/* Sticker shapes: a pink coin and a yellow star, drawn in CSS */
.zn-shape { position: absolute; z-index: 0; border: 1px solid #000; pointer-events: none; }
.zn-shape-coin { width: 130px; height: 130px; border-radius: 50%; background: var(--fc-accent); top: -42px; right: 38%; box-shadow: 0 10px 0 color-mix(in srgb, var(--fc-accent) 60%, #000); }
.zn-shape-star { width: 90px; height: 90px; background: var(--zn-yellow); bottom: -20px; left: -18px; border: 0; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); transform: rotate(-12deg); }
@media (max-width: 991.98px) {
    .zn-cover { grid-template-columns: 1fr; }
    .zn-cover-pic { max-width: 34rem; }
    .zn-shape-coin { width: 90px; height: 90px; right: 8%; top: -30px; }
}

/* ---- 2. Topic stickers ---------------------------------------------------------- */
.zn-topics { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.75rem 0 1rem; }
.zn-sticker-link { font-size: 1rem; padding: .45rem 1.05rem; margin: 0; text-decoration: none; transition: transform .12s, box-shadow .12s; }
.zn-sticker-link:hover { color: #000; transform: translate(-3px, -3px) rotate(-2deg); box-shadow: 3px 3px 0 var(--zn-ink); }
.zn-count { font-size: .78rem; background: #fff; border: 1px solid #000; border-radius: 999px; padding: 0 .45rem; }

/* ---- Cards (partials/card.php) --------------------------------------------- */
.zn-card { background: var(--zn-card); border: 1px solid var(--zn-line); border-radius: 4px; overflow: hidden; transition: transform .12s, box-shadow .12s; }
.zn-card:hover { transform: translate(-4px, -4px); box-shadow: var(--zn-shadow); }
[data-bs-theme="dark"] .zn-card:hover { box-shadow: 4px 4px 0 var(--fc-accent); }
.zn-thumb { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-bottom: 1px solid var(--zn-line); }
.zn-body { padding: 1.1rem 1.25rem 1.35rem; }
.zn-title { font-size: 1.3rem; line-height: 1.2; margin: 0 0 .55rem; }
.zn-title a { color: var(--zn-ink); text-decoration: none; }
.zn-card:hover .zn-title a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .12em; }
.zn-summary { color: var(--zn-muted); font-size: .98rem; margin: 0 0 .7rem; }

/* ---- 4. Most read ---------------------------------------------------------- */
.zn-popular { background: var(--zn-yellow); color: #000; border: 1px solid #000; border-radius: 4px; padding: clamp(1.75rem, 4vw, 3.25rem); margin: 4rem 0; }
.zn-popular .zn-h2 { color: #000; }
.zn-rank { list-style: none; counter-reset: zn; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 2.5rem; }
@media (max-width: 991.98px) { .zn-rank { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575.98px) { .zn-rank { grid-template-columns: 1fr; } }
.zn-rank li { counter-increment: zn; display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; align-items: start; padding: 1.1rem 0; border-top: 1px solid #000; }
.zn-rank li::before { content: counter(zn); grid-row: span 2; font-size: 3.4rem; font-weight: 700; line-height: .85; color: #000; -webkit-text-stroke: 0; min-width: 2.4rem; }
.zn-rank a { color: #000; font-size: 1.2rem; font-weight: 500; line-height: 1.25; text-decoration: none; }
.zn-rank li:hover a { text-decoration: underline; text-decoration-thickness: 2px; }
.zn-rank-meta { color: #3a3a36; font-size: .88rem; margin-top: .3rem; }

/* ---- 5. Closing band --------------------------------------------------------- */
.zn-band { background: var(--fc-accent); color: #000; border: 1px solid #000; border-radius: 4px; padding: clamp(2.5rem, 7vw, 5.5rem) clamp(1.5rem, 5vw, 4rem); margin: 4rem 0 1rem; text-align: center; }
.zn-band .zn-h1, .zn-band h2 { color: #000; max-width: 52rem; margin-left: auto; margin-right: auto; }
.zn-band .zn-lead { color: #000; margin: 0 auto 1.75rem; }
.zn-band .fc-newsletter { background: none !important; border: 0 !important; box-shadow: none !important; margin: 0 auto !important; max-width: 38rem; color: #000; }
.zn-band .fc-newsletter .card-body { padding: 0 !important; }
.zn-band .fc-newsletter h2 { font-size: clamp(2rem, 1.2rem + 3vw, 3.6rem) !important; line-height: 1; }
.zn-band .fc-newsletter .text-body-secondary { color: #000 !important; }
.zn-band .fc-subscribe { justify-content: center; }
.zn-band .fc-newsletter .form-control { border: 1px solid #000; border-radius: 4px; padding: .8rem 1.1rem; width: auto; flex: 1 1 240px; background: #fff; color: #000; }
.zn-band .fc-newsletter .btn-primary { --bs-btn-bg: #000; --bs-btn-color: #fff; --bs-btn-hover-bg: #000; --bs-btn-hover-color: #fff; }

/* ---- Articles: title box, tables, quotes, code ------------------------------- */
/* Classic forces grey cards in dark mode (!important); Zine's cards stay outlined. */
.theme-zine .card, .theme-zine .bg-body-tertiary { background-color: var(--zn-card) !important; border-color: var(--zn-line) !important; border-radius: 4px; }
.theme-zine .card-header { background: var(--zn-yellow); color: #000; border-color: var(--zn-line); }
.theme-zine main > .container > header.card { background: var(--zn-card); box-shadow: 6px 6px 0 var(--fc-accent); margin-top: 1.5rem; }
.theme-zine main > .container > header.card h1 { font-weight: 500; line-height: 1.02; }
.theme-zine .content-body img { border: 1px solid var(--zn-line); border-radius: 4px; }
.theme-zine .content-body h2 { border-bottom: 1px solid var(--zn-line); padding-bottom: .35rem; }
.theme-zine .content-body table { width: 100%; border-collapse: collapse; border: 1px solid var(--zn-line); margin: 1.75rem 0; font-size: .95rem; }
.theme-zine .content-body th { background: var(--fc-accent); color: #000; font-weight: 500; text-align: left; padding: .75rem 1rem; border: 1px solid #000; }
.theme-zine .content-body td { padding: .7rem 1rem; border: 1px solid var(--zn-line); }
.theme-zine .content-body blockquote { background: var(--zn-yellow); color: #000; border: 1px solid #000; border-radius: 4px; box-shadow: 4px 4px 0 #000; padding: 1.2rem 1.4rem; margin: 1.75rem 0; font-size: 1.1rem; }
.theme-zine .content-body blockquote > :last-child { margin-bottom: 0; }
.theme-zine .content-body pre { background: #000; color: #f2f2f2; border: 1px solid var(--zn-line); border-radius: 4px; padding: 1rem 1.2rem; }
.theme-zine .fc-disclosure { background: var(--zn-card); border: 1px dashed var(--zn-line) !important; border-radius: 4px; padding: .8rem 1rem !important; }
.theme-zine .badge { border: 1px solid #000; border-radius: 999px; font-weight: 500; }
.theme-zine main .rounded-3, .theme-zine main .rounded-4, .theme-zine main .rounded { border-radius: 4px !important; }

/* ---- Links and paging --------------------------------------------------------- */
/* :where() keeps this weak, so styled links (cards, stickers, buttons) keep their own colour. */
:where(.theme-zine) a { color: var(--zn-link); }
.theme-zine .pagination { gap: .45rem; --bs-pagination-bg: var(--zn-card); --bs-pagination-color: var(--zn-ink); --bs-pagination-hover-color: #000; --bs-pagination-hover-bg: var(--fc-accent); --bs-pagination-active-bg: var(--fc-accent); --bs-pagination-active-border-color: #000; --bs-pagination-active-color: #000; --bs-pagination-border-color: var(--zn-line); --bs-pagination-disabled-bg: transparent; }
.theme-zine .page-link { border-radius: 4px !important; min-width: 2.7rem; text-align: center; font-weight: 500; }
.theme-zine .form-control, .theme-zine .form-select { border-radius: 4px; border-color: var(--zn-line); }

/* ---- Footer: black, with a pink line on top ------------------------------------ */
.theme-zine .site-footer { background: #000; color: #b8b8b2; border-top: 6px solid var(--fc-accent) !important; margin-top: 4rem !important; padding-top: 2.5rem !important; }
.theme-zine .site-footer .link-body-emphasis, .theme-zine .site-footer .text-body-emphasis { color: #fff !important; }
.theme-zine .site-footer .text-body-emphasis { font-weight: 700; letter-spacing: -.03em; }
.theme-zine .site-footer .text-body-secondary, .theme-zine .site-footer .link-secondary { color: #b8b8b2 !important; }
.theme-zine .site-footer .nav-link:hover { color: var(--fc-accent) !important; }
