/* Realistic Pergola viewer: one stylesheet for both builds of build_viewer.py.
   Embedded (web bundle): stage in the page flow, controls below; colours from the host page's
   tokens (--tinte, --tinte-2, --seite, --platte, --raster) where they exist.
   .pv-vollbild (single offline file): full-window stage with a floating panel. */

.pv {
    --pv-tinte: var(--tinte, #1c2328);
    --pv-tinte-2: var(--tinte-2, #56626b);
    --pv-seite: var(--seite, #fff);
    --pv-platte: var(--platte, #c9d3da);
    --pv-raster: var(--raster, rgba(28, 35, 40, .15));
    margin: 0;
}

.pv-buehne {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    max-height: 85vh;
    background: var(--pv-platte);
    border: 1px solid var(--pv-raster);
}
.pv-buehne canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}
.pv-status {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 16px;
    text-align: center;
    color: var(--pv-tinte-2);
}
.pv-status[hidden] { display: none; }

.pv button,
.pv input { font: inherit; }
.pv-start,
#reset,
.pv-seg button {
    min-height: 44px;
    padding: 0 16px;
    color: var(--pv-tinte);
    background: var(--pv-seite);
    border: 1px solid var(--pv-tinte);
    border-radius: 0;
    cursor: pointer;
    touch-action: manipulation;
}
.pv-start:hover,
#reset:hover,
.pv-seg button[aria-pressed="false"]:hover { background: var(--pv-platte); }
.pv-start { position: absolute; right: 12px; bottom: 12px; }
.pv-seg { display: inline-flex; }
.pv-seg button + button { border-left: 0; }
.pv-seg button[aria-pressed="true"] { color: var(--pv-seite); background: var(--pv-tinte); }

.pv-teil { min-height: 1.55em; margin: 8px 0 0; font-weight: 600; }

#panel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 8px; }
#panel[hidden] { display: none; }
#panel label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
#panel input { margin: 0; accent-color: var(--pv-tinte); }
#panel details { flex: 0 0 100%; }
#panel summary { display: flex; align-items: center; min-height: 44px; color: var(--pv-tinte-2); cursor: pointer; }
#panel summary::before { content: "+"; width: 1.2em; }
#panel details[open] summary::before { content: "\2212"; }
#groups { display: flex; flex-wrap: wrap; gap: 0 16px; }
#groups i { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 2px; }
#hint { flex: 0 0 100%; margin: 0; color: var(--pv-tinte-2); font-size: 14px; }

@media (min-width: 560px) {
    .pv-buehne { aspect-ratio: 3 / 2; }
}
/* Phones: the stage spans the screen width (the host page pads its content with --rand). */
@media (max-width: 559px) {
    .pv-buehne { margin-inline: calc(-1 * var(--rand, 0px)); border-inline: 0; }
}

/* Single offline file */
.pv-vollbild {
    position: fixed;
    inset: 0;
    color: var(--pv-tinte);
    font: 14px/1.35 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.pv-vollbild .pv-buehne { position: absolute; inset: 0; aspect-ratio: auto; max-height: none; margin: 0; border: 0; }
.pv-vollbild #panel {
    position: absolute;
    top: 12px;
    left: 12px;
    display: block;
    width: 232px;
    max-height: calc(100% - 24px);
    overflow: auto;
    box-sizing: border-box;
    margin: 0;
    padding: 10px 12px;
    background: rgba(255, 255, 255, .84);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--pv-raster);
    border-radius: 10px;
}
.pv-vollbild #panel h1 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.pv-vollbild #panel label { display: flex; min-height: 32px; }
.pv-vollbild .pv-seg { display: flex; margin-bottom: 6px; }
.pv-vollbild .pv-seg button { flex: 1; min-width: 0; min-height: 32px; padding: 0 6px; }
.pv-vollbild #reset { width: 100%; min-height: 32px; margin-top: 8px; padding: 0 6px; }
.pv-vollbild #hint { margin-top: 8px; font-size: 12px; }
.pv-vollbild .pv-teil { position: absolute; left: 12px; right: 12px; bottom: 14px; margin: 0; text-align: center; pointer-events: none; }
.pv-vollbild .pv-teil span { display: inline-block; max-width: 100%; padding: 6px 12px; color: #fff; background: rgba(28, 35, 40, .88); border-radius: 8px; font-size: 13px; font-weight: 400; }
.pv-vollbild .pv-teil span:empty { display: none; }
.pv-vollbild :focus-visible { outline: 2px solid #2b6cb0; outline-offset: 2px; }
@media (max-width: 600px) {
    .pv-vollbild #panel { width: 196px; padding: 8px 10px; }
    .pv-vollbild #hint { display: none; }
}
