/*
 * Kulturschatzsuche PWA - entry screens: start, scanner, place page and the
 * workspace switch. Only what app.css (the ported prototype) does not carry.
 */

/* ----- Code panel ----- */

/* Without JavaScript the real input is the visible field and the boxes go. */
html:not(.js) .code-boxes input {
    position: static;
    display: block;
    width: 100%;
    height: 57px;
    padding: 0 16px;
    opacity: 1;
    color: var(--ink);
    caret-color: auto;
    background: var(--paper);
    border: 1.5px solid var(--field-line);
    border-radius: 12px;
    font: 500 24px/1 Jost,sans-serif;
    letter-spacing: 6px;
    text-align: center;
}

html:not(.js) .code-boxes input:focus {
    border-color: var(--green);
}

html:not(.js) .code-digits {
    display: none;
}

/* The invisible input's own outline would show as a faint frame; focus is
   drawn by the boxes (.code-boxes:focus-within). */
.js .code-boxes input:focus-visible {
    outline: none;
}

/* Until code-entry.js has run, a panel without four digits already looks disabled. */
.js .code-panel[data-code-pending] .primary {
    background: var(--disabled-bg);
    color: var(--disabled-ink);
}

/* Admins may set codes of up to ten digits: more, narrower boxes. */
.code-digits[data-count="5"] {
    grid-template-columns: repeat(5,minmax(0,1fr));
}

.code-digits[data-count="6"] {
    grid-template-columns: repeat(6,minmax(0,1fr));
    gap: 7px;
}

.code-digits[data-count="7"] {
    grid-template-columns: repeat(7,minmax(0,1fr));
    gap: 5px;
}

.code-digits[data-count="8"] {
    grid-template-columns: repeat(8,minmax(0,1fr));
    gap: 5px;
}

.code-digits[data-count="9"] {
    grid-template-columns: repeat(9,minmax(0,1fr));
    gap: 4px;
}

.code-digits[data-count="10"] {
    grid-template-columns: repeat(10,minmax(0,1fr));
    gap: 4px;
}

.code-digits[data-count="7"] span,
.code-digits[data-count="8"] span,
.code-digits[data-count="9"] span,
.code-digits[data-count="10"] span {
    font-size: 19px;
    border-radius: 9px;
}

/* ----- Start ----- */

.entry {
    padding-bottom: 26px;
}

/* The prototype's resume-card h2, as a paragraph: it sits above the page's h1. */
.resume-card .resume-title {
    font: 500 22px/1.3 Fraunces,serif;
    color: var(--ink);
    margin: 5px 0;
    overflow-wrap: anywhere;
}

.entry-guide {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.entry-guide h2 {
    font: 500 25px/1.2 Fraunces,serif;
    letter-spacing: -.6px;
}

.entry-guide .intro-steps {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
}

.entry-guide .intro-step span {
    font-size: 12px;
    line-height: 1.7;
}

.entry-account {
    margin-top: 24px;
    color: inherit;
}

.entry-account .visit-icon {
    color: var(--green);
}

/* ----- Scanner ----- */

.camera-button .icon {
    margin-left: 0;
}

.camera-button .camera-icon-stop,
.camera-button[data-state="running"] .camera-icon-start {
    display: none;
}

.camera-button[data-state="running"] .camera-icon-stop {
    display: block;
}

html:not(.js) .camera-button,
html:not(.js) .camera-status {
    display: none;
}

/* ----- Place page ----- */

.detail .screen-top .overline {
    flex: none;
    white-space: nowrap;
}

.detail .screen-top .place-name {
    min-width: 0;
    text-align: right;
    overflow-wrap: anywhere;
}

.detail .detail-body p+p {
    margin-top: 10px;
}

.detail-info {
    list-style: none;
    margin: -6px 0 6px;
    padding: 0;
}

.detail-info li {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    font-size: 11px;
    line-height: 1.8;
    color: var(--muted);
}

.detail-info li>.icon {
    width: 19px;
    height: 19px;
    color: var(--green);
}

.detail-info address {
    font-style: normal;
    padding: 6px 0;
}

.detail-info a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--green);
    font-weight: 700;
    text-underline-offset: 4px;
    overflow-wrap: anywhere;
}

.detail .guide-inline+.primary {
    margin-top: 8px;
}

.detail>.quiet {
    margin-top: 6px;
}

.detail-login {
    margin-top: 8px;
    border-top: 1px solid var(--line);
}

.detail-login a {
    color: var(--green);
    font-weight: 700;
    text-underline-offset: 3px;
}

/* ----- Workspace switch ----- */

.switch-lead {
    margin: 12px 0 22px;
}

.switch-lead p {
    font-size: 11px;
    line-height: 1.8;
    color: var(--muted);
    max-width: 270px;
}

.switch-lead .overline {
    display: block;
    color: var(--ink);
    margin-bottom: 3px;
}

.workspace-switch h1 {
    font-size: 38px;
    margin: 0 0 12px;
}

.switch-route {
    list-style: none;
    margin: 22px 0 6px;
    padding: 0;
    border-top: 1px solid var(--line);
}

.switch-route li {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
}

.switch-route li>div {
    min-width: 0;
}

.switch-route .visit-icon {
    color: var(--green);
}

.switch-route .switch-target .visit-icon {
    background: var(--sun);
    color: #173F38;
}

.switch-route small {
    display: block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    color: var(--muted);
}

.switch-route strong {
    display: block;
    font: 500 21px/1.3 Fraunces,serif;
    letter-spacing: -.4px;
    overflow-wrap: anywhere;
}

.workspace-switch .button-stack {
    margin-top: 16px;
}

.workspace-switch .button-stack form {
    margin: 0;
}

.workspace-switch .small-note {
    text-align: center;
    margin-top: 14px;
}

@media (max-width:370px) {
    .entry-guide h2 {
        font-size: 23px;
    }
    .workspace-switch h1 {
        font-size: 33px;
    }
    .code-digits[data-count="6"],
    .code-digits[data-count="7"],
    .code-digits[data-count="8"] {
        gap: 4px;
    }
    .code-digits[data-count="9"],
    .code-digits[data-count="10"] {
        gap: 3px;
    }
    .code-digits[data-count="9"] span,
    .code-digits[data-count="10"] span {
        font-size: 17px;
    }
}
