/* --------------------------------------------- */
/* THEME VARIABLES                               */
/* --------------------------------------------- */

:root {
    --bg-color: #0B0B0D;
    --text-color: #E6E6E6;
    --accent-color: #8A0A0A;
    --nav-bg: #0A0A0C;
    --border-color: #111215;
    --highlight: #F2E9D8;
    --frost: #556B6F;

    --font-serif: 'PirataOne', serif;
    --font-sans: system-ui, -apple-system, sans-serif;

    --sidebar-width: 280px;
}

/* --------------------------------------------- */
/* GLOBAL RESET                                  */
/* --------------------------------------------- */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* --------------------------------------------- */
/* FONT LOADING                                  */
/* --------------------------------------------- */

@font-face {
    font-family: 'PirataOne';
    src: url('../Fonts/PirataOne-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Sovereign';
    src: url('../Fonts/Sovereign.ttf') format('truetype');
}

strong, h4 {
    color: #9c3e3e;
}

/* --------------------------------------------- */
/* DROP CAPS                                     */
/* --------------------------------------------- */

main section > p::first-letter {
    color: var(--accent-color);
    font-family: 'PirataOne', serif;
    font-size: 2rem;
    float: left;
    line-height: 0.75;
    margin-right: 0.4rem;
    margin-top: 0.1rem;
}
/* --------------------------------------------- */
/* Indent                                  */
/* --------------------------------------------- */
.indent { margin-left: 2em; }
@media (max-width: 600px) { .indent { margin-left: 1em; } }
/* --------------------------------------------- */
/* Section Highlight                                 */
/* --------------------------------------------- */
.section-highlight {
    animation: section-target-highlight 2.2s ease-out;
    border-radius: 0.2rem;
}

@keyframes section-target-highlight {
    0% {
        background-color: rgba(138, 10, 10, 0.35);
        box-shadow: 0 0 0 3px rgba(138, 10, 10, 0.65);
    }
    100% {
        background-color: transparent;
        box-shadow: 0 0 0 3px transparent;
    }
}

@media (prefers-reduced-motion: reduce) {
    .section-highlight {
        animation: none;
        background-color: rgba(138, 10, 10, 0.25);
        box-shadow: 0 0 0 3px rgba(138, 10, 10, 0.5);
    }
}
/* --------------------------------------------- */
/* Death's Head image                                   */
/* --------------------------------------------- */
.deaths-head {
    width: 75px;      /* ideal desktop size */
    max-width: 100%;   /* prevents overflow on small screens */
    height: auto;      /* keeps proportions correct */
    display: block;
    margin: 2rem auto; /* centers the image */
}
@media (max-width: 500px) {
    .deaths-head {
        width: 120px;   /* slightly smaller for tiny screens */
    }
}
/* --------------------------------------------- */
/* Divider Image 2                               */
/* --------------------------------------------- */
.divider-image2 {
    width: 25px;      /* ideal desktop size */
    max-width: 100%;   /* prevents overflow on small screens */
    height: auto;      /* keeps proportions correct */
    display: block;
    margin: 2rem auto; /* centers the image */
}
@media (max-width: 500px) {
    .divider-image2 {
        width: 120px;   /* slightly smaller for tiny screens */
    }
}
/* --------------------------------------------- */
/* winged angel image                                   */
/* --------------------------------------------- */
.winged-angel {
    width: 400px;      /* ideal desktop size */
    max-width: 100%;   /* prevents overflow on small screens */
    height: auto;      /* keeps proportions correct */
    display: block;
    margin: 2rem auto; /* centers the image */
}
@media (max-width: 500px) {
    .winged-angel {
        width: 120px;   /* slightly smaller for tiny screens */
    }
}
/* --------------------------------------------- */
/* skull image                                   */
/* --------------------------------------------- */
.cc-skull {
    width: 200px;      /* ideal desktop size */
    max-width: 100%;   /* prevents overflow on small screens */
    height: auto;      /* keeps proportions correct */
    display: block;
    margin: 2rem auto; /* centers the image */
}
@media (max-width: 500px) {
    .cc-skull {
        width: 120px;   /* slightly smaller for tiny screens */
    }
}
/* --------------------------------------------- */
/* leaf-border image                                   */
/* --------------------------------------------- */
.cc-leaf-border {
    width: 700px;      /* ideal desktop size */
    max-width: 100%;   /* prevents overflow on small screens */
    height: auto;      /* keeps proportions correct */
    display: block;
    margin: 2rem auto; /* centers the image */
}
@media (max-width: 500px) {
    .cc-leaf-border {
        width: 120px;   /* slightly smaller for tiny screens */
    }
}
/* --------------------------------------------- */
/* ornamental-border1 image                                   */
/* --------------------------------------------- */
.cc-ornamental-border1 {
    width: min(700px, 100%);
    height: auto;
    display: block;
    margin: 2rem auto;
    object-fit: contain;
    position: relative;
    left: auto;
    right: auto;
}
@media (max-width: 500px) {
    .cc-ornamental-border1 {
        width: 120px;   /* slightly smaller for tiny screens */
    }
}
/* --------------------------------------------- */
/* crowned skull image                           */
/* --------------------------------------------- */
.crown-skull {
    width: 200px;      /* ideal desktop size */
    max-width: 100%;   /* prevents overflow on small screens */
    height: auto;      /* keeps proportions correct */
    display: block;
    margin: 2rem auto; /* centers the image */
}
@media (max-width: 500px) {
    .crown-skull {
        width: 120px;   /* slightly smaller for tiny screens */
    }
}
/* --------------------------------------------- */
/* BODY                                           */
/* --------------------------------------------- */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'PirataOne', serif;
    font-size: 1.1rem;
    line-height: 1.7;
    min-height: 100vh;
    position: relative;
}

/* --------------------------------------------- */
/* BACKGROUND WATERMARK                           */
/* --------------------------------------------- */

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("../images/The Bleak Forest Cross 3 White Distressed (No Background).png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 700px;
    background-attachment: fixed;
    opacity: 0.72;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: -1;
} 


/* --------------------------------------------- */
/* TYPOGRAPHY                                    */
/* --------------------------------------------- */

h1,
h2,
h3 {
    font-family: var(--font-serif);
    font-weight: normal;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.3rem;
    margin-top: 1.5rem;
}

p {
    margin-bottom: 1.5rem;
}
/* Roman numeral ordered list */
.roman-list {
    list-style-type: upper-roman;
    margin-left: 2rem;
    padding-left: 1rem;
}

.roman-list li::marker {
    color: var(--accent-color); /* your blood red */
    font-weight: bold;
    font-size: 1.1rem;
}
/* Underline Text*/
.make-underline {
    text-decoration: underline;
  }





/* --------------------------------------------- */
/* PAGE HEADERS                                  */
/* --------------------------------------------- */

.page-title h1 {
    font-family: 'Sovereign', serif;
    font-size: 3rem;
    letter-spacing: 0.05rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
}

.chapter h2 {
    font-family: 'Sovereign', serif;
    font-size: 1.8rem;
    margin-top: 2.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3rem;
}

/* --------------------------------------------- */
/* TOP TITLE                                     */
/* --------------------------------------------- */

.top-title {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    isolation: isolate;
}

.top-title h1 {
    font-family: 'Sovereign', serif;
    font-size: clamp(3rem, 12vw, 7rem);
    color: var(--accent-color);
    letter-spacing: 0.08rem;
    margin-bottom: 0.5rem;
}

.top-title h2 {
    font-family: 'PirataOne', serif;
    color: var(--highlight);
    font-size: 1.4rem;
    letter-spacing: 0.05rem;
    border-bottom: none;
}

.top-title h3 {
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.3rem;
}

/* --------------------------------------------- */
/* CREST                                         */
/* --------------------------------------------- */

.crest {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.title-sigil {
    width: 90px;
    height: auto;
    opacity: 0.9;

    filter: drop-shadow(0 0 12px rgba(138, 10, 10, 0.55));

    animation: pulseGlow 4s ease-in-out infinite;
}

@keyframes pulseGlow {
    0% {
        filter: drop-shadow(0 0 10px rgba(138, 10, 10, 0.45));
    }

    50% {
        filter: drop-shadow(0 0 22px rgba(138, 10, 10, 0.75));
    }

    100% {
        filter: drop-shadow(0 0 10px rgba(138, 10, 10, 0.45));
    }
}
.coming-soon {
    display: block;

    width: 600px;
    max-width: 100%;

    margin: 2.5rem auto;
    padding: 1rem;

    border: 6px double var(--accent-color);

    background-color: rgba(255,255,255,.05);
    box-shadow: 0 0 12px rgba(138,10,10,.35);

    filter: brightness(1.1);
}
/* --------------------------------------------- */
/* SIDEBAR                                       */
/* --------------------------------------------- */

/* Desktop sidebar */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--nav-bg);
    padding: 2rem 1.5rem;
    overflow-y: auto;
    z-index: 1000;
    border-right: 2px solid var(--border-color);
}

/* Hamburger button */
.hamburger {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    font-size: 2rem;
    background: none;
    border: none;
    color: var(--highlight);
    z-index: 2000;
    cursor: pointer;
}

/* Appear only on screens where the sidebar collapses */
@media (max-width: 900px) {
    .hamburger {
        display: block;
    }
}

/* Mobile collapsed sidebar */
@media (max-width: 900px) {
    nav {
        position: fixed;
        left: -100%;          /* hidden by default */
        top: 0;
        width: 70%;
        height: 100vh;
        background: var(--nav-bg);
        transition: left 0.3s ease;
        z-index: 1500;
        padding: 2rem 1.5rem;
    }

    nav.open {
        left: 0;             /* slide in */
    }
}

@media (max-width: 900px) {
    main {
        margin-left: 0;
        width: 100%;
        padding: 2rem 1.5rem;
    }
}

/* Darkened backdrop overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1400;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Close button inside sidebar */
.close-sidebar {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    background: none;
    border: none;
    color: var(--highlight);
    cursor: pointer;
    z-index: 1600;
}

@media (max-width: 900px) {
    .close-sidebar {
        display: block;
    }
}

nav h3 {
    font-size: 0.85rem;
    letter-spacing: 0.1rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

nav ul {
    list-style: none;
    margin-bottom: 2rem;
}

nav ul li {
    margin-bottom: 0.6rem;
}

nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
}

nav ul li a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.sidebar-logo {
    width: 140px;
    display: block;
    margin: 1rem auto 2rem;
}

.sidebar-stamp {
    width: 120px;
    display: block;
    margin: 2rem auto 1rem;
}

.sidebar-copyright {
    text-align: center;
    font-size: 0.85rem;
    line-height: 1.2rem;
    opacity: 0.85;
}

/* --------------------------------------------- */
/* MAIN CONTENT                                  */
/* --------------------------------------------- */

main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    max-width: 1200px;
    padding: 4rem 3rem;
}
@media (max-width: 900px) {
    main {
        margin-left: 0;
        width: 100%;        /* ← REQUIRED */
        padding: 2rem 1.5rem;
    }
}

/* --------------------------------------------- */
/* TABLES                                        */
/* --------------------------------------------- */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-family: var(--font-sans);
    font-size: 0.95rem;
}

th {
    background-color: var(--accent-color);
    color: white;
    text-align: left;
    padding: 0.6rem;
}

td {
    padding: 0.6rem;
    border-bottom: 1px solid var(--border-color);
}

table tr:nth-child(odd) {
    background-color: #0F0F11;
}


/* --------------------------------------------- */
/* CUSTOM BULLETS                                */
/* --------------------------------------------- */

main ul {
    list-style: none !important;
    margin: 1rem 0 1rem 2.5rem;
    padding: 0;
}

main ul li {
    list-style: none !important;
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

main ul li::marker {
    content: "";
}

main ul li::before {
    content: "•";
    color: var(--accent-color);

    position: absolute;
    left: 0;
    top: 0;

    font-size: 1.2rem;
    line-height: 1.4;
}
/* --------------------------------------------- */
/* DESIGNER NOTE / CALLOUT BOX                   */
/* --------------------------------------------- */

.callout {
    background: rgba(138, 10, 10, 0.18);
    border-left: 6px solid var(--accent-color);

    padding: 1.5rem;
    margin: 2.5rem 0;

    color: var(--highlight);

    border-radius: 4px;

    box-shadow:
        0 0 12px rgba(138, 10, 10, 0.25),
        inset 0 0 12px rgba(138, 10, 10, 0.15);

    position: relative;
}

.callout strong:first-child {
    display: block;
    color: #ffb3b3;
    font-size: 1rem;
    letter-spacing: 0.08rem;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}
/* =========================================================
   SKILLS PAGE
   ========================================================= */

/* ---------------------------------------------------------
   General Skills Page Layout
   --------------------------------------------------------- */

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1em 0;
}

.table-scroll table {
    margin: 0;
}

.chapter-title {
    margin-top: 3em;
}

main ol li,
main ul li {
    margin-bottom: 0.35em;
}

main ul ul,
main li > ol,
main li > ul {
    margin-top: 0.35em;
}

main h5 {
    font-size: 1.05em;
    margin: 1.2em 0 0.4em;
}

main h6 {
    font-size: 0.95em;
    margin: 1em 0 0.3em;
}


/* ---------------------------------------------------------
   Roll Tables
   --------------------------------------------------------- */

.roll-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1em;
    margin: 1em 0 2em;
}

.roll-card h5,
.roll-card h6 {
    margin-top: 0;
}

.roll-card table {
    width: 100%;
    margin: 0;
}


/* =========================================================
   GUILE: PERSUASION TABLE
   ========================================================= */

.persuasion-table {
    width: 100%;
    border-collapse: collapse;
}

/* Give all cells consistent spacing and alignment */

.persuasion-table th,
.persuasion-table td {
    padding: 0.65em 0.75em;
    text-align: center;
    vertical-align: middle;
}


/* ---------------------------------------------------------
   Column Headings
   --------------------------------------------------------- */

/*
   Only the real column headings are now inside <thead>,
   allowing the site's normal red table-header styling to
   remain without turning the whole matrix red.
*/

.persuasion-table thead th {
    text-align: center;
}


/* ---------------------------------------------------------
   Starting Disposition
   --------------------------------------------------------- */

/*
   These are row headings rather than data cells.
   They remain visually distinct without making the entire
   row appear to be part of the table header.
*/

.persuasion-table tbody th {
    font-weight: bold;
    text-align: left;
}


/* ---------------------------------------------------------
   Alternating Rows
   --------------------------------------------------------- */

/*
   Subtle alternating shading makes it easier to follow
   Hostile, Wary, Curious, etc. across the table.
*/

.persuasion-table tbody tr:nth-child(even) th,
.persuasion-table tbody tr:nth-child(even) td {
    background-color: rgba(0, 0, 0, 0.05);
}


/* ---------------------------------------------------------
   Not Applicable Cells
   --------------------------------------------------------- */

/*
   Impossible or unnecessary disposition changes are shown
   with an em dash and deliberately de-emphasized.
*/

.persuasion-table .not-applicable {
    opacity: 0.45;
}


/* =========================================================
   REUSABLE REFERENCE INDEX
   Shared linked contents design for creatures, skills,
   spells, alchemy, conjuration, sigilcraft, healing, etc.
   ========================================================= */
.reference-index {
    margin: 2rem 0 3rem;
}
.reference-index > h2 {
    margin-bottom: 1rem;
}
.reference-index-grid {
    columns: 3 220px;
    column-gap: 2em;
}
.reference-index-group {
    break-inside: avoid;
    margin-bottom: 1.2em;
}
.reference-index-group h3 {
    margin: 0 0 0.3em;
}
.reference-index-group h3 a,
.reference-index-group li a,
.back-to-index a {
    color: var(--text-color);
    text-decoration: none;
}
.reference-index-group h3 a {
    color: var(--accent-color);
}
.reference-index-group h3 a:hover,
.reference-index-group li a:hover,
.reference-index-group h3 a:focus-visible,
.reference-index-group li a:focus-visible,
.back-to-index a:hover,
.back-to-index a:focus-visible {
    color: var(--highlight);
    text-decoration: underline;
}
main .reference-index-group ul {
    margin: 0;
}
main .reference-index-group li {
    margin-bottom: 0.15em;
}
.back-to-index {
    text-align: center;
    font-size: 0.9em;
    margin: 0.3em 0 0;
}
main [id] {
    scroll-margin-top: 1.5rem;
}
@media (max-width: 600px) {
    .reference-index-grid {
        columns: 1;
    }
}

/* =========================================================
   CREATURE COMPENDIUM
   ========================================================= */
.stat-block {
    width: 100%;
    margin: 1em 0 2em;
}
.stat-block td {
    vertical-align: top;
}
.compendium-subtitle,
.compendium-revision {
    text-align: center;
}
.compendium-revision {
    font-size: 0.9em;
    opacity: 0.8;
}
@media (max-width: 600px) {
    .stat-block,
    .stat-block tbody {
        display: block;
    }
    .stat-block tr {
        display: flex;
        flex-wrap: wrap;
    }
    .stat-block td {
        box-sizing: border-box;
        flex: 0 0 60%;
    }
    .stat-block td:nth-child(odd) {
        flex: 0 0 40%;
    }
}
/* --------------------------------------------- */
/* BACK TO TOP BUTTON                            */
/* --------------------------------------------- */

#back-to-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 1000;              /* stays under the mobile sidebar (1500) and overlay (1400) */

    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--nav-bg);
    color: var(--highlight);
    border: 3px double var(--accent-color);
    border-radius: 50%;
    box-shadow:
        0 0 12px rgba(138, 10, 10, 0.35),
        inset 0 0 8px rgba(138, 10, 10, 0.2);

    font-family: var(--font-sans);   /* PirataOne has no arrow glyph */
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;

    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        visibility 0.25s ease,
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background: rgba(138, 10, 10, 0.25);
    color: #fff;
    box-shadow:
        0 0 22px rgba(138, 10, 10, 0.75),
        inset 0 0 12px rgba(138, 10, 10, 0.3);
}

#back-to-top:focus-visible {
    outline: 2px solid var(--highlight);
    outline-offset: 4px;
}

@media (max-width: 600px) {
    #back-to-top {
        right: 1rem;
        bottom: 1rem;
        width: 46px;
        height: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #back-to-top { transition: none; }
}

@media print {
    #back-to-top { display: none; }
}
