/* =========================================================
   IRON & DICE MONSTROUS ARCHIVE
   Main Stylesheet
   (c)2026 Tactical Gaming and Simulations
   ========================================================= */




/* =========================================================
   FONTS
   ========================================================= */

@font-face {
    font-family: "Jost";
    src: url("fonts/Jost-VariableFont_wght.ttf") format("truetype");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Jost";
    src: url("fonts/Jost-Italic-VariableFont_wght.ttf") format("truetype");
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "QT Friz Quad";
    src: url("fonts/QTFrizQuad.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "QT Friz Quad";
    src: url("fonts/QTFrizQuad-Bold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}




/* =========================================================
   COLORS
   ========================================================= */
:root {
    --blue: #19549a;
    --heading: #201765;
    --ink: #202020;
    --line: #dedede;
    --row: #f3f4f7;
    --background: #ffffff;

}

/* =========================================================
   DARK MODE
    ========================================================= */

body.dark-mode {
    --background: #181818;
    --ink: #e5e5e5;
    --heading: #a9b8e8;
    --blue: #8a9fd1;
    --line: #444444;
    --row: #292929;
}

body.dark-mode .site-header {
    background: #123d70;
}



body.dark-mode .stat-table a {
    color: #b8c8ff;
}


/* =====================================================================
   Include padding and borders in the element's total width and height
   ===================================================================== */

* {
    box-sizing: border-box;
}

/* =====================================================================
   BODY
   ===================================================================== */

body {
    margin: 0;
    background: var(--background);
    color: var(--ink);
    font-family: "Jost", sans-serif;
    font-size: 17px;
    line-height: 1.55;
}

/* =====================================================================
   SITE HEADER
   ===================================================================== */


.site-header {
    font-family: "QT Friz Quad", Georgia, serif;
    font-weight: 700;
    padding: 15px 24px;
    height: 60px;
    background: var(--blue);
    color: #fff;
    font-size: 21px;
}

.header-inner {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

/* =====================================================================
   SHARED SITE MENU
   ===================================================================== */
.site-header {
    position: relative;
    z-index: 10;
}

.header-inner {
    gap: 12px;
}

#dark-mode-toggle {
    margin-left: auto;
    flex-shrink: 0;
}

.site-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.site-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.2);
}

.site-menu-toggle:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

.site-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: min(290px, calc(100vw - 40px));
    padding: 8px;
    border: 1px solid var(--line);
    background: var(--background);
    color: var(--ink);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    font-family: "Jost", sans-serif;
    font-size: 17px;
    font-weight: 400;
}

.site-menu[hidden] {
    display: none;
}

.site-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-menu a,
.site-menu .future-section {
    display: block;
    padding: 10px 12px;
}

.site-menu a:hover,
.site-menu a:focus-visible {
    background: var(--row);
}

.site-menu a:focus-visible {
    outline: 2px solid var(--heading);
    outline-offset: -2px;
}

.site-menu small {
    display: block;
    font-size: 12px;
}

/* =====================================================================
   TOGGLE DARK MODE BUTTON
   ===================================================================== */

#dark-mode-toggle {
    padding: 5px 11px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 1px;
    background: rgba(0, 0, 0, 0.12);
    color: #ffffff;
    font-family: "Jost", sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}

#dark-mode-toggle:hover {
    background: rgba(0, 0, 0, 0.25);
    border-color: #ffffff;
}


.site-header>span {
    display: block;
    max-width: 1100px;
    margin: auto;
}

.site-header a {
    color: inherit;
    text-decoration: none;
}

/* =====================================================================
   CONTENT PADDING  ---  ADD AS NEEDED
   ===================================================================== */

.reference-page .monster-index>.reference-list {
    margin-bottom: 60px;
}

.classes-page>section.monster-index {
    padding-top: 60px;
}

/* =====================================================================
   MONSTER INDEX
   ===================================================================== */

.monster-index {
    margin-top: 36px;
}

.monster-list {
    columns: 3 200px;
    column-gap: 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.monster-list li {
    break-inside: avoid;
    margin-bottom: 4px;
}

.monster-list a {
    display: block;
    padding: 2px 0px;
    color: var(--heading);
    text-decoration: none;
    font-size: 18px;
}



.monster-list a[href]:hover {
    color: var(--blue);
    text-decoration: underline;
}

.monster-list a[href]:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: -2px;
}


/* =====================================================================
   MONSTER ENTRY
   ===================================================================== */

.monster-entry {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 28px 32px;
}

.breadcrumb {
    display: none;
}


/* =====================================================================
   NAVIGATION
   ===================================================================== */

.monster-navigation {
    display: flex;
    justify-content: space-between;
    max-width: 600px;
    margin: 20px auto 0;
}

.monster-navigation a {
    position: relative;
    top: 10px;
    padding: 6px 12px;

    color: var(--blue);
    text-decoration: none;
}

.monster-navigation a:hover {
    background: var(--row);
    color: var(--heading);
}

.monster-navigation a:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 4px;
}

.entry-header {
    margin: 44px 0 22px;
}

.archive-label {
    margin: 0 0 18px;
    text-align: center;
    font-size: 17px;
    font-style: italic;
    color: var(--heading);
}

/* =====================================================================
   MONSTER HEADER
   ===================================================================== */

h1 {
    font-family: "QT Friz Quad", Georgia, serif;
    font-weight: 700;
    position: relative;
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 4px solid var(--ink);
    color: var(--heading);
    font-size: clamp(32px, 5vw, 44px);
    line-height: 1.15;
}

h1::after {
    position: absolute;
    right: 0;
    bottom: -13px;
    left: 0;
    height: 6px;
    background: var(--heading);
    content: "";
}

/* =====================================================================
   MONSTER OVERVIEW
   ===================================================================== */

.monster-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
    margin-top: 34px;
}

/* =====================================================================
   MONSTER IMAGE
   ===================================================================== */

.monster-image {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    margin: 0;
    text-align: center;
}

.monster-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    margin: 0 auto;
}


/* =====================================================================
   LORE/DESCRIPTION BOX

   ===================================================================== */

.lore-box {
    margin: 30px 0;
}


/* =====================================================================
   ALL TABLE RULES and STYLES
   ===================================================================== */


.stat-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 16px;
}


.reference-table {
    table-layout: fixed;
    width: 70%;
    margin-left: auto;
    margin-right: auto;
}

.reference-table th:nth-child(1),
.reference-table td:nth-child(1) {
    width: 12%;
}

.reference-table th:nth-child(2),
.reference-table td:nth-child(2) {
    width: 58%;
}

.reference-table th:nth-child(3),
.reference-table td:nth-child(3) {
    width: 30%;
}

.reference-table thead tr {
    background: var(--row);
}

.reference-table tbody tr:nth-child(odd) {
    background: transparent;
}

.reference-table tbody tr:nth-child(even) {
    background: var(--row);
}

.reference-table.two-column th:nth-child(1),
.reference-table.two-column td:nth-child(1) {
    width: 30%;
}

.reference-table.two-column th:nth-child(2),
.reference-table.two-column td:nth-child(2) {
    width: 70%;
}

.reference-table.treasure-type-table {
    width: 100%;
}

.reference-table caption {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.reference-table.two-column th,
.reference-table.two-column td {
    text-align: center;
}

.reference-table.four-column {
    width: 100%;
}

.reference-table.four-column th,
.reference-table.four-column td {
    width: 25%;
    text-align: center;
}

.reference-table.five-column {
    width: 100%;
}

.reference-table.five-column th,
.reference-table.five-column td {
    width: 20%;
    text-align: center;
}

.reference-table.enhancement-table {
    width: 100%;
}

.reference-table.scaling-table {
    width: 100%;
}

.reference-table.alchemy-table th:nth-child(1),
.reference-table.alchemy-table td:nth-child(1) {
    width: 18%;
}

.reference-table.alchemy-table th:nth-child(2),
.reference-table.alchemy-table td:nth-child(2) {
    width: 25%;
}

.reference-table.alchemy-table th:nth-child(3),
.reference-table.alchemy-table td:nth-child(3) {
    width: 15%;
}

.reference-table.alchemy-table th:nth-child(4),
.reference-table.alchemy-table td:nth-child(4) {
    width: 12%;
}

.reference-table.alchemy-table th:nth-child(5),
.reference-table.alchemy-table td:nth-child(5) {
    width: 30%;
}


.reference-table.failed-brew-table {
    width: 100%;
}

.reference-table.failed-brew-table th:nth-child(1),
.reference-table.failed-brew-table td:nth-child(1) {
    width: 12%;
}

.reference-table.failed-brew-table th:nth-child(2),
.reference-table.failed-brew-table td:nth-child(2) {
    width: 25%;
}

.reference-table.failed-brew-table th:nth-child(3),
.reference-table.failed-brew-table td:nth-child(3) {
    width: 63%;
}




.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}



/* =====================================================================
   HIDE CAPTIONS
   ===================================================================== */
.stat-table caption {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.stat-table th,
.stat-table td {
    padding: 5px 10px;
    vertical-align: top;
}

.stat-table th {
    width: 49%;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
}

.stat-table tr:nth-child(odd) {
    background: var(--row);
}


.description {
    margin-top: 30px;
}

blockquote {
    margin: 0;
}

blockquote p {
    margin: 0 0 12px;
}

blockquote footer {
    font-size: 16px;
    text-align: right;
}

cite {
    font-style: italic;
}

.attributes {
    margin-top: 32px;
}

h2 {
    font-family: "QT Friz Quad", Georgia, serif;
    font-weight: 700;
    margin: 0 0 16px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--heading);
    color: var(--heading);
    font-size: 25px;
}

.attribute-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.entry-footer {
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: #666;
    font-size: 13px;
}

.entry-footer span {
    padding: 0 6px;
}

/* =====================================================================
   REFERENCE PAGE LAYOUT
   ===================================================================== */

.reference-list {
    columns: 3 200px;
    column-gap: 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.reference-list li {
    break-inside: avoid;
    margin-bottom: 4px;
}

.reference-list a {
    display: block;
    padding: 2px 0;
    color: var(--heading);
    text-decoration: none;
    font-size: 18px;
}

.reference-list a[href]:hover {
    color: var(--blue);
    text-decoration: underline;
}

.reference-list a[href]:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: -2px;
}






.reference-page a {
    color: var(--heading);
}

.reference-page h3 {
    font-family: "QT Friz Quad", Georgia, serif;
    color: var(--heading);
    font-size: 21px;
    line-height: 1.3;
}

.reference-entry {
    margin-top: 30px;
}

.reference-entry h3 {
    margin: 0 0 12px;
    padding: 8px 0px;
    border-bottom: 1px solid var(--line);
    scroll-margin-top: 24px;
}

.reference-entry h3:target {
    background: var(--row);
    outline: 2px solid var(--heading);
    outline-offset: 2px;
}

.reference-entry p {
    max-width: 75ch;
}

.reference-links {
    font-size: 14px;
}

.reference-page #contents {
    scroll-margin-top: 24px;
}


/* =====================================================================
   404 PAGE 
   ===================================================================== */

.error-page {
    text-align: center;
}

.error-page .reference-entry {
    max-width: 720px;
    margin: 50px auto;
}

.error-code {
    margin: 0;
    color: var(--heading);
    font-family: "QT Friz Quad", Georgia, serif;
    font-size: clamp(80px, 18vw, 180px);
    font-weight: 700;
    line-height: 1;
    opacity: 0.18;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-top: 30px;
}

.error-actions a {
    padding: 10px 18px;
    border: 2px solid var(--heading);
    background: var(--heading);
    color: #fff;
    text-decoration: none;
}

.error-actions a:hover,
.error-actions a:focus-visible {
    background: transparent;
    color: var(--heading);
}


/* =====================================================================
   UMBRAL REALM
   ===================================================================== */



.error-secret {
    margin: 2rem 0;
    text-align: center;
}

.error-secret a {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border: 1px solid currentColor;
    text-decoration: none;
}




/* =====================================================================
   MOBILE LAYOUT
   ===================================================================== */

@media (max-width: 720px) {
    .site-header {
        padding: 14px 20px;
        font-size: 18px;
    }

    .monster-list a {
        font-size: 17px;
    }


    .monster-entry {
        padding-right: 20px;
        padding-left: 20px;
    }

    .breadcrumb {
        display: none;
    }

    .entry-header {
        margin-top: 30px;
    }

    .monster-overview,
    .attribute-tables {
        grid-template-columns: 1fr;
        gap: 0px;
    }

    .table-scroll .reference-table {
        width: 600px;
        min-width: 600px;
        margin-left: 0;
        margin-right: 0;
    }


    .reference-table.two-column {
        width: 100%;
    }

    .monster-image {
        grid-column: 1;
        grid-row: 1;
        width: min(100%, 420px);
        margin: 0 auto 20px;
    }

    .stat-table th,
    .stat-table td {
        padding: 5px 8px;
    }

    blockquote footer {
        text-align: left;
    }


    .monster-navigation a {
        top: 0;
    }

    .monster-navigation {
        margin: 30px auto;
    }


}

/* =====================================================================
   PRINT LAYOUT
   ===================================================================== */
@media print {

    .site-header,
    .breadcrumb,
    .entry-footer {
        display: none;
    }

    .monster-entry {
        max-width: none;
        padding: 0;
    }

    .entry-header {
        margin-top: 0;
    }

    body {
        font-size: 11pt;
    }

    .stat-table {
        font-size: 10pt;
    }

    .stat-table th {
        font-size: 9pt;
    }

    .table-scroll {
        overflow: visible;
    }

    .table-scroll .reference-table {
        width: 100%;
        min-width: 0;
    }

    .attributes {
        break-inside: avoid;
    }
}