/* ================================================================
   BOUNTY BOARD — bounty-board.css
   Fantasy D&D prop stylesheet
   To reuse: copy entire bounty-board/ folder, change JS data only.
================================================================ */

/* ----------------------------------------------------------------
   CSS CUSTOM PROPERTIES
---------------------------------------------------------------- */
:root {
    /* Wood tones */
    --wood-dark:        #2a1a0e;
    --wood-mid:         #3d2410;
    --wood-light:       #5c3620;
    --wood-highlight:   #7a4a28;

    /* Parchment tones */
    --parchment-base:   #e8d5a3;
    --parchment-dark:   #c9b07a;
    --parchment-light:  #f2e8c4;
    --parchment-edge:   #b8965a;

    /* Ink & text */
    --ink-dark:         #1a0f05;
    --ink-mid:          #2d1a08;
    --ink-faded:        #5a3e22;
    --ink-red:          #7a1515;
    --ink-gold:         #8b6914;

    /* Status colours */
    --status-active:    #2a5c1a;
    --status-danger:    #7a1515;
    --status-neutral:   #3d2c0e;
    --status-complete:  #1a3d5c;
    --status-urgent:    #7a3a05;

    /* Seal colours */
    --seal-red:         #8b1a1a;
    --seal-gold:        #8b6914;
    --seal-green:       #1a4a1a;
    --seal-blue:        #1a2d5e;
    --seal-black:       #1a1008;

    /* Shadows */
    --shadow-deep:      0 8px 32px rgba(0,0,0,0.7), 0 2px 8px rgba(0,0,0,0.5);
    --shadow-card:      3px 6px 18px rgba(0,0,0,0.55), 1px 2px 4px rgba(0,0,0,0.4);
    --shadow-pin:       0 2px 6px rgba(0,0,0,0.6);

    /* Typography */
    --font-display:     'Cinzel Decorative', 'Cinzel', serif;
    --font-heading:     'Cinzel', serif;
    --font-body:        'IM Fell English', 'Georgia', serif;
    --font-notes:       'IM Fell DW Pica', 'Georgia', serif;

    /* Layout */
    --board-padding:    clamp(12px, 3vw, 32px);
    --card-radius:      3px;
    --modal-radius:     4px;
}


/* ----------------------------------------------------------------
   RESET & BASE
---------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--wood-dark) !important;
    color: var(--ink-dark) !important;
    font-family: var(--font-body) !important;
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
    /* iOS notch / home bar safe areas */
    padding-left:   env(safe-area-inset-left);
    padding-right:  env(safe-area-inset-right);
    padding-bottom: max(env(safe-area-inset-bottom), 16px);

    /* Fantasy market background scene */
    background-image:
        linear-gradient(rgba(0,0,0,0.28), rgba(0,0,0,0.28)),
        url('../../../../assets/images/textures/bounty_board_background.png') !important;
    background-size: auto, cover !important;
    background-repeat: repeat, no-repeat !important;
    background-position: top left, center center !important;
    background-attachment: local, fixed !important;
}


/* Neutralise styles.css main override on this page */
main.board-frame {
    background: none !important;
    flex: unset;
    padding-left: 0;
    padding-bottom: 0;
}

/* Ensure links inside the board/modal use parchment ink, not white */
.board-masthead a,
.board-frame a,
.modal-paper a {
    color: var(--ink-mid);
}

/* ── Banner: restore Philosopher font + site-standard light text ─ */
/* bounty-board.css overrides body font/color with !important;      */
/* These rules bring the banner back in line with all other pages   */
/* without stomping the intentional gold inline styles on nav links.*/
.banner,
.banner *,
.mobile-menu,
.mobile-menu * {
    font-family: 'Philosopher', sans-serif !important;
}

/* Target only the site title link, not every link in the mobile menu */
.banner h1,
.banner > a,
.banner > a h1,
.banner-center > a,
.banner-center > a h1 {
    color: #f4e8c1 !important;
    text-shadow: none;
}


/* ----------------------------------------------------------------
   BOARD MASTHEAD — in-world decree header
---------------------------------------------------------------- */
.board-masthead {
    text-align: center;
    padding: clamp(24px, 5vw, 56px) var(--board-padding) clamp(16px, 3vw, 32px);
    position: relative;
}

.board-masthead::after {
    content: '';
    display: block;
    width: 80%;
    max-width: 600px;
    height: 2px;
    margin: 16px auto 0;
    background: linear-gradient(90deg, transparent, var(--wood-highlight), var(--parchment-edge), var(--wood-highlight), transparent);
}

.board-masthead-inner {
    display: inline-block;
    max-width: 640px;
    position: relative;
    z-index: 1;
    /* Parchment readability panel — sits in normal flow, no z-index tricks needed */
    background: rgba(242, 232, 196, 0.92);
    border: 2px solid var(--parchment-edge);
    border-radius: 4px;
    padding: 20px 32px;
    box-shadow:
        0 4px 24px rgba(0,0,0,0.45),
        inset 0 0 24px rgba(180,130,60,0.10);
}

/* Backdrop div no longer drives the visual — hidden */
.board-masthead-backdrop {
    display: none;
}

.board-masthead-decree {
    font-family: var(--font-notes);
    font-style: italic;
    font-size: clamp(0.7rem, 2vw, 0.85rem);
    color: var(--ink-faded);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.board-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 7vw, 4rem);
    font-weight: 900;
    color: var(--ink-dark);
    text-shadow:
        0 1px 0 rgba(255,255,255,0.4),
        0 2px 6px rgba(0,0,0,0.2);
    letter-spacing: 0.04em;
    line-height: 1.1;
    margin-bottom: 4px;
}

.board-location-name {
    font-family: var(--font-heading);
    font-size: clamp(0.85rem, 2.5vw, 1.1rem);
    color: var(--ink-mid);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.board-masthead-note {
    font-family: var(--font-notes);
    font-style: italic;
    font-size: clamp(0.68rem, 1.8vw, 0.82rem);
    color: var(--ink-faded);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.6;
}


/* ----------------------------------------------------------------
   BOARD FRAME — the physical wooden board surface
---------------------------------------------------------------- */
.board-frame {
    max-width: 1280px;
    margin: 0 auto clamp(24px, 5vw, 48px);
    padding: 0 var(--board-padding) var(--board-padding);
    /* extra bottom clearance so content isn't clipped on mobile */
    padding-bottom: max(var(--board-padding), env(safe-area-inset-bottom), 32px);
}

.board-header-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: linear-gradient(180deg, #3a2010 0%, #2a1508 100%);
    border: 2px solid var(--wood-highlight);
    border-bottom: 3px solid var(--wood-dark);
    padding: 10px 24px;
    border-radius: 4px 4px 0 0;
    position: relative;
}

.board-header-bar-text {
    font-family: var(--font-heading);
    font-size: clamp(0.65rem, 2vw, 0.85rem);
    color: var(--parchment-dark);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    opacity: 0.85;
}

/* Nail / screw decorations on the header bar */
.board-nail {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #c0a060, #6b4a18 60%, #2a1508);
    box-shadow: var(--shadow-pin);
    flex-shrink: 0;
}


/* ----------------------------------------------------------------
   BOARD GRID — masonry-style responsive flier layout
---------------------------------------------------------------- */
.board-grid {
    background-color: var(--wood-mid);
    background-image:
        /* dark vignette overlay to deepen the board edges */
        linear-gradient(rgba(0,0,0,0.22), rgba(0,0,0,0.22)),
        url('../../../../assets/images/textures/bounty_board.png');
    background-size: auto, 700px auto;
    background-repeat: repeat, repeat;
    border: 3px solid var(--wood-highlight);
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: clamp(20px, 4vw, 40px) clamp(16px, 3vw, 32px);
    box-shadow: inset 0 8px 32px rgba(0,0,0,0.5), inset 0 0 80px rgba(0,0,0,0.3);

    /* CSS columns for masonry-like staggered layout */
    column-count: 4;
    column-gap: clamp(14px, 2.5vw, 24px);
}

@media (max-width: 1100px) { .board-grid { column-count: 3; } }
@media (max-width: 760px)  { .board-grid { column-count: 2; } }
@media (max-width: 480px)  { .board-grid { column-count: 1; } }


/* ----------------------------------------------------------------
   FLIER CARDS — individual posted notices
---------------------------------------------------------------- */
.flier {
    break-inside: avoid;
    display: block;
    position: relative;
    margin-bottom: clamp(14px, 2.5vw, 24px);
    cursor: pointer;

    /* Parchment base */
    background: var(--parchment-base);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-card);

    /* Slight random tilt via CSS custom property set by JS */
    transform: rotate(var(--tilt, 0deg));
    transition: transform 0.18s ease, box-shadow 0.18s ease;

    /* Real parchment texture */
    background-image: url('../../../../assets/images/textures/parchment0.png');
    background-size: cover;
    background-position: center;
}

/* Worn edges — vignette on the card */
.flier::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--card-radius);
    background: radial-gradient(ellipse at center, transparent 55%, rgba(80,40,0,0.25) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Hover / tap lift effect */
.flier:hover,
.flier:focus-visible {
    transform: rotate(var(--tilt, 0deg)) translateY(-4px) scale(1.025);
    box-shadow:
        6px 14px 32px rgba(0,0,0,0.7),
        2px 4px 8px rgba(0,0,0,0.5);
    outline: none;
}

.flier:active {
    transform: rotate(var(--tilt, 0deg)) translateY(-1px) scale(1.01);
}

/* Focus ring for keyboard users */
.flier:focus-visible {
    outline: 3px solid var(--parchment-edge);
    outline-offset: 3px;
}


/* Pushpin — sits above the card, centred at the top */
.flier-pin {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0,0,0,0.7), inset 0 1px 2px rgba(255,255,255,0.2);
    pointer-events: none;
}

/* Pin colour variants — applied by JS based on bounty type */
.flier-pin--red    { background: radial-gradient(circle at 35% 30%, #e04040, #8b1a1a 60%, #3a0808); }
.flier-pin--gold   { background: radial-gradient(circle at 35% 30%, #f0c040, #8b6914 60%, #3a2a08); }
.flier-pin--black  { background: radial-gradient(circle at 35% 30%, #5a4030, #2a1a0e 60%, #0e0806); }
.flier-pin--blue   { background: radial-gradient(circle at 35% 30%, #4060c0, #1a2d5e 60%, #080c20); }
.flier-pin--green  { background: radial-gradient(circle at 35% 30%, #40a040, #1a4a1a 60%, #081408); }


/* ----------------------------------------------------------------
   FLIER INNER LAYOUT
---------------------------------------------------------------- */
.flier-inner {
    padding: clamp(14px, 3vw, 22px) clamp(12px, 2.5vw, 18px) clamp(12px, 2.5vw, 18px);
    position: relative;
    z-index: 2;
}

/* Torn-tape / decorative corner accent */
.flier-tape {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%) rotate(-1deg);
    width: 52px;
    height: 14px;
    background: rgba(230, 210, 160, 0.55);
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    z-index: 11;
    pointer-events: none;
}

.flier-type-label {
    font-family: var(--font-heading);
    font-size: 0.58rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-faded);
    border-bottom: 1px solid var(--parchment-edge);
    padding-bottom: 4px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.flier-title {
    font-family: var(--font-heading);
    font-size: clamp(0.88rem, 2.5vw, 1.05rem);
    font-weight: 700;
    color: var(--ink-dark);
    line-height: 1.25;
    margin-bottom: 4px;
    overflow-wrap: break-word;
    word-break: break-word;
}

.flier-subtitle {
    font-family: var(--font-notes);
    font-style: italic;
    font-size: clamp(0.7rem, 1.8vw, 0.82rem);
    color: var(--ink-faded);
    margin-bottom: 8px;
    line-height: 1.3;
}

/* Thumbnail image on the flier card */
.flier-image-wrap {
    position: relative;
    margin-bottom: 8px;
    overflow: hidden;
    border-radius: 2px;
    border: 1px solid var(--parchment-edge);
    cursor: zoom-in;
}

.flier-image {
    width: 100%;
    max-height: 130px;
    object-fit: cover;
    border-radius: 2px;
    display: block;
    filter: sepia(0.35) brightness(0.9) contrast(1.05);
    transition: filter 0.15s, transform 0.15s;
}

/* Zoom-in overlay hint on hover / tap */
.flier-image-wrap::after {
    content: '🔍';
    position: absolute;
    bottom: 5px;
    right: 6px;
    font-size: 0.75rem;
    background: rgba(20,10,5,0.65);
    color: var(--parchment-light);
    padding: 2px 5px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}

.flier-image-wrap:hover::after,
.flier-image-wrap:focus-within::after {
    opacity: 1;
}

.flier-image-wrap:hover .flier-image {
    filter: sepia(0.2) brightness(0.95) contrast(1.08);
    transform: scale(1.03);
}

.flier-summary {
    font-family: var(--font-body);
    font-size: clamp(0.7rem, 1.8vw, 0.8rem);
    color: var(--ink-mid);
    line-height: 1.5;
    margin-bottom: 10px;
}

.flier-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
    border-top: 1px dashed var(--parchment-edge);
    padding-top: 8px;
    margin-top: 4px;
}

.flier-reward {
    font-family: var(--font-heading);
    font-size: clamp(0.75rem, 2vw, 0.88rem);
    font-weight: 700;
    color: var(--ink-gold);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

.flier-reward::before { content: '⚜ '; font-size: 0.7em; }

.flier-location {
    font-family: var(--font-notes);
    font-style: italic;
    font-size: 0.67rem;
    color: var(--ink-faded);
    text-align: right;
}

/* Status badge on a card */
.flier-status {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.55rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 2px;
    font-weight: 700;
}

.flier-status--active   { background: var(--status-active);   color: #b8e0a0; }
.flier-status--urgent   { background: var(--status-urgent);   color: #f0c080; }
.flier-status--danger   { background: var(--status-danger);   color: #f0a0a0; }
.flier-status--complete { background: var(--status-complete); color: #a0c0e0; }
.flier-status--neutral  { background: var(--status-neutral);  color: #c8a870; }

/* Tags / pills row */
.flier-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.flier-tag {
    font-family: var(--font-heading);
    font-size: 0.55rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-faded);
    border: 1px solid var(--parchment-edge);
    padding: 1px 5px;
    border-radius: 2px;
    background: rgba(180,140,80,0.12);
}


/* Hide tape strip on single-column mobile — pin is enough */
@media (max-width: 480px) {
    .flier-tape { display: none; }
    .flier-inner { padding-top: 18px; }
}


/* ----------------------------------------------------------------
   COMPLETED FLIER — visually aged / struck through
---------------------------------------------------------------- */
.flier--complete {
    opacity: 0.62;
    filter: saturate(0.45) brightness(0.88);
}

.flier--complete .flier-title {
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    text-decoration-color: var(--ink-faded);
}


/* ----------------------------------------------------------------
   BOARD FOOTER BAR
---------------------------------------------------------------- */
.board-footer-bar {
    background: linear-gradient(180deg, #2a1508 0%, #1e0f06 100%);
    border: 2px solid var(--wood-highlight);
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 10px 24px;
    text-align: center;
    margin-top: -1px;
}

.board-footer-text {
    font-family: var(--font-notes);
    font-style: italic;
    font-size: clamp(0.6rem, 1.5vw, 0.72rem);
    color: var(--parchment-dark);
    letter-spacing: 0.1em;
    opacity: 0.6;
}

/* Empty state */
.board-empty {
    padding: 48px 24px;
    text-align: center;
    font-family: var(--font-notes);
    font-style: italic;
    color: var(--parchment-dark);
    opacity: 0.5;
}


/* ----------------------------------------------------------------
   MODAL BACKDROP
---------------------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(8px, 4vw, 32px);
    padding-bottom: max(clamp(8px, 4vw, 32px), env(safe-area-inset-bottom));
    overflow-y: auto;

    /* Dark smoke overlay */
    background: rgba(10, 5, 2, 0.82);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);

    /* Entry animation */
    animation: backdropFadeIn 0.2s ease forwards;
}

.modal-backdrop[hidden] {
    display: none;
}

@keyframes backdropFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* The invisible full-screen hit area behind the paper */
.modal-backdrop-hit {
    position: fixed;
    inset: 0;
    z-index: 0;
    cursor: pointer;
}


/* ----------------------------------------------------------------
   MODAL PAPER — the inspected bounty document
---------------------------------------------------------------- */
.modal-paper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;

    /* Real parchment texture */
    background: var(--parchment-base);
    background-image: url('../../../../assets/images/textures/parchment0.png');
    background-size: cover;
    background-position: center top;

    border: 2px solid var(--parchment-edge);
    border-radius: var(--modal-radius);
    box-shadow:
        0 24px 80px rgba(0,0,0,0.85),
        0 4px 16px rgba(0,0,0,0.6),
        inset 0 0 60px rgba(180,140,60,0.08);

    /* Worn edges */
    outline: 6px solid rgba(80,40,0,0.12);
    outline-offset: -3px;

    padding: clamp(24px, 5vw, 44px) clamp(20px, 5vw, 40px);

    animation: paperRise 0.22s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}

@keyframes paperRise {
    from { opacity: 0; transform: translateY(18px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* Scrollbar styling inside modal */
.modal-paper::-webkit-scrollbar { width: 6px; }
.modal-paper::-webkit-scrollbar-track { background: var(--parchment-dark); border-radius: 3px; }
.modal-paper::-webkit-scrollbar-thumb { background: var(--parchment-edge); border-radius: 3px; }


/* ----------------------------------------------------------------
   MODAL CLOSE BUTTON
---------------------------------------------------------------- */
.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: 1px solid var(--ink-faded);
    color: var(--ink-faded);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    z-index: 10;
}

.modal-close-btn:hover {
    background: var(--ink-faded);
    color: var(--parchment-light);
    border-color: var(--ink-faded);
}

.modal-close-btn:focus-visible {
    outline: 3px solid var(--parchment-edge);
    outline-offset: 2px;
}


/* ----------------------------------------------------------------
   WAX SEAL AREA
---------------------------------------------------------------- */
.modal-seal-area {
    position: absolute;
    top: 18px;
    left: 20px;
}

.modal-seal {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    line-height: 1;
    box-shadow:
        0 3px 10px rgba(0,0,0,0.5),
        inset 0 1px 3px rgba(255,255,255,0.15),
        inset 0 -2px 4px rgba(0,0,0,0.3);
    border: 2px solid rgba(255,255,255,0.1);
}

.modal-seal--red   { background: radial-gradient(circle at 40% 35%, #c04040, var(--seal-red)); }
.modal-seal--gold  { background: radial-gradient(circle at 40% 35%, #d4a020, var(--seal-gold)); }
.modal-seal--green { background: radial-gradient(circle at 40% 35%, #40a040, var(--seal-green)); }
.modal-seal--blue  { background: radial-gradient(circle at 40% 35%, #4060d0, var(--seal-blue)); }
.modal-seal--black { background: radial-gradient(circle at 40% 35%, #5a4030, var(--seal-black)); }


/* ----------------------------------------------------------------
   MODAL HEADER
---------------------------------------------------------------- */
.modal-header {
    text-align: center;
    margin-bottom: 20px;
    padding-top: 8px; /* clearance below seal */
}

.modal-type-label {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--ink-faded);
    margin-bottom: 6px;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: clamp(1.3rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--ink-dark);
    line-height: 1.15;
    margin-bottom: 6px;
}

.modal-subtitle {
    font-family: var(--font-notes);
    font-style: italic;
    font-size: clamp(0.8rem, 2vw, 0.95rem);
    color: var(--ink-faded);
    line-height: 1.4;
}

/* Decorative divider line under header */
.modal-header::after {
    content: '— ✦ —';
    display: block;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--ink-gold);
    margin-top: 12px;
    letter-spacing: 0.2em;
}


/* ----------------------------------------------------------------
   MODAL IMAGE
---------------------------------------------------------------- */
.modal-image-wrap {
    margin-bottom: 20px;
    text-align: center;
}

/* Modal image — inner wrapper makes it tappable */
.modal-image-inner {
    display: inline-block;
    position: relative;
    cursor: zoom-in;
    border-radius: 3px;
}

.modal-image-inner::after {
    content: '🔍 Tap to enlarge';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(20,10,5,0.7);
    color: var(--parchment-light);
    font-family: var(--font-notes);
    font-style: italic;
    font-size: 0.68rem;
    text-align: center;
    padding: 4px 0;
    opacity: 0;
    transition: opacity 0.15s;
    border-radius: 0 0 3px 3px;
    pointer-events: none;
}

.modal-image-inner:hover::after,
.modal-image-inner:focus-visible::after {
    opacity: 1;
}

.modal-image-inner:focus-visible {
    outline: 3px solid var(--parchment-edge);
    outline-offset: 2px;
}

.modal-image-zoom-hint {
    display: none; /* shown via ::after pseudo-element instead */
}

.modal-image {
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: 3px;
    border: 2px solid var(--parchment-edge);
    box-shadow: 3px 6px 20px rgba(0,0,0,0.4);
    filter: sepia(0.25) brightness(0.95) contrast(1.08);
    display: block;
}

.modal-image-caption {
    font-family: var(--font-notes);
    font-style: italic;
    font-size: 0.7rem;
    color: var(--ink-faded);
    margin-top: 6px;
}


/* ----------------------------------------------------------------
   MODAL BODY SECTIONS
---------------------------------------------------------------- */
.modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-section {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.modal-section[hidden] { display: none; }

.modal-section-label {
    font-family: var(--font-heading);
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-faded);
    border-bottom: 1px solid rgba(120,80,20,0.25);
    padding-bottom: 2px;
    margin-bottom: 3px;
}

.modal-reward-value {
    font-family: var(--font-heading);
    font-size: clamp(1rem, 3vw, 1.3rem);
    font-weight: 700;
    color: var(--ink-gold);
}

.modal-reward-value::before { content: '⚜  '; font-size: 0.9em; }

.modal-location-value {
    font-family: var(--font-notes);
    font-style: italic;
    font-size: 0.9rem;
    color: var(--ink-mid);
}

.modal-divider {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--ink-gold);
    letter-spacing: 0.3em;
    opacity: 0.7;
    padding: 2px 0;
}

.modal-description-text {
    font-family: var(--font-body);
    font-size: clamp(0.88rem, 2.2vw, 0.98rem);
    color: var(--ink-mid);
    line-height: 1.75;
}

.modal-notes-text {
    font-family: var(--font-notes);
    font-style: italic;
    font-size: clamp(0.8rem, 2vw, 0.88rem);
    color: var(--ink-faded);
    line-height: 1.65;
    padding: 10px 14px;
    background: rgba(180,140,60,0.1);
    border-left: 3px solid var(--parchment-edge);
    border-radius: 0 3px 3px 0;
}

/* Tags inside modal */
.modal-section--tags {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
}

.modal-tag {
    font-family: var(--font-heading);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faded);
    border: 1px solid var(--parchment-edge);
    padding: 3px 8px;
    border-radius: 2px;
    background: rgba(180,140,80,0.15);
}


/* ----------------------------------------------------------------
   MODAL FOOTER STAMP
---------------------------------------------------------------- */
.modal-footer {
    margin-top: 24px;
    padding-top: 14px;
    border-top: 1px dashed var(--parchment-edge);
    text-align: center;
}

.modal-footer-stamp {
    font-family: var(--font-notes);
    font-style: italic;
    font-size: 0.7rem;
    color: var(--ink-faded);
    opacity: 0.6;
    letter-spacing: 0.06em;
}


/* Very small phones: modal goes nearly full-screen */
@media (max-width: 400px) {
    .modal-paper {
        max-height: 95vh;
        padding: 18px 16px 24px;
        border-radius: 2px;
    }
    .modal-title { font-size: 1.2rem; }
    .modal-seal-area { top: 12px; left: 12px; }
    .modal-seal { width: 40px; height: 40px; font-size: 1.1rem; }
}


/* ----------------------------------------------------------------
   IMAGE LIGHTBOX
---------------------------------------------------------------- */
.img-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 5vw, 48px);
    animation: backdropFadeIn 0.18s ease forwards;
}

.img-lightbox[hidden] { display: none; }

.img-lightbox-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 2, 1, 0.92);
    cursor: pointer;
}

.img-lightbox-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    animation: paperRise 0.2s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
    max-width: 90vw;
    max-height: 90vh;
}

.img-lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--wood-dark);
    border: 2px solid var(--parchment-edge);
    color: var(--parchment-light);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.15s;
}
.img-lightbox-close:hover { background: var(--wood-highlight); }
.img-lightbox-close:focus-visible { outline: 3px solid var(--parchment-edge); outline-offset: 2px; }

.img-lightbox-img {
    max-width: 90vw;
    max-height: 78vh;
    object-fit: contain;
    border: 3px solid var(--parchment-edge);
    border-radius: 3px;
    box-shadow: 0 16px 64px rgba(0,0,0,0.9);
    display: block;
}

.img-lightbox-caption {
    font-family: var(--font-notes);
    font-style: italic;
    font-size: 0.75rem;
    color: var(--parchment-dark);
    text-align: center;
    opacity: 0.8;
    max-width: 480px;
}


/* ----------------------------------------------------------------
   HIGH CONTRAST MODE
---------------------------------------------------------------- */
@media (forced-colors: active) {
    .flier { border: 2px solid ButtonText; }
    .flier-pin { background: ButtonText; }
    .modal-paper { border: 2px solid ButtonText; }
    .modal-close-btn { border: 2px solid ButtonText; }
}


/* ----------------------------------------------------------------
   UTILITY — visually hidden (for screen readers)
---------------------------------------------------------------- */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}


/* ----------------------------------------------------------------
   REDUCED MOTION — respect prefers-reduced-motion
---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .flier,
    .modal-backdrop,
    .modal-paper {
        animation: none;
        transition: none;
    }
    .flier:hover { transform: none; }
}


/* ----------------------------------------------------------------
   PRINT — minimal, hide chrome
---------------------------------------------------------------- */
@media print {
    .banner,
    .board-masthead,
    .board-header-bar,
    .board-footer-bar,
    .modal-backdrop,
    .img-lightbox { display: none !important; }
    body { background: white !important; }
    .board-grid { column-count: 2; }
}
