/* ============================================================
   LOCATION — /lokatsia/<region>/<settlement>/ (taxonomy-location.php)

   Loaded on top of archive.css (band, reading list, sidebar) and
   archive-place.css (.place-grid, .place-item, .place-tiles), so
   this file only adds what the hub has of its own: the picture
   under the band, and the rhythm between its sections.
   ============================================================ */

/* ---- Picture ------------------------------------------------------

   Cropped to a band rather than shown whole: it sets the scene, and
   a full 3:2 photo would push every section below the fold. The
   subject is kept by object-position, not by a crop in the editor.
   ------------------------------------------------------------------- */

.location-hero {
    max-width: 1480px;
    margin: clamp(20px, 3vw, 32px) auto 0;
    padding: 0 clamp(20px, 4vw, 56px);
}

.location-hero__image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center;
    border-radius: var(--radius-lg);
    background: var(--c-surface-tint);
}

@media (min-width: 900px) {
    .location-hero__image {
        aspect-ratio: 3 / 1;
    }
}

/* ---- Sections -----------------------------------------------------

   Each section is a .section-title (base.css) over a body that
   shares the archive's width and gutters, so the tiles, the place
   cards and the article list below all line up on one edge.
   ------------------------------------------------------------------- */

.location-section {
    margin-top: clamp(32px, 5vw, 56px);
}

/* Only when no article list follows — that brings its own padding. */
.location-hub > .location-section:last-child {
    margin-bottom: clamp(48px, 7vw, 80px);
}

.location-section__body {
    max-width: 1480px;
    margin: 0 auto;
    padding: clamp(20px, 3vw, 28px) clamp(20px, 4vw, 56px) 0;
}

.location-section__body .archive-more {
    margin-top: clamp(20px, 3vw, 28px);
}

.location-articles-title {
    margin-top: clamp(32px, 5vw, 56px);
}

/* ---- Index --------------------------------------------------------

   /lokatsia/ (template-locations.php): one band per region — the name
   large, what it holds beside it, a "whole region" link at the far
   end — and its settlements as photo cards below. No box around a
   band: the cards are the colour, the bands are only rhythm.
   ------------------------------------------------------------------- */

.location-index {
    max-width: 1480px;
    margin: 0 auto;
    padding: clamp(12px, 2vw, 20px) clamp(20px, 4vw, 56px) clamp(48px, 7vw, 80px);
}

.location-region {
    padding: clamp(28px, 4vw, 48px) 0;
}

.location-region + .location-region {
    border-top: 1px solid var(--c-border);
}

.location-region__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    margin-bottom: clamp(16px, 2.2vw, 24px);
}

.location-region__name {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

/* The same accent tick the archive title carries. */
.location-region__name::before {
    content: "";
    flex: 0 0 auto;
    width: 5px;
    height: 0.9em;
    border-radius: 2px;
    background: var(--c-accent);
}

.location-region__name a {
    color: var(--c-ink);
    text-decoration: none;
    transition: color 0.15s ease;
}

.location-region__name a:hover {
    color: var(--c-accent);
}

.location-region__meta {
    margin: 0;
    padding: 5px 12px;
    border-radius: var(--radius-badge);
    background: var(--c-surface-tint);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--c-ink-soft);
}

.location-region__all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--c-accent);
    text-decoration: none;
}

.location-region__all svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s ease;
}

.location-region__all:hover svg {
    transform: translateX(4px);
}

/* ---- Location cards -----------------------------------------------

   template-parts/location-card.php, on the index and on a region's
   page. Portrait, photo to the edges, name on a scrim at the bottom,
   counts in a badge-shaped chip at the top. The photo slowly zooms and
   the arrow slides in on hover; the card itself lifts.

   On a phone the grid becomes one swipeable row with snap points —
   a region with twelve settlements would otherwise be three screens
   of scrolling before the next region.
   ------------------------------------------------------------------- */

.location-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: clamp(14px, 1.8vw, 22px);
}

.location-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    isolation: isolate;
    border-radius: var(--radius-lg);
    background: var(--c-surface-tint);
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 1px 2px var(--c-shadow);
    transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease;
}

.location-card:hover,
.location-card:focus-visible {
    transform: translateY(-6px);
    box-shadow: 0 24px 40px -24px var(--c-shadow), 0 0 0 2px var(--c-accent);
}

.location-card:focus-visible {
    outline: none;
}

.location-card__image {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.location-card:hover .location-card__image {
    transform: scale(1.08);
}

/* Scrim — the same bottom-up navy the hero images use. */
.location-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--grad-media-scrim);
}

/* No photo anywhere at this location: an accent panel, the initial set
   huge and faint, the scrim still under the name. */
.location-card--plain {
    background:
        radial-gradient(120% 90% at 100% 0%, var(--c-accent) 0%, transparent 60%),
        linear-gradient(160deg, var(--c-accent-deep) 0%, #0a1233 100%);
}

.location-card__initial {
    position: absolute;
    top: 8%;
    right: -4%;
    z-index: -2;
    font-family: var(--font-display);
    font-size: clamp(7rem, 12vw, 10rem);
    font-weight: 700;
    line-height: 1;
    color: rgba(255, 255, 255, 0.14);
    pointer-events: none;
}

.location-card__meta {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 6px 12px;
    border-radius: var(--radius-badge);
    /* Dark glass, not light: most of these photos are sky at the top,
       and white on frosted white disappears. */
    background: rgba(10, 18, 51, 0.5);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.location-card__body {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 18px;
}

.location-card__name {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 1.8vw, 1.6rem);
    font-weight: 700;
    line-height: 1.1;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.25);
}

.location-card__go {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--c-accent);
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.location-card__go svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.location-card:hover .location-card__go,
.location-card:focus-visible .location-card__go {
    opacity: 1;
    transform: translateX(0);
}

/* Touch screens have no hover, so the arrow is simply there. */
@media (hover: none) {
    .location-card__go {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 639px) {
    .location-cards {
        display: flex;
        gap: 12px;
        margin: 0 calc(-1 * clamp(20px, 4vw, 56px));
        padding: 4px clamp(20px, 4vw, 56px) 12px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: clamp(20px, 4vw, 56px);
        scrollbar-width: none;
    }

    .location-cards::-webkit-scrollbar {
        display: none;
    }

    .location-card {
        flex: 0 0 68%;
        scroll-snap-align: start;
    }

    .location-region__all {
        margin-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .location-card,
    .location-card__image,
    .location-card__go,
    .location-region__all svg {
        transition: none;
    }

    .location-card:hover,
    .location-card:hover .location-card__image {
        transform: none;
    }
}
