/* ==========================================
   Akademia Muzyczna - Infokiosk Styles
   Based on Brand Guidelines
   ========================================== */

/* Typefaces are self-hosted; see css/fonts.css, linked from every page. */

/* CSS Variables - Brand Colors */
:root {
    /* Brand palette (unchanged: black + yellow) with neutral support tones */
    --color-black: #000000;
    --color-ink: #1A1A1A;          /* primary text — softer than pure black */
    --color-yellow: #FFB800;
    --color-white: #FFFFFF;
    --color-paper: #FAFAFA;        /* page background */
    --color-gray-light: #F2F2F2;
    --color-gray: #6B6B6B;         /* secondary text — AA contrast on white */
    --color-line: #E4E4E4;         /* hairline borders */

    /* Typography */
    --font-display: 'Spectral', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 48px;
    --spacing-xl: 64px;

    /* Geometry */
    --radius: 4px;

    /* How far the sub-page header insets its two sides. Named because the map
       page reads it back: its back button is pulled from this inset out to the
       floor selector's own, so the two line up. A bare 64px in that calc would
       come apart the first time this changed. */
    --header-pad-x: var(--spacing-xl);

    /* Touch targets - minimum 48px for accessibility */
    --touch-target-min: 48px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 220ms ease;
}

/* Reset & Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    /* Takes double-tap zoom away without costing a tap. js/main.js used to do
       it by calling preventDefault() on touchend, which also cancelled the
       click the browser synthesises after it - so every second tap inside
       300ms was swallowed. This does not cover pinch; that guard is still in
       js/main.js. */
    touch-action: manipulation;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.5;
    color: var(--color-ink);
    background-color: var(--color-paper);
    min-height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    /* Prevent text selection on kiosk */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;

    /* Prevent context menu */
    -webkit-touch-callout: none;
}

/* Kiosk Container - Full screen 1920x1080 */
.kiosk-container {
    width: 100vw;
    height: 100vh;
    max-width: 1920px;
    max-height: 1080px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.logo {
    height: 104px;
    width: auto;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    background-color: var(--color-paper);
}

/* Page Title */
.page-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 3.25rem;
    letter-spacing: -0.01em;
    color: var(--color-ink);
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

/* Navigation Buttons Container */
.nav-buttons {
    display: flex;
    gap: var(--spacing-lg);
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
    max-width: 1500px;
    width: 100%;
}

/* Main Navigation Button — editorial card, left-aligned, hairline border */
.nav-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: var(--spacing-md);

    flex: 1 1 0;
    max-width: 460px;
    min-height: 320px;
    padding: var(--spacing-lg);

    background-color: var(--color-white);
    border: 1px solid var(--color-line);
    border-radius: var(--radius);

    text-decoration: none;
    color: var(--color-ink);

    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: border-color var(--transition-normal), background-color var(--transition-normal);

    -webkit-tap-highlight-color: transparent;
}

/* Yellow accent rule that grows along the bottom on interaction */
.nav-button::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 0;
    background-color: var(--color-yellow);
    transition: width var(--transition-normal);
}

/* Hover only where a pointer can actually rest on something. On the kiosk's
   touch screen the browser holds :hover until the next tap somewhere else, so a
   tapped control kept its highlight long after the finger had gone. :focus and
   :active are deliberately left outside the query - they are what gives touch
   its feedback.

   And only off the kiosk: every :hover rule is behind `.web`. The kiosk on
   Windows 10 answers (hover: hover) - Windows moves the cursor to every tap -
   and a page opened after the countdown lit whatever button sat under the last
   tap, typically the one that had led away from the home screen (21.10.2026). */
.nav-button:focus {
    border-color: var(--color-ink);
    background-color: var(--color-paper);
}

.nav-button:focus::after {
    width: 100%;
}

@media (hover: hover) {
    .web .nav-button:hover {
        border-color: var(--color-ink);
        background-color: var(--color-paper);
    }

    .web .nav-button:hover::after {
        width: 100%;
    }
}

.nav-button:active {
    background-color: var(--color-gray-light);
}

/* Button Icon */
.nav-button__icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-ink);
}

.nav-button__icon svg {
    width: 100%;
    height: 100%;
}

/* Button Title */
.nav-button__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.875rem;
    text-align: center;
    line-height: 1.15;
}

/* Button Description */
.nav-button__description {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.0625rem;
    text-align: center;
    color: var(--color-gray);
    line-height: 1.45;
}

/* Sub-page Styles */
.subpage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--header-pad-x);
    background-color: var(--color-white);
    border-bottom: 2px solid var(--color-yellow);
}

/* Header side containers (for centering logo in subpage headers) */
.header-side {
    width: 180px;
    flex-shrink: 0;
}

.header-side--left {
    display: flex;
    justify-content: flex-start;
}

.header-side--right {
    display: flex;
    justify-content: flex-end;
}

/* Back Button — quiet outlined / ghost style.

   The vertical padding is --spacing-xs rather than --spacing-sm so the button
   lands on min-height instead of overshooting it: 8 + 8 either side of a 26px
   line is 42, under the 48 of --touch-target-min, which then decides the
   height. That is the same 48 the language toggle opposite settles at, so the
   two sit level — the header centres its items, so at 58px this one used to
   overhang the toggle by five pixels top and bottom. */
.back-button {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-md);

    background-color: transparent;
    color: var(--color-ink);
    border: 1px solid var(--color-line);
    border-radius: var(--radius);

    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.01em;

    text-decoration: none;
    cursor: pointer;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);

    min-height: var(--touch-target-min);
    min-width: 150px;
    justify-content: center;
}

.back-button:focus {
    border-color: var(--color-ink);
    background-color: var(--color-white);
}

@media (hover: hover) {
    .web .back-button:hover {
        border-color: var(--color-ink);
        background-color: var(--color-white);
    }
}

.back-button__icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-button__icon svg {
    width: 100%;
    height: 100%;
}

/* Sub-page Content */
.subpage-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    text-align: center;
}

.subpage-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 3.25rem;
    letter-spacing: -0.01em;
    color: var(--color-ink);
    margin-bottom: var(--spacing-md);
}

.subpage-subtitle {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.375rem;
    color: var(--color-gray);
}

/* Placeholder content for blank pages */
.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-xl);
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    background-color: var(--color-white);
}

.placeholder-icon {
    width: 64px;
    height: 64px;
    color: var(--color-gray);
}

.placeholder-icon svg {
    width: 100%;
    height: 100%;
}

.placeholder-text {
    font-family: var(--font-body);
    font-size: 1.25rem;
    color: var(--color-gray);
}

/* Idle timeout overlay */
.idle-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.idle-overlay.active {
    opacity: 1;
    visibility: visible;
}

.idle-overlay__text {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 2.25rem;
    color: var(--color-white);
    text-align: center;
}

.idle-overlay__countdown {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 6rem;
    line-height: 1;
    color: var(--color-yellow);
}

.idle-overlay__dismiss {
    font-family: var(--font-body);
    font-size: 1.25rem;
    color: var(--color-white);
    opacity: 0.7;
}

/* Brak połączenia.
 *
 * Dyskretny pasek w rogu, nie modal: kiosk offline nadal robi swoje — plany i
 * opisy sal siedzą w cache'u — a informacja jest głównie dla obsługi budynku.
 * Rezerwowany jest tylko róg, więc nic nie przesuwa się, gdy pasek się pojawia.
 */
.offline-badge {
    position: fixed;
    left: var(--spacing-sm);
    bottom: var(--spacing-sm);
    z-index: 900;
    padding: var(--spacing-xs) var(--spacing-md);
    background-color: #FFF7E6;
    border: 1px solid var(--color-yellow);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: #7A6A3F;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.offline-badge--on {
    opacity: 1;
    visibility: visible;
}

/* Footer */
.footer {
    padding: var(--spacing-sm) var(--spacing-xl);
    background-color: var(--color-black);
    color: var(--color-white);
    text-align: center;
}

.footer__text {
    font-family: var(--font-body);
    /* 13px was legible on a laptop and small on a screen read at arm's length. */
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.85);
}

/* Responsive adjustments for testing on smaller screens */
@media screen and (max-width: 1400px) {
    .nav-button {
        width: 320px;
        height: 320px;
    }

    .nav-button__icon {
        width: 80px;
        height: 80px;
    }

    .nav-button__title {
        font-size: 1.5rem;
    }

    .nav-button__description {
        font-size: 1rem;
    }

    .page-title {
        font-size: 2.5rem;
    }
}

@media screen and (max-width: 1000px) {
    .nav-buttons {
        flex-direction: column;
        align-items: center;
    }

    .nav-button {
        width: 100%;
        max-width: 400px;
        height: auto;
        min-height: 200px;
        flex-direction: row;
        padding: var(--spacing-md);
    }

    .nav-button__icon {
        width: 48px;
        height: 48px;
    }
}

/* ==========================================
   Language Toggle (header)
   ========================================== */

.lang-toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.lang-toggle__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
    padding: var(--spacing-xs) var(--spacing-md);
    background-color: transparent;
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9375rem;
    letter-spacing: 0.06em;
    color: var(--color-ink);
    cursor: pointer;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
    text-decoration: none;
}

.lang-toggle__btn:focus {
    border-color: var(--color-ink);
    background-color: var(--color-white);
}

@media (hover: hover) {
    .web .lang-toggle__btn:hover {
        border-color: var(--color-ink);
        background-color: var(--color-white);
    }
}


/* ==========================================
   Przeglądarka: telefon, tablet, komputer
   ==========================================

   Wszystko poniżej stoi za `.web` na <html>, którą ustawia js/mode.js tylko
   poza kioskiem. Kiosk ma pierwszeństwo: na nim żadna z tych reguł nie ma
   prawa zadziałać, więc wygląda co do piksela tak, jak przed nimi. Nowa reguła
   dla przeglądarki trafia tutaj i nosi `.web` — nigdy do reguł wyżej.

   Mapa (body.map-page) ma swój układ na całą wysokość okna i jeszcze go
   zachowuje; dostosuje ją css/map.css. */

.web body {
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
    -webkit-touch-callout: default;
}

/* Strona, która się przewija, zamiast kadru 1920x1080. */
.web body:not(.map-page) {
    overflow: auto;
    overflow-x: hidden;
}

.web body:not(.map-page) .kiosk-container {
    width: 100%;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: none;
    overflow: visible;
}

/* Logo przycięte do znaku (js/main.js podmienia plik) — w tej samej wysokości
   co na kiosku byłoby kilka razy większe niż tam. */
.web .logo {
    height: 64px;
}

@media (max-width: 1100px) {
    .web {
        --header-pad-x: var(--spacing-md);
    }

    .web .main-content,
    .web .subpage-content {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .web .page-title,
    .web .subpage-title {
        font-size: 2.5rem;
    }

    .web .footer {
        padding: var(--spacing-sm) var(--spacing-md);
    }
}

@media (max-width: 1100px) {
    /* Strona główna: trzy przyciski jeden pod drugim, ikona obok tytułu — od
       tabletu w dół. Trzy obok siebie mieszczą się dopiero na szerokim ekranie,
       a reguła kiosku dla węższych (max-width: 1000px) daje im wiersz, w którym
       tytuł i opis stoją obok siebie w wąskich kolumnach. */
    .web .nav-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
    }

    /* `flex: 1 1 0` z układu kiosku dzieli szerokość rzędu; w kolumnie
       dzieliłby wysokość i zgniótł przyciski do zera. */
    .web .nav-button {
        flex: none;
        display: grid;
        grid-template-columns: 40px 1fr;
        grid-template-areas:
            "icon title"
            "icon text";
        align-items: center;
        column-gap: var(--spacing-sm);
        row-gap: 2px;
        width: 100%;
        max-width: 640px;
        margin: 0 auto;
        min-height: 0;
        height: auto;
        padding: var(--spacing-md) var(--spacing-lg);
        text-align: left;
    }

    .web .nav-button__icon {
        grid-area: icon;
        width: 40px;
        height: 40px;
    }

    .web .nav-button__title {
        grid-area: title;
        font-size: 1.625rem;
        text-align: left;
    }

    .web .nav-button__description {
        grid-area: text;
        font-size: 1rem;
        text-align: left;
    }
}

@media (max-width: 700px) {
    .web {
        --header-pad-x: var(--spacing-sm);
    }

    .web .subpage-header {
        gap: var(--spacing-xs);
        padding-top: var(--spacing-xs);
        padding-bottom: var(--spacing-xs);
    }

    /* Boki nagłówka dzielą miejsce po równo, więc logo zostaje na środku, a
       nie 180 px od każdej krawędzi ekranu, który ma ich 390. */
    .web .header-side {
        width: auto;
        flex: 1 1 0;
        min-width: 0;
    }

    .web .logo {
        height: 40px;
        min-width: 0;
        max-width: 50vw;
        object-fit: contain;
    }

    /* „Powrót" zostaje strzałką; napis czyta czytnik ekranu. */
    .web .back-button {
        position: relative;
        min-width: var(--touch-target-min);
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .web .back-button > span[data-i18n] {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .web .lang-toggle__btn {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .web .main-content,
    .web .subpage-content {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .web .page-title,
    .web .subpage-title {
        font-size: 1.875rem;
        margin-bottom: var(--spacing-md);
    }

    .web .subpage-subtitle {
        font-size: 1.0625rem;
    }

    .web .nav-button {
        padding: var(--spacing-md);
    }

    .web .nav-button__title {
        font-size: 1.375rem;
    }

    .web .nav-button__description {
        font-size: 0.9375rem;
    }

    .web .footer__text {
        font-size: 0.75rem;
    }
}
