/* Pattern-definition illustrations & lightbox (issue #3). Shared by
   definitions.php and the analyse.php hover popovers. */

/* Reference illustrations render at a fixed 500 px width (shrinking only on
   narrow screens) and invite a click to enlarge. */
.definition-img {
    width: 500px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 6px 0;
    border: 1px solid #ddd;
    cursor: zoom-in;
}

/* References footnotes */
.def-ref a { text-decoration: none; }
.definition-refs {
    margin: 8px 0 0;
    padding-left: 20px;
    font-size: 0.85em;
    color: #444;
}
.definition-refs li { margin-bottom: 2px; }

/* Popovers on analyse.php must be wide enough to hold a 500 px illustration,
   and tall content should scroll rather than overflow the screen. */
.popover.def-popover {
    max-width: 540px;
}
.popover.def-popover .popover-body {
    max-height: 70vh;
    overflow-y: auto;
}
.popover.def-popover .definition-img {
    width: 500px;
    max-height: none;
}

/* Full-screen lightbox */
.def-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 20000;
    background: rgba(0, 0, 0, 0.85);
    cursor: zoom-out;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.def-lightbox.open { display: flex; }
.def-lightbox-img {
    max-width: 96vw;
    max-height: 92vh;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
    background: #fff;
}
.def-lightbox-close {
    position: fixed;
    top: 12px;
    right: 20px;
    font-size: 42px;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    z-index: 20001;
}
