/* Painting page — deep zoom viewer + "the secrets of the painting" (explore.js).
   Colours: theme.css variables only. */

.explore {
    position: relative; isolation: isolate; margin-top: 3px; overflow: hidden;
    background: #000; border: 2px solid #535353; border-radius: 5px;
    box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.ex-viewer { position: relative; width: 100%; height: min(84vh, 980px); background: #000; }
.ex-noscript { display: block; max-width: 100%; margin: 0 auto; }

/* Dims everything except the open secret (a soft spotlight that follows the view). */
.ex-spot {
    position: absolute; inset: 0; z-index: 2; pointer-events: none;
    opacity: 0; transition: opacity .6s ease;
}
.explore.focus .ex-spot { opacity: 1; }

/* The glowing points */
.ex-dot {
    position: relative; z-index: 3; width: 26px; height: 26px; padding: 0; cursor: pointer;
    border-radius: 50%; border: 2px solid var(--c-on-fill);
    background: rgba(184,132,74,.55); box-shadow: 0 0 0 3px rgba(0,0,0,.35);
    opacity: 0; transition: opacity .6s ease, transform .2s ease, background .2s ease;
}
.explore.ready .ex-dot { opacity: 1; }
.ex-dot::before {
    content: ""; position: absolute; inset: -9px; border-radius: 50%;
    border: 2px solid var(--c-text); opacity: 0; animation: ex-pulse 2.6s infinite;
}
.ex-dot:hover, .ex-dot:focus-visible { transform: scale(1.25); background: var(--c-line-hover); }
/* the open secret: the point becomes a thin ring AROUND the detail, so it hides nothing */
.ex-dot.on { transform: scale(3.2); background: transparent; border-width: 1px; box-shadow: none;
    border-color: rgba(243,230,196,.75); }
.ex-dot.on::before { animation: none; opacity: 0; }
.ex-dot.on .ex-tip { display: none; }
.explore.focus .ex-dot:not(.on) { opacity: .45; }
@keyframes ex-pulse { 0% { transform: scale(.7); opacity: .9; } 80%, 100% { transform: scale(1.7); opacity: 0; } }
.ex-tip {
    position: absolute; left: 50%; bottom: 135%; transform: translateX(-50%);
    white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s;
    background: #000; color: var(--c-text); border: 1px solid var(--c-line); border-radius: 3px;
    padding: 4px 9px; font: 600 12px/1.3 'Inter', sans-serif;
}
.ex-dot:hover .ex-tip, .ex-dot:focus-visible .ex-tip { opacity: 1; }

/* Tools: zoom in / out / whole painting / full screen */
.ex-tools {
    position: absolute; z-index: 4; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 6px;
}
.ex-tools button, .ex-start, .ex-nav button, .ex-x {
    cursor: pointer; background: rgba(0,0,0,.72); color: var(--c-text);
    border: 1px solid var(--c-line); border-radius: 3px; font-family: 'Inter', sans-serif;
    transition: background .15s, border-color .15s, color .15s;
}
.ex-tools button { width: 38px; height: 38px; font-size: 19px; line-height: 1; }
.ex-tools button:hover, .ex-start:hover, .ex-nav button:hover, .ex-x:hover {
    background: var(--c-glow); border-color: var(--c-line-hover); color: #fff;
}

/* Invitation (top left): "The secrets of the painting — Start the tour" */
.ex-intro {
    position: absolute; z-index: 4; left: 12px; top: 12px;          /* top: never covers the points */
    display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 18px;
    background: rgba(0,0,0,.72); border: 1px solid var(--c-line-soft); border-radius: 40px;
    white-space: nowrap;
}
.ex-kicker { color: var(--c-on-fill); font: 600 16px 'Playfair Display', Georgia, serif; }
.ex-start { padding: 9px 16px; border-radius: 30px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }

/* The balloon with the secret — right side on a computer, bottom on a phone */
.ex-balloon {
    position: absolute; z-index: 4; top: 50%; right: 4%; width: min(400px, 40%);
    transform: translateY(-50%); box-sizing: border-box; padding: 22px 24px 18px;
    background: rgba(8,6,4,.92); border: 1px solid var(--c-line); border-radius: 8px;
    box-shadow: 0 18px 50px rgba(0,0,0,.7); text-align: left;
}
.ex-balloon::before {                       /* the little tail pointing to the detail */
    content: ""; position: absolute; left: -9px; top: 50%; width: 16px; height: 16px;
    margin-top: -8px; transform: rotate(45deg); background: rgba(8,6,4,.92);
    border-left: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line);
}
.ex-balloon.show { animation: ex-in .5s ease .35s both; }
@keyframes ex-in { from { opacity: 0; transform: translateY(-46%); } to { opacity: 1; transform: translateY(-50%); } }
.ex-x { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; font-size: 18px; line-height: 1; }
.ex-count { color: var(--c-line-hover); font: 600 11px 'Inter', sans-serif; letter-spacing: .22em; text-transform: uppercase; }
.ex-balloon h3 { margin: 6px 36px 2px 0; color: var(--c-on-fill); font: 600 26px/1.2 'Playfair Display', Georgia, serif; }
.ex-tag { margin: 0 0 12px; color: var(--c-text); font: 600 15px 'Inter', sans-serif; }
.ex-text { margin: 0; color: #e8e1d4; font: 17px/1.7 Georgia, 'Times New Roman', serif; }
.ex-nav { display: flex; gap: 8px; margin-top: 18px; }
.ex-nav button { flex: 1; padding: 9px 6px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }

.ex-intro[hidden], .ex-balloon[hidden] { display: none; }
/* "Only the painting": no points, no invitation, no hints */
/* !important: OpenSeadragon writes display:block on the points itself */
.explore.clean .ex-dot, .explore.clean .ex-intro, .explore.clean .ex-toast { display: none !important; }
.ex-tools .ex-clean { display: flex; align-items: center; justify-content: center; }
.ex-tools .ex-clean[aria-pressed="true"] { background: var(--c-line); color: #fff; border-color: var(--c-line-hover); }
.ex-size { color: var(--c-text); }
/* Quiet zoom hint (replaces OpenSeadragon's full-picture dark overlay) */
.ex-toast {
    position: absolute; z-index: 5; left: 50%; bottom: 16px; transform: translate(-50%, 6px);
    padding: 7px 14px; border-radius: 20px; pointer-events: none; opacity: 0;
    background: rgba(0,0,0,.78); border: 1px solid var(--c-line-soft); color: var(--c-on-fill);
    font: 500 13px 'Inter', sans-serif; white-space: nowrap; transition: opacity .3s, transform .3s;
}
.ex-toast.show { opacity: 1; transform: translate(-50%, 0); }
.ex-hint { margin: 6px 0 0; text-align: center; color: #8f877a; font: 13px 'Inter', sans-serif; }

@media (max-width: 700px) {
    .ex-viewer { height: 72vh; }
    .ex-balloon {
        top: auto; bottom: 10px; left: 10px; right: 10px; width: auto; transform: none;
        max-height: 52%; overflow-y: auto; padding: 16px 16px 14px;
    }
    .ex-balloon::before { left: 50%; top: -9px; margin: 0 0 0 -8px; transform: rotate(135deg); }
    .ex-balloon.show { animation: ex-in-m .5s ease .35s both; }
    @keyframes ex-in-m { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
    .ex-balloon h3 { font-size: 21px; }
    .ex-text { font-size: 16px; line-height: 1.6; }
    .ex-intro { top: 10px; left: 10px; right: 56px; justify-content: space-between;
                padding: 8px 8px 8px 14px; gap: 8px; white-space: normal; }
    .ex-kicker { font-size: 14px; }
    .ex-start { padding: 8px 12px; letter-spacing: .08em; }
    .ex-tools button { width: 34px; height: 34px; }
}
