/* Palette: one place to retheme. */
:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --ink: #1e293b;
    --muted: #64748b;
    --line: #e2e8f0;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
}

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    font-family: "Segoe UI", Inter, system-ui, -apple-system, Roboto, sans-serif;
    background: var(--bg);
}

a { color: var(--accent-dark); }

/* ---- header (mirrors ChatPort's: brand left, hamburger right) ---- */
.wi-nav {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
}

.wi-nav-row {
    min-height: 56px;
    gap: 10px;
    padding: 0 32px;
    width: 100%;
}

.wi-brand {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    line-height: 1.1;
}

.wi-title {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--ink);
}

.wi-accent { color: var(--accent); }

.wi-subtitle {
    font-size: .85rem;
    font-weight: 500;
    color: var(--muted);
    margin-top: 2px;
}

.wi-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1050;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
    padding: 12px 18px;
    min-width: 180px;
}

.wi-menu .nav-link { color: var(--ink); }
.wi-menu .nav-link:hover { color: var(--accent-dark); }

@media (max-width: 480px) {
    .wi-nav-row { padding: 0 16px; }
    .wi-title { font-size: 1.45rem; }
    .wi-subtitle { font-size: .78rem; }
    .navbar-toggler { padding: .2rem .5rem; }
}

/* ---- pages ---- */
.wi-main {
    flex: 1;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 28px 20px 12px;
    box-sizing: border-box;
}

.wi-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, .08);
    padding: 28px 22px;
    text-align: center;
}

.wi-headline {
    margin: 0 0 8px;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -.03em;
}

.wi-blurb { margin: 0 0 22px; color: var(--muted); }

.wi-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wi-form input {
    flex: 1 1 14rem;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    color: var(--ink);
}

.wi-form input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.wi-form button {
    flex: 1 0 auto;
    padding: 12px 28px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 700;
}

.wi-form button:hover { background: var(--accent-dark); }

@media (min-width: 481px) {
    .wi-form button { flex-grow: 0; }
}

.wi-message {
    min-height: 1.5em;
    margin: 14px 0 0;
    color: #b91c1c;
}

.wi-about { text-align: left; line-height: 1.6; }
.wi-about p:last-child { margin-bottom: 0; }

/* ---- slideshow ---- */
/* While playing, the page is exactly one window tall: header, pictures, footer. The pictures
   take whatever height the other two leave. */
body.wi-playing {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

body.wi-playing .wi-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-width: none;
    padding: 0;
}

body.wi-playing .wi-card { display: none; }
body.wi-playing .wi-footer { margin-top: 0; }

/* z-index 0 keeps everything inside the slideshow underneath the header's drop-down menu. */
.wi-show {
    position: relative;
    z-index: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: #000;
}

.wi-show[hidden] { display: none; }

/* Two stacked slides. Swapping which one is visible makes the crossfade. */
.wi-slide {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.wi-slide.is-visible { opacity: 1; }

.wi-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.wi-slide img:not([src]) { visibility: hidden; }

/* Scaled past the edges so the blur has no pale rim. */
.wi-backdrop {
    object-fit: cover;
    filter: blur(32px) brightness(.45) saturate(1.2);
    transform: scale(1.15);
}

.wi-photo {
    object-fit: contain;
    will-change: transform;
}

.wi-show-status {
    position: absolute;
    top: 50%;
    left: 50%;
    width: max-content;
    max-width: calc(100% - 32px);
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 8px 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, .7);
    text-align: center;
    color: #e2e8f0;
    pointer-events: none;
}

.wi-show-status:empty { display: none; }

.wi-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 40px 16px 18px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .7));
    transition: opacity .4s ease;
}

.wi-source {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .85rem;
    color: #e2e8f0;
}

.wi-source:hover { color: #fff; }

/* The four buttons share the width evenly, so they fit the narrowest phone. */
.wi-buttons {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 26rem;
}

.wi-buttons button {
    flex: 1 1 0;
    min-width: 0;
}

/* Top corner, well away from the row at the bottom, so it isn't hit by accident. */
.wi-download {
    position: absolute;
    top: 12px;
    right: 12px;
    transition: opacity .4s ease;
}

.wi-download[hidden] { display: none; }

.wi-pill {
    min-height: 44px;
    padding: 10px 14px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    background: rgba(15, 23, 42, .6);
    color: #fff;
    font: inherit;
    font-weight: 600;
    touch-action: manipulation;
}

.wi-pill:disabled { opacity: .4; }

/* Only where there's a real pointer. A touch screen would leave the highlight stuck on. */
@media (hover: hover) {
    .wi-pill:not(:disabled):hover { background: rgba(51, 65, 85, .85); }
}

/* After a few still seconds, nothing but the picture. */
.wi-show.is-idle { cursor: none; }

.wi-show.is-idle .wi-controls,
.wi-show.is-idle .wi-download {
    opacity: 0;
    visibility: hidden;
    transition: opacity .4s ease, visibility 0s .4s;
}

/* Footer: thin light rule, small ClarkApps mark beside one centred line (same as WebShare) */
.wi-footer {
    margin: 2rem 0 1rem;
    text-align: center;
    border-top: 1px solid #e8eaed;
}

.footer-company {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 10px;
    text-align: center;
}

.footer-company-logo {
    height: 32px;
    width: auto;
    display: block;
    margin: 0;
}

.footer-company-line {
    display: block;
    color: #777;
    line-height: 1.5;
}

.footer-company-line a {
    color: #0066cc;
    text-decoration: none;
}

.footer-company-line a:hover { text-decoration: underline; }
