/* === Base === */
@font-face {
    font-family: 'Catharsis Requiem';
    src: local('Catharsis Requiem Bold'), local('CatharsisRequiemBold'),
        url('../fonts/CatharsisRequiemBold.woff2') format('woff2'),
        url('../fonts/CatharsisRequiemBold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Catharsis Requiem';
    src: local('Catharsis Requiem'), local('CatharsisRequiem'),
        url('../fonts/CatharsisRequiem.woff2') format('woff2'),
        url('../fonts/CatharsisRequiem.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* === Dark theme (default) === */
:root {
    --bg-main:          #1B1A20;
    --bg-secondary:     #241C29;
    --accent-primary:   #4B2E53;
    --accent-secondary: #7A6C84;
    --accent-highlight: #B59A6A;
    --link-colour:      #8E7FA3;
    --text-colour:      #D4CAD8;
    --heading-colour:   #C9A86C;
}

/* === Light theme === */
html.light {
    --bg-main:          #F3EFF7;
    --bg-secondary:     #E8E1EF;
    --accent-primary:   #4B2E53;
    --accent-secondary: #6E5E79;
    --accent-highlight: #8C6F3F;
    --link-colour:      #5F4E6E;
    --text-colour:      #2C1F35;
    --heading-colour:   #4B2E53;
}

html {
    scroll-behavior: smooth;
}

::selection {
    background: var(--accent-primary);
    color: var(--heading-colour);
}

hr {
    border: none;
    border-top: 1px solid var(--accent-primary);
    margin: 48px 0;
}

body {
    margin: 0;
    background: var(--bg-main);
    color: var(--text-colour);
    font-family: "IBM Plex Sans", sans-serif;
    line-height: 1.7;
    transition: background 0.2s ease, color 0.2s ease;
}

/* === Dragon watermark === */
/*
 * 263×953px portrait PNG, pre-coloured #8E7FA3, fully transparent background.
 * Scales to auto width / 100% element height so it runs the full viewport.
 * Clean PNG transparency means no gradient mask or blend mode tricks needed —
 * the dragon's own silhouette provides all the edge definition.
 *
 * left: -80px bleeds the head and belly off the left viewport edge.
 * The PNG is narrow enough (~298px at 1080px height) that the dragon never
 * reaches the content column even without a gradient cutoff.
 *
 * Opacity is the single tuning knob.
 */
body::before {
    content: '';
    position: fixed;
    left: -80px;
    top: 0;
    bottom: 0;
    width: 500px;
    background: url('../images/dragon_cropped_coloured_transparent_263x953.png') left top / auto 100% no-repeat;
    opacity: 0.20;
    pointer-events: none;
    z-index: 0;
}

/* Light mode: PNG is #8E7FA3 which reads slightly darker against the pale
   background — pull opacity back a touch to keep the same visual weight */
html.light body::before {
    opacity: 0.12;
}

/* === Theme toggle === */

#theme-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    background: var(--bg-secondary);
    border: 1px solid var(--accent-secondary);
    color: var(--accent-secondary);
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* === Layout === */

.content {
    max-width: 740px;
    margin: 0 auto;
    padding: 64px 24px;
}

.pagination {
    display: flex;
    justify-content: space-between;
    margin-top: 64px;
}

.pagination a {
    color: var(--link-colour);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.pagination a:hover {
    border-bottom: 1px solid var(--accent-highlight);
}

/* === Header === */

.site-header {
    text-align: center;
    padding: 120px 24px 80px;
    position: relative;
    /* overflow: hidden removed — the ::before pseudo-element is bounded by
       inset: 0 so it doesn't need clipping, and hidden was cutting off the
       nav dropdown menus. */
}

.site-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../images/drakescale-transparent-long-640x1142.png') 50% 0 / 100% auto no-repeat;
    opacity: 0.35;
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

html.light .site-header::before {
    filter: invert(1);
    opacity: 0.45;
}

.site-header > * {
    position: relative;
    z-index: 1;
}

.site-title {
    font-family: "Catharsis Requiem", serif;
    font-weight: bold;
    letter-spacing: 0.15em;
    font-size: 3.5rem;
    position: relative;
    margin: 0;
}

@media (min-width: 900px) {
    .site-title { font-size: 5rem; }
}

.site-title a {
    text-decoration: none;
    color: var(--heading-colour);
}

.site-title .comma {
    color: var(--link-colour);
    font-size: 1.1em;
}

.sigil {
    margin: 20px auto 0;
    color: var(--accent-highlight);
    opacity: 0.7;
}

/* === Typography === */

h1 { font-size: 2.5rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }
p  { font-size: 1rem; }

@media (min-width: 900px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2rem; }
}

/* === Navigation === */

.site-nav {
    margin-top: 40px;
}

.site-nav a {
    color: var(--accent-secondary);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
    margin: 0 12px;
}

.site-nav a:hover {
    color: var(--heading-colour);
    border-bottom: 1px solid var(--accent-highlight);
}

.site-nav a:focus,
button:focus {
    outline: 1px solid var(--accent-highlight);
    outline-offset: 3px;
}

.nav-identity {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--accent-secondary);
    opacity: 0.6;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    margin-left: 4px;
    padding-left: 16px;
    border-left: 1px solid var(--accent-primary);
}

/* === Nav dropdowns === */

.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-trigger {
    background: none;
    border: none;
    padding: 0;
    margin: 0 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-secondary);
    transition: color 0.2s ease;
}

.nav-dropdown-trigger::after {
    content: ' \25BE'; /* ▾ small triangle */
    font-size: 0.85em;
    letter-spacing: 0;
}

.nav-dropdown-trigger:hover,
.nav-dropdown-trigger[aria-expanded="true"] {
    color: var(--heading-colour);
}

.nav-dropdown-trigger:focus {
    outline: 1px solid var(--accent-highlight);
    outline-offset: 3px;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 16px);
    left: 50%;
    transform: translateX(-50%);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    background: var(--bg-secondary);
    border: 1px solid var(--accent-primary);
    min-width: 110px;
    text-align: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.nav-dropdown-trigger[aria-expanded="true"] + .nav-dropdown-menu {
    opacity: 1;
    pointer-events: auto;
}

.nav-dropdown-menu li {
    margin: 0;
    padding: 0;
}

.nav-dropdown-menu a {
    display: block;
    padding: 7px 18px;
    color: var(--accent-secondary);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    border-bottom: none !important;
    transition: color 0.2s ease;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus {
    color: var(--heading-colour);
    border-bottom: none !important;
    outline: none;
}

/* === Posts === */

.post-preview {
    margin-bottom: 48px;
}

.post-preview h2,
.post-preview h3,
.archive-list h2 {
    color: var(--heading-colour);
}

.post-preview h2 a,
.post-preview h3 a {
    color: var(--heading-colour);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.post-preview h2 a:hover,
.post-preview h3 a:hover {
    border-bottom: 1px solid var(--accent-highlight);
}

.meta {
    font-size: 0.85rem;
    color: var(--accent-secondary);
    margin: 8px 0 0;
}

.meta a {
    color: var(--link-colour);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.meta a:hover {
    border-bottom: 1px solid var(--accent-highlight);
}

.post-content,
.page-content {
    font-size: 1.1rem;
}

.post-content p,
.page-content p {
    margin-bottom: 24px;
}

.post-content a,
.page-content a {
    color: var(--link-colour);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-secondary);
    transition: border-color 0.2s ease;
}

.post-content a:hover,
.page-content a:hover {
    border-bottom: 1px solid var(--accent-highlight);
}

/* === Page: about / second act === */

.page-about-header {
    margin-bottom: 48px;
}

.page-about-title {
    font-family: "Catharsis Requiem", serif;
    font-weight: bold;
    font-size: 2.4rem;
    color: var(--heading-colour);
    letter-spacing: 0.08em;
    margin: 0 0 20px;
}

.page-about-sigil {
    color: var(--accent-highlight);
    opacity: 0.6;
}

/* === Post article (feather system) === */

.post {
    margin-bottom: 64px;
    padding-bottom: 64px;
    border-bottom: 1px solid var(--accent-primary);
}

.post:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.post.pinned {
    border-left: 3px solid var(--accent-highlight);
    padding-left: 20px;
}

.post-title {
    font-weight: 500;
    color: var(--heading-colour);
    font-size: 1.8rem;
    margin: 0 0 8px;
}

@media (min-width: 900px) {
    .post-title { font-size: 2rem; }
}

.post-title a {
    color: var(--heading-colour);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.post-title a:hover {
    border-bottom: 1px solid var(--accent-highlight);
}

.post-subtitle {
    font-family: "IBM Plex Sans", sans-serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--heading-colour);
    margin: -4px 0 20px;
    line-height: 1.5;
}

/* === Feather: photo === */

.post-photo {
    margin: 24px 0;
}

.post-photo img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* === Feather: quote === */

.post-quote figure {
    margin: 24px 0;
    padding-left: 24px;
    border-left: 3px solid var(--accent-primary);
}

.post-quote blockquote {
    margin: 0;
    font-style: italic;
    font-size: 1.1rem;
}

.post-quote figcaption {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--accent-secondary);
}

/* === Feather: audio === */

.post-audio {
    margin: 24px 0;
}

.post-audio audio {
    width: 100%;
}

/* === Feather: video === */

.post-video {
    margin: 24px 0;
    position: relative;
    aspect-ratio: 16 / 9;
}

.post-video iframe,
.post-video video {
    width: 100%;
    height: 100%;
}

/* === Feather: uploader (attachment) === */

.post-attachment {
    margin: 16px 0;
    font-size: 0.9rem;
    color: var(--accent-secondary);
}

.post-attachment a {
    color: var(--link-colour);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-secondary);
    transition: border-color 0.2s ease;
}

.post-attachment a:hover {
    border-bottom: 1px solid var(--accent-highlight);
}

/* === Admin edit/delete links === */

.post .doaction {
    display: inline;
}

.post .doaction a {
    font-size: 0.8rem;
    color: var(--accent-secondary);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-secondary);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.post .doaction a:hover {
    color: var(--accent-highlight);
    border-color: var(--accent-highlight);
}

/* === Filter heading (tag/search/author/category pages) === */

.filter {
    font-size: 0.85rem;
    color: var(--accent-secondary);
    margin-bottom: 48px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--accent-primary);
}

/* === Pingbacks & comments === */

.pingbacks,
.comments {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--accent-primary);
}

.pingbacks h3,
.comments h3 {
    font-weight: 500;
    color: var(--heading-colour);
    margin-bottom: 24px;
}

.pingbacks ol,
.comments ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pingbacks li,
.comments li {
    margin-bottom: 16px;
}

.pingbacks a,
.comments a {
    color: var(--link-colour);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.pingbacks a:hover,
.comments a:hover {
    border-bottom: 1px solid var(--accent-highlight);
}

/* Individual comment layout */
.comment {
    padding: 16px 0;
    border-bottom: 1px solid var(--accent-primary);
}

.comments li:last-of-type .comment {
    border-bottom: none;
}

.comment-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 500;
    color: var(--heading-colour);
    font-size: 0.9rem;
}

.comment-permalink {
    font-size: 0.8rem;
    color: var(--accent-secondary);
    text-decoration: none;
    border-bottom: none !important;
    margin-left: auto;
    white-space: nowrap;
}

.comment-permalink:hover {
    color: var(--accent-highlight);
    border-bottom: none !important;
}

.comment-body {
    color: var(--text-colour);
    line-height: 1.65;
}

.comment-body em {
    color: var(--accent-secondary);
    font-style: italic;
}

.comment-body p:first-child { margin-top: 0; }
.comment-body p:last-child  { margin-bottom: 0; }

.comments .doaction {
    margin-top: 8px;
    font-size: 0.8rem;
    display: flex;
    gap: 12px;
}

.comments .doaction a {
    color: var(--accent-secondary);
    font-size: 0.8rem;
}

.comments .doaction a:hover {
    color: var(--accent-highlight);
}

/* === Post vibes (mood & listening) === */

.post-vibes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 20px;
    font-size: 0.85rem;
    color: var(--accent-secondary);
    font-style: italic;
    margin: 20px 0 0;
    padding: 12px 0;
    border-top: 1px dashed var(--accent-primary);
}

.vibe-mood {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.vibe-icon {
    display: inline-flex;
    align-items: center;
    color: var(--accent-highlight);
    flex-shrink: 0;
}

.vibe-icon svg {
    display: block;
}

.vibe-listening {
    display: inline-flex;
    align-items: center;
}

/* === Archive === */

.archive-list h2 {
    margin-bottom: 48px;
}

/* === Forms (login, register, controls, comments) === */

.standalone {
    max-width: 480px;
    margin: 0 auto;
}

.standalone h2 {
    font-family: "Catharsis Requiem", serif;
    color: var(--heading-colour);
    font-size: 1.8rem;
    margin: 0 0 32px;
    letter-spacing: 0.08em;
}

.standalone form,
form#add_comment,
.comment_edit {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.standalone label,
form#add_comment label,
.comment_edit label {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-secondary);
    margin-top: 16px;
}

.standalone label:first-of-type,
form#add_comment label:first-of-type,
.comment_edit label:first-of-type {
    margin-top: 0;
}

.standalone input[type="text"],
.standalone input[type="email"],
.standalone input[type="url"],
.standalone input[type="password"],
.standalone textarea,
form#add_comment input[type="text"],
form#add_comment input[type="email"],
form#add_comment input[type="url"],
form#add_comment textarea,
.comment_edit input[type="text"],
.comment_edit input[type="email"],
.comment_edit input[type="url"],
.comment_edit textarea,
.comment_edit select {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-secondary);
    border: 1px solid var(--accent-primary);
    color: var(--text-colour);
    padding: 10px 14px;
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    transition: border-color 0.2s ease;
    outline: none;
}

.standalone input[type="text"]:focus,
.standalone input[type="email"]:focus,
.standalone input[type="url"]:focus,
.standalone input[type="password"]:focus,
.standalone textarea:focus,
form#add_comment input:focus,
form#add_comment textarea:focus,
.comment_edit input:focus,
.comment_edit textarea:focus,
.comment_edit select:focus {
    border-color: var(--accent-secondary);
}

.standalone textarea,
form#add_comment textarea,
.comment_edit textarea {
    min-height: 140px;
    resize: vertical;
}

.standalone input[type="checkbox"] {
    accent-color: var(--accent-secondary);
    margin-top: 16px;
    align-self: flex-start;
}

.standalone .doaction,
form#add_comment .doaction,
.comment_edit .doaction {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 24px;
}

.standalone .doaction button,
form#add_comment .doaction button,
.comment_edit .doaction button {
    background: var(--accent-primary);
    border: 1px solid var(--accent-secondary);
    color: var(--text-colour);
    padding: 10px 28px;
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.standalone .doaction button:hover,
form#add_comment .doaction button:hover,
.comment_edit .doaction button:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-highlight);
    color: var(--heading-colour);
}

.standalone .doaction a,
form#add_comment .doaction a,
.comment_edit .doaction a {
    font-size: 0.85rem;
    color: var(--link-colour);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.standalone .doaction a:hover,
form#add_comment .doaction a:hover,
.comment_edit .doaction a:hover {
    border-bottom: 1px solid var(--accent-highlight);
}

/* "Again" parenthetical in register form */
.standalone .sub {
    font-size: 0.75em;
    color: var(--accent-secondary);
    font-weight: normal;
    text-transform: none;
    letter-spacing: 0;
}

/* Comment hint (allowed HTML/Markdown notice) */
form#add_comment small {
    font-size: 0.8rem;
    color: var(--accent-secondary);
    margin-top: 4px;
}

/* === Footer === */

.site-footer {
    text-align: center;
    padding: 64px 24px;
    font-size: 0.85rem;
    color: var(--accent-secondary);
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../images/drakescale-transparent-long-640x1142.png') 50% 50% / 100% auto no-repeat;
    opacity: 0.25;
    -webkit-mask-image: linear-gradient(to top, black 50%, transparent 100%);
    mask-image: linear-gradient(to top, black 50%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

html.light .site-footer::before {
    filter: invert(1);
    opacity: 0.35;
}

.site-footer > * {
    position: relative;
    z-index: 1;
}

.social-links {
    margin-top: 16px;
}

.social-links a {
    color: var(--accent-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0 10px;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.social-links a:hover {
    color: var(--heading-colour);
    border-bottom: 1px solid var(--accent-highlight);
}

/* === Age gate === */

#age-gate {
    display: none; /* shown by JS via .is-active */
    position: fixed;
    inset: 0;
    z-index: 8000;
    background: var(--bg-main);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

#age-gate.is-active {
    display: flex;
}

.age-gate-modal {
    max-width: 440px;
    text-align: center;
}

.age-gate-sigil {
    color: var(--accent-highlight);
    opacity: 0.6;
    margin-bottom: 24px;
}

.age-gate-title {
    font-family: "Catharsis Requiem", serif;
    font-weight: bold;
    font-size: 3rem;
    color: var(--heading-colour);
    letter-spacing: 0.1em;
    margin: 0 0 20px;
}

.age-gate-body {
    font-size: 0.95rem;
    color: var(--accent-secondary);
    line-height: 1.75;
    margin: 0 0 36px;
}

.age-gate-actions {
    display: flex;
    gap: 32px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

#age-gate-confirm {
    background: var(--accent-primary);
    border: 1px solid var(--accent-secondary);
    color: var(--text-colour);
    padding: 10px 28px;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

#age-gate-confirm:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
}

.age-gate-leave {
    color: var(--accent-secondary);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.age-gate-leave:hover {
    color: var(--heading-colour);
    border-bottom: 1px solid var(--accent-highlight);
}

/* Age gate — DOB form additions */

.age-gate-body {
    margin-bottom: 24px; /* tighter — form follows */
}

.age-gate-field {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.age-gate-label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-secondary);
}

.age-gate-dob {
    font-family: inherit;
    font-size: 1rem;
    padding: 8px 14px;
    background: var(--bg-secondary);
    color: var(--text-colour);
    border: 1px solid var(--accent-secondary);
    border-radius: 2px;
    text-align: center;
    width: 100%;
    max-width: 220px;
    cursor: pointer;
}

.age-gate-dob:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.age-gate-error {
    font-size: 0.8rem;
    color: #b05070;
    margin: 0 0 12px;
    min-height: 1.2em;
}

.age-gate-disclaimer {
    font-size: 0.72rem;
    color: var(--accent-secondary);
    opacity: 0.7;
    margin-top: 28px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* === Cookie consent banner === */

#cookie-banner {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 7000;
    background: var(--bg-secondary);
    border-top: 2px solid var(--accent-highlight);
    padding: 1.1rem 1.5rem;
}

#cookie-banner.is-active {
    display: block;
}

.cookie-inner {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem 1.5rem;
    align-items: center;
}

.cookie-text {
    flex: 1 1 300px;
    font-size: 0.8rem;
    color: var(--accent-secondary);
    line-height: 1.6;
    margin: 0;
    letter-spacing: 0.01em;
}

.cookie-text strong {
    color: var(--text-colour);
    font-weight: 500;
}

.cookie-details-btn {
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--link-colour);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    letter-spacing: 0.01em;
}

.cookie-details-btn:hover {
    color: var(--accent-highlight);
}

.cookie-details {
    width: 100%;
    font-size: 0.78rem;
    margin-top: 0.4rem;
    padding: 0.75rem 1rem;
    background: var(--bg-main);
    border-left: 2px solid var(--accent-highlight);
    line-height: 1.65;
    color: var(--accent-secondary);
}

.cookie-details ul {
    margin: 0;
    padding-left: 1.1rem;
}

.cookie-details li {
    margin-bottom: 0.4rem;
}

.cookie-details strong {
    color: var(--text-colour);
    font-weight: 500;
}

.cookie-actions {
    display: flex;
    gap: 0.6rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.cookie-btn {
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 8px 18px;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.cookie-btn-accept {
    background: var(--accent-primary);
    border: 1px solid var(--accent-secondary);
    color: var(--text-colour);
}

.cookie-btn-accept:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    color: var(--heading-colour);
}

.cookie-btn-essential {
    background: transparent;
    border: 1px solid var(--accent-secondary);
    color: var(--accent-secondary);
}

.cookie-btn-essential:hover {
    background: var(--bg-main);
    color: var(--text-colour);
}

/* Cookie banner — mobile: move to top to avoid theme toggle clash */
@media (max-width: 900px) {
    #cookie-banner {
        bottom: unset;
        top: 0;
        border-top: none;
        border-bottom: 2px solid var(--accent-highlight);
        padding: 0.9rem 1rem;
    }

    .cookie-inner {
        gap: 0.75rem 1rem;
    }

    .cookie-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* === Light theme: buttons with dark backgrounds need light text === */
/*
 * In both themes --accent-primary is a dark plum (#4B2E53).
 * Dark mode: --text-colour is light (#D4CAD8) — fine.
 * Light mode: --text-colour is dark (#2C1F35) — dark on dark, invisible.
 * Fix: force light text (--bg-main = #F3EFF7) on any dark-background button.
 */

html.light .standalone .doaction button,
html.light form#add_comment .doaction button,
html.light .comment_edit .doaction button,
html.light #age-gate-confirm,
html.light .cookie-btn-accept {
    color: var(--bg-main);
}

html.light .standalone .doaction button:hover,
html.light form#add_comment .doaction button:hover,
html.light .comment_edit .doaction button:hover {
    color: var(--heading-colour);
}

/* === Post navigation (prev/next) === */

.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 48px 0 0;
    padding-top: 32px;
    border-top: 1px solid var(--accent-primary);
}

.post-nav-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 46%;
    text-decoration: none;
    color: var(--text-colour);
    transition: color 0.2s ease;
}

.post-nav-older { align-items: flex-start; }
.post-nav-newer { align-items: flex-end; text-align: right; margin-left: auto; }

.post-nav-label {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-secondary);
    transition: color 0.2s ease;
}

.post-nav-title {
    font-size: 0.9rem;
    color: var(--heading-colour);
    line-height: 1.3;
}

.post-nav-link:hover .post-nav-label,
.post-nav-link:hover .post-nav-title {
    color: var(--accent-highlight);
}

/* === Footer privacy link === */

.privacy-link {
    margin-top: 1.2rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.55;
}

.privacy-link a {
    color: var(--accent-secondary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.privacy-link a:hover {
    color: var(--heading-colour);
    border-bottom-color: var(--accent-highlight);
}
