/* web.css - website-only layout, injected by the web build into its copy of
   index.html (never loaded by the TV app or the widget). Scoped to
   html[data-mode="web"], which the build stamps on the city pages.

   The first screen stays the app exactly as it is (100vh); the page can
   scroll past it to the server-rendered sections (.city-seo). The layers
   the app keeps fixed on a TV are confined to the first screen here. */

html[data-mode="web"] {
    height: auto;
    overflow-y: auto;
}

html[data-mode="web"] body {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow: visible;
    /* The app paints the sky with background-attachment: fixed + cover. On a
       scrolling page that re-fits the image every time the mobile address bar
       shows or hides and jumps; a fixed backdrop element sized to the large
       viewport does not. */
    background-image: none;
    background-attachment: scroll;
}

html[data-mode="web"] body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100lvh;
    background: var(--bg-color) var(--bg-image) no-repeat center center;
    background-size: cover;
    z-index: -1;
    pointer-events: none;
}

/* city pages: no weather widget, no effects, no switch for them */
html[data-page="city"] #weatherWidget,
html[data-page="city"] .alarm-item:has(#weather_effects) {
    display: none !important;
}

html[data-mode="web"] .container {
    height: 100vh;
    margin: 0 auto;
}

html[data-mode="web"] .birds {
    height: 100vh;
}

html[data-mode="web"] .clouds-layer {
    position: absolute;
    height: 85vh;
}

html[data-mode="web"] footer {
    position: static;
    padding: 1.5rem 0 1rem;
    display: block;
}

html[data-mode="web"] #version {
    position: static;
    display: inline-block;
    margin-left: 1rem;
}

/* ---- server-rendered sections below the first screen ---- */

.city-seo {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: min(1100px, calc(100% - 2rem));
    margin: 2rem auto 1rem;
    padding: clamp(1.25rem, 3vw, 2.5rem);
    border-radius: 12px;
    background: rgba(8, 20, 16, 0.55);
    color: #f4f7f5;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-size: 1rem;
    line-height: 1.55;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.city-seo h1 {
    margin: 0.25rem 0 1rem;
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    line-height: 1.2;
    text-wrap: balance;
}

.city-seo h2 {
    margin: 2rem 0 0.75rem;
    font-size: clamp(1.15rem, 2.4vw, 1.5rem);
    line-height: 1.25;
}

.city-seo p {
    margin: 0.6rem 0;
    max-width: 75ch;
}

.city-seo a {
    color: #ffd54f;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.city-seo a:hover,
.city-seo a:focus-visible {
    color: #ffe58a;
    outline: none;
}

.city-seo code {
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.92em;
    background: rgba(255, 255, 255, 0.12);
    padding: 0 0.3em;
    border-radius: 3px;
}

.city-crumbs {
    font-size: 0.9rem;
    opacity: 0.85;
}

.city-lead {
    font-size: 1.05rem;
}

.city-meta {
    font-size: 0.92rem;
    opacity: 0.85;
}

.city-tablewrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.city-seo table {
    border-collapse: collapse;
    width: 100%;
    font-variant-numeric: tabular-nums;
}

.city-seo th,
.city-seo td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    white-space: nowrap;
}

.city-seo thead th {
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.8;
}

.city-times {
    max-width: 28rem;
}

.city-times td {
    font-size: 1.15rem;
    font-weight: bold;
}

.city-month tr.is-today th,
.city-month tr.is-today td {
    background: rgba(255, 213, 79, 0.18);
    font-weight: bold;
}

.city-faq dt {
    margin-top: 0.9rem;
    font-weight: bold;
}

.city-faq dd {
    margin: 0.2rem 0 0;
    max-width: 75ch;
}

.city-links {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
}

.city-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.3rem 1rem;
}

.city-countries {
    font-size: 0.92rem;
    line-height: 1.9;
}

.city-more {
    margin-top: 2rem;
}

@media (max-width: 600px) {
    .city-seo {
        width: calc(100% - 1.5rem);
        border-radius: 8px;
    }
    .city-seo th,
    .city-seo td {
        padding: 0.4rem 0.5rem;
        font-size: 0.9rem;
    }
    .city-times td {
        font-size: 1.05rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html[data-mode="web"] {
        scroll-behavior: auto;
    }
}

/* ---- home page city list ---- */

.city-home h3 {
    margin: 1.4rem 0 0.4rem;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.85;
}

.city-home .city-links-grid li {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.city-home small {
    opacity: 0.75;
    font-size: 0.85em;
}

/* featured pair (Makkah and Madinah) above the continents */

.city-featured {
    margin: 1.2rem 0 0.5rem;
    gap: 0.75rem 1rem;
}

.city-featured li {
    flex: 1 1 14rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid rgba(255, 213, 79, 0.55);
    border-radius: 8px;
    background: rgba(255, 213, 79, 0.10);
}

.city-featured a {
    display: block;
    font-size: 1.35rem;
    font-weight: bold;
    text-decoration: none;
}

.city-featured a:hover,
.city-featured a:focus-visible {
    text-decoration: underline;
}

.city-featured small {
    display: block;
    margin-top: 0.15rem;
    opacity: 0.8;
}

.city-home h1 {
    font-size: clamp(1.35rem, 3vw, 1.9rem);
}
