/* ============================================================
   PLACE ARCHIVE — /mesta/, /tip-myasto/, /osobenost/ and
   /kolektsia/.

   Loaded on top of archive.css, which already supplies the
   breadcrumb band, the archive title, the load-more button and the
   status line. This file only adds the filter panel and the grid.

   A grid rather than archive.css's horizontal reading list: places
   are compared, not read in order.
   ============================================================ */

/* ---- Catalogue overview -------------------------------------------

   What the bare /mesta/ opens on: the three axes of the directory,
   each tile a count and a way in. Markup in
   template-parts/place-overview.php.

   Sits on the page background rather than on --c-surface, so the white
   filter band directly below it reads as a separate thing and not as
   the bottom of this one.

   Neutral tiles on purpose. .category-tile is one hue per category and
   only three of these slugs have a hue; the count is what carries the
   weight here instead.
   ------------------------------------------------------------------- */

.place-overview {
    background: var(--c-bg);
}

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

.place-overview__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 2.4vw, 1.75rem);
    font-weight: 700;
    color: var(--c-ink);
}

.place-overview__lead {
    margin: 6px 0 0;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--c-ink-soft);
}

.place-overview__band {
    margin-top: clamp(20px, 3vw, 28px);
}

.place-overview__band-title {
    margin: 0 0 10px;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--c-ink-faint);
}

.place-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.place-tile {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 18px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    background: var(--c-surface);
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.place-tile:hover {
    border-color: var(--c-accent);
    transform: translateY(-2px);
    box-shadow: 0 14px 28px -20px var(--c-shadow);
}

.place-tile__count {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
    color: var(--c-accent);
}

.place-tile__name {
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--c-ink);
}

@media (max-width: 600px) {
    .place-tiles {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .place-tile {
        padding: 14px;
    }

    .place-tile__count {
        font-size: 1.6rem;
    }
}

/* ---- Filter panel -------------------------------------------------

   Chips for the vocabularies that fit in a row, a small form for the
   three that do not — search, location, sort. Markup and reasoning in
   template-parts/place-filters.php.

   Deliberately not sticky. The navbar is already sticky at z-index 40
   from 1024px up, so a second sticky band would have to be offset by
   the navbar's height — a number that lives in header.css and changes
   there. A filter that follows the reader down a page of 24 cards is
   not worth a cross-file constant that breaks silently.
   ------------------------------------------------------------------- */

.place-filters {
    border-bottom: 1px solid var(--c-border);
    background: var(--c-surface);
}

.place-filters__inner {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 1480px;
    margin: 0 auto;
    padding: 18px clamp(20px, 4vw, 56px);
}

.place-filters__row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* The leaves of the chosen group. Set back so the row reads as a
   refinement of the row above it rather than a second, equal choice. */
.place-filters__row--leaves {
    padding-left: 14px;
    border-left: 2px solid var(--c-border);
}

.place-filters__row--leaves .place-chip {
    padding: 4px 14px;
    font-size: 0.8rem;
}

/* ---- Chip --------------------------------------------------------- */

.place-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* The count is the whole point of the chip carrying a number: it says
   what pressing it will leave. Muted, because the label is what is
   being read and the number is what is being checked. */
.place-chip__count {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--c-ink-faint);
}

.place-chip:hover .place-chip__count,
.place-chip.is-current .place-chip__count {
    color: rgba(255, 255, 255, 0.75);
}

.place-filters .tag-chip.is-current {
    border-color: var(--c-accent);
    background: var(--c-accent);
    color: #fff;
}

/* ---- The form half ------------------------------------------------ */

.place-filters__form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin: 0;
}

.place-filters__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
}

.place-filters__field--search {
    flex: 1 1 220px;
}

.place-filters__label {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--c-ink-faint);
}

.place-filters__field input,
.place-filters__field select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-md);
    background: var(--c-bg);
    color: var(--c-ink);
    font-family: var(--font-body);
    font-size: 0.92rem;
    line-height: 1.3;
}

.place-filters__field input:focus,
.place-filters__field select:focus {
    outline: 2px solid var(--c-accent);
    outline-offset: 1px;
}

.place-filters__submit {
    padding: 10px 22px;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--c-accent);
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.place-filters__submit:hover {
    background: var(--c-accent-deep);
}

/* Submitting is a full navigation, so the page is about to be replaced.
   The dimming is only there so a slow response does not look ignored. */
.place-filters__form.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ---- "Още филтри" -------------------------------------------------- */

.place-filters__more {
    border-top: 1px solid var(--c-border);
    padding-top: 12px;
}

.place-filters__summary {
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--c-accent);
}

.place-filters__summary:hover {
    color: var(--c-accent-deep);
}

.place-filters__group {
    margin-top: 14px;
}

.place-filters__group-title {
    margin: 0 0 8px;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--c-ink-faint);
}

/* ---- Count and escapes -------------------------------------------- */

.place-filters__result {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid var(--c-border);
    padding-top: 12px;
}

.place-filters__count {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--c-ink);
}

.place-filters__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0;
}

.place-filters__actions a {
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--c-accent);
    text-decoration: none;
}

.place-filters__actions a:hover {
    text-decoration: underline;
}

.place-filters__clear {
    color: var(--c-ink-faint) !important;
}

/* ---- Empty result -------------------------------------------------- */

/* archive.css styles .archive-empty as a paragraph; here it holds a
   line and a way out, so the type is restated on the child. */
.place-archive .archive-empty {
    padding: 48px 0;
    text-align: center;
}

.place-archive .archive-empty p {
    margin: 0 0 18px;
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--c-ink-soft);
}

.place-archive .archive-empty p:last-child {
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .place-filters__form {
        flex-direction: column;
        align-items: stretch;
    }

    .place-filters__result {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ---- Grid --------------------------------------------------------- */

.place-archive {
    max-width: 1480px;
    margin: 0 auto;
    padding: clamp(32px, 5vw, 56px) clamp(20px, 4vw, 56px) clamp(48px, 7vw, 80px);
}

.place-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: clamp(20px, 2.5vw, 32px);
}

/* ---- Card --------------------------------------------------------- */

.place-item {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    background: var(--c-surface);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.place-item:hover {
    border-color: var(--c-border-strong);
    transform: translateY(-2px);
}

.place-item__media {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3 / 2;
    background: var(--c-surface-tint);
    overflow: hidden;
    /* The theme has no global link reset, so an anchor with no text
       styling of its own still draws the browser's default underline —
       visible under the initial in the no-image state. */
    text-decoration: none;
}

.place-item__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/*
 * Most imported places have no photo, and will not for a while. A large
 * quiet initial keeps the grid from turning into rows of empty boxes
 * without pretending there is an image.
 */
.place-item__initial {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--c-border-strong);
}

.place-item__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 20px 20px;
}

.place-item__terms {
    margin: 0;
}

/* The badge is a label here, not a link — the filter row above already
   navigates by type. */
.place-item__terms .cat-badge {
    background: var(--c-ink);
}

.place-item__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.25;
}

.place-item__title a {
    color: var(--c-ink);
    text-decoration: none;
}

.place-item__title a:hover {
    color: var(--c-accent);
}

.place-item__why {
    margin: 0;
    color: var(--c-ink-soft);
    font-size: 0.92rem;
    line-height: 1.5;
}

/* Pushes the meta line to the bottom so cards of differing text length
   still line their footers up across a row. */
.place-item .entry-meta {
    margin: auto 0 0;
    padding-top: 4px;
}

.place-item .place-price {
    display: inline-flex;
    gap: 2px;
}

.place-item .place-price .is-off {
    opacity: 0.3;
}

/* ---- Narrow screens ----------------------------------------------- */

@media (max-width: 600px) {
    .place-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .place-item__media {
        aspect-ratio: 16 / 9;
    }
}
