/* ============================================================
   SINGLE PLACE — the directory object page.

   Loaded on is_singular('place') only, on top of entry.css. A place
   carries no generated article markup, so this file builds the whole
   layout rather than styling a pre-built one.

   Everything here uses the tokens from variables.css. The card and the
   badge reuse the Benqu shape language: flat surfaces, one square
   corner on chips, hairline borders instead of heavy shadows.
   ============================================================ */

/* ---- Header extras ------------------------------------------------ */

/* Sits beside the type badge in .entry-terms. Deliberately not a link:
   "Избор на редакцията" is a statement, not a filter. */
.place-pick {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--c-accent);
    border-radius: var(--radius-badge);
    color: var(--c-accent);
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Price level renders all four marks and dims the ones above the
   rating, so the scale itself is visible rather than implied. */
.place-price {
    display: inline-flex;
    gap: 2px;
}

.place-price b {
    font-weight: 600;
}

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

.place-closed {
    max-width: 1480px;
    margin: 0 auto 24px;
    padding: 14px 20px;
    border-left: 3px solid #ff002a;
    background: #fff1f3;
    color: #8d0018;
    font-weight: 600;
}

/* ---- Layout ------------------------------------------------------- */

/*
 * One column. It held two — the article and a 320px sticky info rail —
 * until the practical band grew past what a rail can carry and moved
 * under the article at full width. The sticky constraint went with it:
 * nothing in here is sticky now, so Chrome's clamping of a sticky grid
 * item to the container's content box no longer shapes this file.
 */
/*
 * The horizontal padding matches .entry-header in entry.css rather than
 * being 20px flat: the practical band is the first thing under the hero
 * image now, and a bordered card wider than the photo above it reads as
 * a mistake. The top padding is the gap under that image — the header
 * has no bottom padding of its own.
 */
.place-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
    max-width: 1480px;
    margin: 0 auto;
    padding: clamp(28px, 4vw, 44px) clamp(20px, 4vw, 56px) 64px;
    align-items: start;
}

/* The grid track is already minmax(0, 1fr), but the item inside it
   keeps min-width: auto, which a wide table can still push past —
   the column grows and the whole page scrolls sideways instead of
   the table doing it. entry.css gives a table overflow-x: auto; this
   is the half that lets it work. */
.place-main {
    min-width: 0;
}

.place-why {
    margin: 0 0 32px;
    padding-left: 20px;
    border-left: 3px solid var(--c-accent);
    color: var(--c-ink);
    font-family: var(--font-display);
    font-size: 1.35rem;
    line-height: 1.45;
    font-weight: 500;
}

/* ---- The practical band ------------------------------------------- */

/*
 * Full width under the article. The tint is the accent at a few percent
 * rather than a flat panel colour, so the band reads as part of the
 * palette in both themes without a second surface token.
 */
.place-card {
    position: relative;
    padding: clamp(22px, 3vw, 34px);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--c-accent) 5%, transparent), transparent 220px),
        var(--c-surface);
    box-shadow: 0 1px 3px var(--c-shadow);
}

.place-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: clamp(18px, 2.4vw, 26px);
}

/* The one square corner is the theme's signature — see variables.css. */
.place-card__kicker {
    margin: 0;
    padding: 6px 18px;
    border-radius: var(--radius-badge);
    background: var(--c-ink);
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* The БТС number, for the objects that carry one. */
.place-card__number {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 700;
    line-height: 1;
    color: var(--c-accent);
    letter-spacing: -0.02em;
}

/*
 * Separate tiles in a wrapping flex row, not hairline cells in a grid.
 *
 * The grid version had two faults that one long value exposed at once:
 * a price list in a 230px cell stretched its whole row to eleven lines,
 * and auto-fit keeps its empty tracks as soon as any item spans the row,
 * so the short facts left holes beside them. In a flex row every line
 * shares out its own width, and the long facts simply take a line.
 */
.place-card__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.place-fact {
    position: relative;
    flex: 1 1 220px;
    min-width: 0;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    grid-auto-rows: min-content;
    column-gap: 14px;
    row-gap: 4px;
    align-content: start;
    padding: 16px 18px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    background: var(--c-surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.place-fact:hover,
.place-fact:focus-within {
    border-color: color-mix(in srgb, var(--c-accent) 35%, var(--c-border));
    box-shadow: 0 10px 24px -14px var(--c-glow);
    transform: translateY(-2px);
}

/* Long facts — prices, directions, hours — take a line of their own. */
.place-fact--wide {
    flex-basis: 100%;
}

/* Everything after the icon sits in the second column. */
.place-fact > :not(.place-fact__icon) {
    grid-column: 2;
}

/* The one square corner is the theme's signature — see variables.css. */
.place-fact__icon {
    grid-column: 1;
    grid-row: 1 / span 3;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 0 14px 14px 14px;
    background: color-mix(in srgb, var(--c-accent) 11%, transparent);
    color: var(--c-accent);
}

.place-fact__icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* The reason a collector opened the page at all. */
.place-fact--stamp {
    border-color: color-mix(in srgb, var(--c-accent) 40%, var(--c-border));
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--c-accent) 12%, transparent), transparent 70%),
        var(--c-surface);
}

.place-fact--stamp .place-fact__icon {
    background: var(--c-accent);
    color: #fff;
}

.place-fact__label {
    margin: 2px 0 0;
    font-family: var(--font-display);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-ink-faint);
}

/*
 * `anywhere` rather than `break-word`: a URL with no hyphen and no
 * slash inside a long segment has no break opportunity at all, and
 * break-word only helps once the browser has already given up on a
 * whole word.
 */
.place-fact__value {
    margin: 0;
    color: var(--c-ink);
    font-size: 0.98rem;
    font-weight: 500;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.place-fact__value a {
    color: var(--c-accent);
    text-decoration: none;
    background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
    transition: background-size 0.25s ease;
}

.place-fact__value a:hover {
    background-size: 100% 1px;
}

/* Walking time as a pill under the directions. */
.place-fact__walk {
    justify-self: start;
    margin: 6px 0 0;
    padding: 4px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--c-accent) 11%, transparent);
    font-family: var(--font-display);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--c-accent);
}

/* One chip per price clause; the amounts carry the accent. */
.place-prices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
}

.place-prices li {
    margin: 0;
    padding: 7px 14px;
    border: 1px solid var(--c-border);
    /* Not a full pill: a clause that wraps on a phone turns a pill into a blob. */
    border-radius: 16px;
    background: var(--c-surface-tint);
    color: var(--c-ink-soft);
    font-size: 0.88rem;
    line-height: 1.35;
}

.place-prices strong {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--c-accent);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Unhidden by share.js once it knows a clipboard route exists. */
.place-fact__copy {
    justify-self: start;
    margin-top: 6px;
    padding: 3px 10px;
    border: 1px solid var(--c-border-strong);
    border-radius: 999px;
    background: none;
    color: var(--c-ink-faint);
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    /*
     * Quiet but always there. It was hidden until the tile was hovered,
     * which reads as tidy and behaves as a secret: nothing tells a reader
     * the address can be copied, and a keyboard or touch user never
     * discovers it at all.
     */
    opacity: 0.6;
    transition: opacity 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.place-fact__copy[hidden] {
    display: none;
}

.place-fact:hover .place-fact__copy,
.place-fact__copy:hover,
.place-fact__copy:focus-visible {
    opacity: 1;
}

.place-fact__copy:hover,
.place-fact__copy.is-flashing {
    border-color: var(--c-accent);
    color: var(--c-accent);
}

/* ---- Actions ------------------------------------------------------ */

.place-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: clamp(18px, 2.4vw, 26px);
}

.place-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-md);
    background: var(--c-surface);
    color: var(--c-ink);
    font-family: var(--font-body);
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.place-action:hover {
    border-color: var(--c-accent);
    color: var(--c-accent);
    transform: translateY(-1px);
}

.place-action--primary {
    border-color: var(--c-accent);
    background: var(--c-accent);
    color: #fff;
}

.place-action--primary:hover {
    background: var(--c-accent-deep);
    border-color: var(--c-accent-deep);
    color: #fff;
}

/*
 * The embed had no styling at all and rendered at the iframe default of
 * 300x150 — a stamp-sized map beside a full-width band. It only appears
 * when a Maps key is configured; see inc/places.php for why
 * this particular Google surface is the one that costs nothing.
 */
.place-map {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 6;
    min-height: 220px;
    margin-top: clamp(18px, 2.4vw, 26px);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
}

@media (max-width: 700px) {
    .place-map {
        aspect-ratio: 4 / 3;
    }
}

.place-card__credit {
    margin: 20px 0 0;
    color: var(--c-ink-faint);
    font-size: 0.8rem;
}

.place-card__credit a {
    color: inherit;
}

.place-hours {
    width: 100%;
    max-width: 420px;
    margin-top: 4px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.place-hours th,
.place-hours td {
    padding: 5px 0;
    text-align: left;
    font-weight: 400;
    color: var(--c-ink-soft);
}

.place-hours td {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.place-hours .is-today th,
.place-hours .is-today td {
    color: var(--c-ink);
    font-weight: 600;
}

/* ---- Features ----------------------------------------------------- */

.place-features {
    margin-top: 48px;
}

.place-features__group + .place-features__group {
    margin-top: 20px;
}

.place-features__label {
    margin: 0 0 8px;
    color: var(--c-ink-faint);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

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

    /* Sticky is pointless once the card is stacked under the content,
       and it would trap the card mid-scroll on a short viewport. */
    .place-card {
        position: static;
        order: -1;
    }

    .place-why {
        font-size: 1.15rem;
    }
}

/* ---- The band on a phone ------------------------------------------ */

@media (max-width: 700px) {
    .place-fact {
        flex-basis: 100%;
    }

    .place-card__actions .place-action {
        flex: 1 1 auto;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .place-fact,
    .place-fact__copy,
    .place-action,
    .place-fact__value a {
        transition: none;
    }

    .place-fact:hover,
    .place-fact:focus-within,
    .place-action:hover {
        transform: none;
    }
}

/* ---- Reviews ------------------------------------------------------ */

/*
 * Inside the practical band, below the map. Nothing of it is ours: the
 * component fetches, renders and attributes on its own, which is what
 * lets the page show reviews without holding any. See inc/places.php.
 */
.place-reviews {
    margin-top: clamp(22px, 3vw, 32px);
    padding-top: clamp(22px, 3vw, 32px);
    border-top: 1px solid var(--c-border);
}

.place-reviews__head {
    margin-bottom: 16px;
}

.place-reviews__title {
    margin: 0 0 6px;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--c-ink);
}

.place-reviews__note {
    max-width: 62ch;
    margin: 0;
    color: var(--c-ink-faint);
    font-size: 0.86rem;
    line-height: 1.55;
}

.place-reviews__panel[hidden] {
    display: none;
}

.place-reviews__panel {
    margin-top: 18px;
}

/*
 * The component ships its own shadow DOM and its own type. Only the box
 * around it is ours — restyling the inside would fight an element whose
 * markup is Google's to change, and their attribution rules ask that the
 * content is left as it comes.
 */
.place-reviews__panel gmp-place-details {
    display: block;
    width: 100%;
    max-width: 720px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
