/* ==========================================================================
   LexiPic Kiosk — Heritage Language Archive
   Stylesheet
   ========================================================================== */

/* ---- WordPress integration: fullscreen page + inline embed wrapper ----
   The original app's <body> carried the fullscreen layout classes
   directly (h-screen, flex, overflow-hidden via Tailwind utilities in
   index.html). In WordPress those same utility classes are now applied
   to .lexipic-kiosk-root inside two different containers: the bare
   fullscreen template's <body>, and the shortcode's inline wrapper div
   (which gets a fixed height instead of 100vh, since it sits inside a
   normal page's flow). */

html.lexipic-kiosk-fullscreen-html,
body.lexipic-kiosk-fullscreen-body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

.lexipic-kiosk-fullscreen-body .lexipic-kiosk-root {
    height: 100vh;
}

.lexipic-kiosk-embed-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.lexipic-kiosk-embed-wrapper .lexipic-kiosk-root {
    height: 100%;
}

.lexipic-kiosk-root {
    font-family: 'Inter', system-ui, sans-serif;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #d9c7a8;
    border-radius: 4px;
}

/* Kiosk Touch Interface Locks — scoped to the kiosk root only. The
   original standalone app applied these to <body> globally, which is
   correct for a dedicated kiosk device but would be wrong applied
   site-wide when the kiosk is embedded via shortcode on an otherwise
   normal WordPress page (visitors need normal text selection/scrolling
   everywhere else on that page). The fullscreen template's <body> is
   still locked down separately via .lexipic-kiosk-fullscreen-body above. */
.lexipic-kiosk-root {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-x pan-y;
}

/* ==========================================================================
   Screen transitions (Sets grid <-> Archive)
   ========================================================================== */

#screen-sets {
    transition: transform 0.3s ease-out, opacity 0.2s ease-out;
}

#screen-sets.lp-screen-hidden {
    transform: translateX(-6%);
    opacity: 0;
    pointer-events: none;
}

#screen-archive.lp-screen-active {
    transform: translateX(0);
}

/* ==========================================================================
   Set grid layout + group headers
   ========================================================================== */

.sets-grid {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 28px 40px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.group-header {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #a08a6f;
    padding: 12px 0 2px;
    border-top: 1px solid #ecdfc4;
    margin-top: 4px;
}

.group-header:first-child { border-top: none; margin-top: 0; }

/* ==========================================================================
   Set grid tiles
   ========================================================================== */

.lp-set-tile {
    background: #fffdf8;
    border: 1px solid #ecdfc4;
    border-radius: 16px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    box-shadow: 0 1px 2px rgba(61, 44, 31, 0.04);
}

.lp-set-tile:hover, .lp-set-tile:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -6px rgba(61, 44, 31, 0.15);
    border-color: #d99a4e;
    outline: none;
}

.lp-set-tile-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.lp-set-tile-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.lp-set-tile-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4ecdc;
    color: #b5763a;
}

.lp-set-tile-icon .material-icons { font-size: 22px; }

.lp-set-tile-name {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 1rem;
    color: #3d2c1f;
    line-height: 1.25;
}

.lp-set-tile-meta {
    font-size: 0.7rem;
    color: #a08a6f;
    text-transform: uppercase;
    letter-spacing: .05em;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 1px;
}

.lp-set-tile-meta .material-icons { font-size: 12px; }

.lp-set-tile-count {
    padding-top: 4px;
    font-size: 0.8rem;
    color: #b5763a;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

.lp-set-tile-count .material-icons { font-size: 14px; }

/* ==========================================================================
   Archive slider + cards
   ========================================================================== */

.lp-slider-wrapper {
    position: relative;
}

.lp-slider-container {
    display: flex;
    align-items: center;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.lp-slider-container::-webkit-scrollbar {
    display: none;
}

.lp-slider-container:empty::before {
    content: 'No entries in this set yet.';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border: 2px dashed #e8dcc4;
    border-radius: 18px;
    color: #a08a6f;
    font-size: 1rem;
    background: #fffdf8;
}

.lp-card-slot {
    flex: 0 0 100%;
    scroll-snap-align: start;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    box-sizing: border-box;
    overflow-x: hidden;
    height: 100%;
}

.lp-card {
    width: 90%;
    height: 90%;
    background: #f4ecdc;
    border: 1px solid #ecdfc4;
    border-radius: 20px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Side-by-side layout: image and text+play column share the card
   50/50 above the breakpoint below. Falls back to the original
   stacked (image-on-top) arrangement on narrow/portrait screens. */
@media (min-width: 640px) {
    .lp-card {
        flex-direction: row;
        align-items: stretch;
        gap: 28px;
    }
}

.lp-card-media {
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffff;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 20px;
}

@media (min-width: 640px) {
    .lp-card-media {
        flex: 0 0 calc(50% - 14px);
        width: auto;
        margin-bottom: 0;
    }
}

.lp-card img {
    max-width: 100%;
    max-height: 100%;
	border-radius: 14px;
    object-fit: contain;
}

.lp-card-no-img {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #c4ad88;
}

.lp-card-body {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

@media (min-width: 640px) {
    .lp-card-body {
        flex: 0 0 calc(50% - 14px);
        align-items: flex-start;
        text-align: left;
        justify-content: center;
        gap: 10px;
    }
}

.lp-card-title {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    margin-top: 12px;
}

@media (min-width: 640px) {
    .lp-card-title {
        justify-content: flex-start;
        margin-top: 0;
    }
}

.lp-script-display {
    font-family: 'Fraunces', 'Noto Sans Bengali', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #3d2c1f;
    line-height: 1.2;
}

.lp-roman-display {
    font-family: 'Fraunces', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #a08a6f;
    margin-left: 10px;
    line-height: 1.2;
}

.lp-card-desc {
    font-size: 0.9rem;
    color: #8a7560;
    text-align: center;
    font-style: italic;
    margin-top: 10px;
    max-width: 32rem;
}

@media (min-width: 640px) {
    .lp-card-desc {
        text-align: left;
        max-width: none;
    }
}

.lp-card-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    flex: none;
}

@media (min-width: 640px) {
    .lp-card-actions {
        justify-content: flex-start;
    }
}

.lp-play-btn {
    background: #3d2c1f;
    color: #f4ecdc;
    border: none;
    padding: 10px 22px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s;
}

.lp-play-btn:hover { background: #2c2015; }

/* ==========================================================================
   Nav buttons
   ========================================================================== */

.lp-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fffdf8;
    border: 1px solid #ecdfc4;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3d2c1f;
    box-shadow: 0 2px 8px rgba(61, 44, 31, 0.15);
    transition: background 0.15s;
}

.lp-nav-btn:hover { background: #f4ecdc; }
.lp-prev { left: 4px; }
.lp-next { right: 4px; }

@media (min-width: 640px) {
    .lp-prev { left: -6px; }
    .lp-next { right: -6px; }
}

/* ==========================================================================
   Active Saved Sets — reorder buttons (admin panel, kiosk-map slate theme)
   ========================================================================== */

#sets-list button.material-icons {
    font-size: 16px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ==========================================================================
   Admin inline status messages (replaces alert()/confirm() feedback)
   ========================================================================== */

.mediamap-status-line {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
}
.mediamap-status-line .material-icons {
    font-size: 14px;
}
.mediamap-status-ok { color: #4ade80; }
.mediamap-status-error { color: #fb7185; }
.mediamap-status-info { color: #93c5fd; }

/* ==========================================================================
   Header: title vs PIN input spacing (mobile only)
   On mobile the title block and the PIN box can end up close together
   since justify-between only guarantees they don't overlap, not a
   minimum gap. Force 10px of breathing room below the sm breakpoint;
   above it justify-between already spreads them across the bar.
   ========================================================================== */
.lexipic-kiosk-header-title {
    margin-right: 10px;
}

@media (min-width: 640px) {
    .lexipic-kiosk-header-title {
        margin-right: 0;
    }
}

/* ==========================================================================
   Right-click / long-press suppression
   ========================================================================== */
img, video, audio, canvas, iframe,
.lp-set-tile, .lp-card, .lp-card-media, .lp-card-body {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    user-drag: none;
}
