/* ================================================
   demonic.corvid — gallery
   grid/filter/lightbox mechanics adapted from a
   template by crotovane; reskinned to site brand
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Delius&display=swap');
@font-face {
    font-family: 'Fantaisie Artistique';
    src: url('../assets/fonts/FantaisieArtistique.otf') format('opentype'),
         url('../assets/fonts/FantaisieArtistique.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --ink:            #142338;
    --ink-deep:       #0B1626;
    --parchment:      #F7E9C9;
    --parchment-deep: #EFD9A6;
    --blood:          #C41E2A;
    --blood-deep:     #6E1420;
    --wisp:           #86A9BE;
    --wisp-bright:    #B9D3E2;
    --gold:           #D8B25C;
    --ink-soft:       #3B4A5E;
    --radius: .6em;
    --radius-lg: 1.2em;

    --page-width: 1300px;
    --gutter: 20px;
    --sidebar-width: 300px;
    --columns: 3;
    --grid-item: 100%;
}
@media (min-width: 1100px) {
    :root {
        --grid-item: calc((99.9% / var(--columns)) - (var(--gutter) * (var(--columns) - 1)) / var(--columns));
    }
}

* { box-sizing: border-box; font-family: 'Delius', Verdana, Geneva, Tahoma, sans-serif; }

html {
    font-family: 'Delius', Verdana, Geneva, Tahoma, sans-serif;
}

body {
    margin: 0;
    padding: 2.5em 1em;
    background: var(--ink-deep);
    color: var(--ink);
    font-family: 'Delius', Verdana, Geneva, Tahoma, sans-serif;
    display: flex;
    justify-content: center;
    line-height: 1.3;
    scrollbar-color: var(--gold) var(--ink-deep);
}

p { line-height: 1.6em; margin-block: .5em; }
p:first-child { margin-top: 0; }

h1, h2, h3, h4 {
    font-family: 'Fantaisie Artistique', 'Delius', cursive;
    font-weight: 400;
    font-synthesis: none;
    letter-spacing: .5px;
    color: var(--parchment);
}
h1 { font-size: 1.8em; margin-bottom: .3em; line-height: 1.15; }
h2 { font-size: 1.1em; }

/* ============ LINKS ============ */
a {
    color: var(--wisp);
    font-weight: 700;
    text-decoration: none;
    transition: color .2s ease;
}
a:visited { color: var(--wisp); }
a:hover, a:visited:hover { color: var(--blood); text-decoration: underline; }

code {
    color: var(--blood-deep);
    border: 1px solid var(--gold);
    border-radius: 3px;
    padding: 1px 4px;
    font-family: var(--font-mono, monospace);
    background: var(--parchment);
}

.page-frame {
    width: 100%;
    max-width: var(--page-width);
    background-color: var(--parchment);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.55);
    position: relative;
}

/* ============ SITE HEAD + MENU (same as home page) ============ */
.site-head {
    position: relative;
    background: linear-gradient(180deg, var(--ink-deep) 0%, var(--ink) 75%);
    text-align: center;
    padding: 2.2em 1em 1.6em;
    overflow: hidden;
}
.starfield { position: absolute; inset: 0; opacity: .8; }
.starfield circle { fill: var(--wisp-bright); }
.constellation-line { stroke: var(--gold); stroke-width: 1; opacity: .35; }

.brand { position: relative; display: inline-flex; align-items: center; gap: .8em; text-decoration: none; z-index: 2; }
.brand-mark { width: 66px; height: 66px; object-fit: cover; border-radius: 50%; border: 3px solid var(--gold); }
.brand-title {
    font-family: 'Fantaisie Artistique', 'Delius', cursive;
    font-weight: 400;
    font-synthesis: none;
    font-size: 2.1em;
    color: var(--parchment);
    letter-spacing: 1px;
}
.brand-title .dot { color: var(--blood); }
.brand-sub { position: relative; z-index: 2; color: var(--wisp); font-size: .85em; letter-spacing: 2px; margin-top: .3em; }

.phase-divider { display: flex; align-items: center; justify-content: center; gap: .5em; padding: .4em 0 .9em; position: relative; z-index: 2; }
.phase-divider .rule { height: 1px; width: 70px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.phase-divider .moon { width: 14px; height: 14px; border-radius: 50%; background: var(--gold); box-shadow: inset 4px -1px 0 0 var(--ink); }
.phase-divider.footer-phase { padding: .1em 0 .7em; }

.menu-strip { background-color: var(--ink); border-bottom: 3px double var(--gold); display: flex; justify-content: center; padding: .3em 1em .8em; }
.menu-list { display: flex; align-items: center; justify-content: center; list-style: none; margin: 0; padding: 0; gap: .1em; flex-wrap: wrap; }
.menu-list > li { position: relative; }
.menu-list > li > a { display: block; padding: .6em 1.05em; color: var(--parchment); font-weight: 700; text-decoration: none; border-radius: var(--radius); letter-spacing: .3px; }
.menu-list > li > a:hover { color: var(--ink); background-color: var(--gold); }
.menu-list a:visited { color: var(--parchment); }
.menu-list > li.current > a { background-color: var(--blood-deep); }
.has-dropdown .dropdown { display: none; position: absolute; top: 100%; left: 0; flex-direction: column; background-color: var(--parchment); border: 2px solid var(--blood-deep); border-radius: var(--radius); min-width: 210px; padding: .3em 0; z-index: 10; list-style: none; margin: 0; }
.has-dropdown:hover .dropdown { display: flex; }
.dropdown li a { display: block; padding: .5em 1em; color: var(--ink); text-decoration: none; font-weight: 500; }
.dropdown li a:visited { color: var(--ink); }
.dropdown li a:hover { color: var(--blood); background-color: var(--parchment-deep); text-decoration: none; }

/* ============ FEATURED STRIP — Most Recent / Fanart / Commissions ============ */
.featured-strip {
    display: flex;
    gap: 1em;
    flex-wrap: wrap;
    padding: 1.6em 1.8em 0;
}
.featured-card {
    position: relative;
    flex: 1 1 220px;
    height: 150px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-color: var(--ink);
    border: 1px solid var(--gold);
    display: flex;
    align-items: flex-end;
    box-shadow: 0 4px 14px rgba(20,35,56,.3);
    transition: transform .25s ease, box-shadow .25s ease;
    text-decoration: none;
}
.featured-card:hover {
    transform: translateY(-6px) scale(1.03) rotate(var(--tilt, -8deg));
    box-shadow: 0 16px 32px rgba(110,20,32,.4);
}
.featured-card .label {
    width: 100%;
    background: linear-gradient(0deg, rgba(11,22,38,.9), transparent);
    color: var(--parchment);
    padding: 1em 1em .6em;
    font-weight: 700;
    font-family: 'Fantaisie Artistique', 'Delius', cursive;
    font-size: 1.15em;
}
.featured-card .label span {
    display: block;
    font-family: 'Delius', sans-serif;
    font-size: .6em;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: .1em;
}

/* ============ SKETCHBOOKS ============ */
.sketchbooks {
    padding: 1.6em 1.8em 0;
}
.sketchbooks h2 {
    font-size: 1.3em;
    margin-bottom: .7em;
    color: var(--ink);
    letter-spacing: .5px;
}
.sketchbook-row {
    display: flex;
    align-items: flex-end;
    gap: 1.1em;
    flex-wrap: wrap;
    height: 210px;
}
.sketchbook-item {
    display: block;
    height: 100%;
    width: auto;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gold);
    box-shadow: 3px 4px 0 rgba(20,35,56,.25);
    transition: transform .25s ease, box-shadow .25s ease;
}
.sketchbook-item:hover {
    transform: translateY(-6px) scale(1.05) rotate(var(--tilt, -10deg));
    box-shadow: 0 16px 30px rgba(20,35,56,.4);
}
.sketchbook-item img {
    display: block;
    height: 100%;
    width: auto;
}

/* ============ MAIN GALLERY AREA ============ */
main {
    padding: 1.8em;
}
.main-divider {
    display: grid;
    gap: var(--gutter);
    align-items: start;
}
@media (min-width: 800px) {
    .main-divider { grid-template-columns: var(--sidebar-width) auto; }
}

.gallery-sidebar {
    background: var(--ink);
    color: var(--parchment);
    border: 3px double var(--gold);
    border-radius: var(--radius-lg);
    padding: 1.3em 1.2em;
}
@media (min-width: 800px) {
    .gallery-sidebar {
        position: sticky;
        top: 1.5em;
        max-height: calc(100vh - 3em);
        overflow-y: auto;
    }
}
.gallery-sidebar a { color: var(--wisp-bright); }
.gallery-sidebar a:hover { color: var(--gold); }

.filter-group { margin-top: 1.2em; }
.filter-group h2 {
    font-size: .75em;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: .5em;
}
.button-group { display: flex; gap: .4em; flex-wrap: wrap; }
.button {
    cursor: pointer;
    border: 1px solid var(--gold);
    background: transparent;
    color: var(--parchment);
    border-radius: var(--radius);
    padding: .35em .85em;
    font-weight: 600;
    font-size: .85em;
    transition: .15s ease;
}
.button:hover { border-color: var(--blood); color: var(--blood); }
.button.is-checked { background: var(--gold); color: var(--ink); border-color: var(--gold); }

hr { border: none; border-top: 1px dotted var(--gold); margin-block: 16px; }

/* ============ THE GRID ============ */
.gallery, .gallery li, .grid-item {
    list-style: none;
    margin-left: 0;
    padding-left: 0;
}
.gallery li { margin-bottom: var(--gutter); }
.grid-item, .grid-sizer { width: var(--grid-item); }
.gutter-sizer { width: var(--gutter); }

.grid-item figure {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gold);
    background: var(--parchment-deep);
    transition: transform .25s ease, box-shadow .25s ease;
}
.grid-item:hover figure {
    transform: translateY(-5px) scale(1.02) rotate(var(--tilt, 8deg));
    box-shadow: 0 14px 28px rgba(20,35,56,.35);
}
.grid-item img { display: block; width: 100%; height: auto; object-fit: cover; }

.caption, figcaption {
    padding: .6em .9em;
    background-color: var(--parchment-deep);
    color: var(--ink-soft);
    font-size: .85em;
    border-top: 1px dotted var(--gold);
}

.grid-item.text-entry {
    background: var(--ink);
    color: var(--parchment);
    border: 1px dashed var(--gold);
    border-radius: var(--radius);
    padding: 1em 1.2em;
    font-size: .85em;
}

/* ============ FOOTER ============ */
footer {
    text-align: center; font-size: .85rem; font-weight: 700;
    padding: 1em; background: var(--ink); color: var(--parchment);
    letter-spacing: .5px;
}
footer a { color: var(--wisp-bright); }
footer a:hover { color: var(--gold); }
.small-text { font-size: .72rem; color: var(--wisp); font-weight: 500; text-align: center; margin-top: 1em; }
.small-text a { color: var(--wisp); }

html.bp-lock { overflow-y: visible; }

@media (max-width: 480px) {
    .featured-strip { padding: 1.2em 1em 0; }
    .featured-card { height: 120px; }
    .sketchbook-row { height: 150px; flex-wrap: nowrap; overflow-x: auto; }
}