/* ==========================================================================
   LAYOUT
   ========================================================================== */

#layout {
    width: 100%;
    height: 100%;
}

#portrait {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   CURSEUR
   ========================================================================== */

#top,
#what,
#instance,
#path,
#bubble {
    cursor: pointer;
}

/* ==========================================================================
   TOP
   ========================================================================== */

#top {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 40px;
    padding: 1vh 2vh;
    color: var(--color-topText);
    background: var(--color-top);
    user-select: none;
}

/* ==========================================================================
   WHAT
   ========================================================================== */

#whatContainer {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    padding: 1vh 2vh;
    overflow: hidden;
    background: var(--color-whatContainer);
    box-shadow: 0 4px 8px -2px rgba(0,0,0,.25);
    user-select: none;
}

#what {
    margin-top: .5vh;
    overflow: hidden;
    font-size: var(--font-size-lg);
    text-align: center;
}

#what::after {
    content: "▼";
    margin-left: 1vh;
}

#what.where-opened::after {
    content: "▲";
}

#where {
    display: none;
    margin: .5vh 0;
    padding-top: .5vh;
    overflow: hidden;
    font-size: var(--font-size-lg);
    background: var(--color-where);
    border-top: 1px solid rgba(46,46,46,.18);
    user-select: none;
}

#where.open {
    display: block;
}

#instance,
#path,
#bubble {
    display: flex;
    align-items: center;
    height: 4vh;
    line-height: 3vh;
}

#instance {
    margin-left: 1vh;
}

#path {
    margin-left: 3.5vh;
}

#bubble {
    margin-left: 5vh;
}

#instancePrefix,
#pathPrefix,
#bubblePrefix,
#instanceContent,
#pathContent,
#bubbleContent {
    display: inline-block;
    height: 3vh;
    line-height: 3vh;
    vertical-align: top;
}

#instancePrefix img,
#pathPrefix img,
#bubblePrefix img {
    display: block;
    width: auto;
    height: 3vh;
    margin-right: .6vh;
}

/* ==========================================================================
   WORK
   ========================================================================== */

#workContainer {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: var(--color-work);
}

#buttons {
    flex: 0 0 auto;
}

#work {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 2vh;
    background: var(--color-work);
}

/* ==========================================================================
   WHEN
   ========================================================================== */

.when-date {
    font-weight: 700;
}

.when-date::before {
    content: "•";
    margin-right: .8vh;
}

.when-label {
    margin-left: 5vh;
    margin-bottom: 2vh;
}

.when-item {
    cursor: pointer;
}

#whereMap {
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   BOTTOM
   ========================================================================== */

#bottom {
    min-height: 40px;
    background: var(--color-bottom);
}

/* ==========================================================================
   TIP & LOCK
   ========================================================================== */

#tip {
    visibility: hidden;
    position: absolute;
    inset: 0;
    overflow: auto;
    overflow-wrap: anywhere;
    background: var(--color-bottom);
    z-index: 10000;
    padding: 2vh;
}

#tip pre {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    font: inherit;
}

#lockLayer {
    visibility: hidden;
    position: fixed;
    inset: 0;
    background: rgba(32,32,32,.25);
    pointer-events: none;
    z-index: 1000;
}

.lockSpinner,
.lockText {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.lockSpinner {
    width: var(--spinner-size);
    height: var(--spinner-size);
    object-fit: contain;
}

.lockText {
    padding: 3vh;
    background: var(--color-lockText);
    border: 2px;
}

.lockButton {
    margin: 2vh;
}

/* ==========================================================================
   LANDSCAPE
   ========================================================================== */

@media (orientation: landscape) {

    #portrait {
        width: auto;
        height: 100%;
        margin-inline: auto;
        aspect-ratio: 1;
    }

    #top,
    #bottom {
        min-height: 0;
    }

    #bottom {
        height: 2vh;
    }
}

/* ==========================================================================
   MISC
   ========================================================================== */

.smallIcon {
    width: auto;
    height: 3vh;
    flex: 0 0 auto;
    object-fit: contain;
    margin-right: .2vh;
}