/*
 * Stylesheet for the public business pages (resources/views/listing/show.blade.php).
 *
 * Loaded *after* guide.css and depends on it: the colour tokens, the base type
 * and `.wrap` all come from there, and only what this page alone needs is
 * defined here. Same reasoning as the policy pages — one visual language, and a
 * second file that carries nothing the first already has.
 *
 * Logical properties throughout (`inline-start`, `margin-inline`), like
 * guide.css. This page is served `dir="rtl"` today, but nothing below assumes
 * it, so a French variant would need no CSS work.
 */

.listing-page {
    background: var(--bg);
    color: var(--text);
}

/* --- "get the app" banner ------------------------------------------------ */

.app-banner {
    background: var(--primary-soft);
    border-block-end: 1px solid var(--primary-line);
}

.app-banner-inner {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1rem;
    align-items: center;
    justify-content: space-between;
    padding-block: .7rem;
    font-size: .95rem;
}

.app-banner-cta {
    flex: none;
    background: var(--primary);
    color: #fff;
    padding: .45rem 1.1rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
}

.app-banner-cta:hover { background: var(--primary-strong); }

/* --- the page ------------------------------------------------------------ */

.listing-main { padding-block: 1.5rem 3rem; }

.listing-cover {
    display: block;
    inline-size: 100%;
    block-size: auto;
    /* A cap rather than a fixed height: covers arrive at whatever shape the
       owner's camera produced, and `object-fit` on an unknown aspect ratio is
       how you crop someone's shopfront out of their own photo. */
    max-block-size: 22rem;
    object-fit: cover;
    border-radius: var(--radius);
    background: var(--surface-alt);
    margin-block-end: 1.25rem;
}

.crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .5rem;
    font-size: .85rem;
    color: var(--text-muted);
    margin-block-end: .5rem;
}

.crumb::after { content: "›"; margin-inline-start: .5rem; opacity: .5; }
.crumb:last-child::after { content: none; }
.crumb-city { color: var(--primary-strong); font-weight: 500; }

/* The other language's form of a category or city, shown beside it. The page
   is Arabic, but the French words are what a French-speaking searcher types,
   so they are ordinary page text rather than metadata. */
.crumb-alt {
    opacity: .7;
    font-size: .95em;
}

.crumb-alt::before { content: "("; }
.crumb-alt::after { content: ")"; }

.listing-name {
    font-size: 1.9rem;
    line-height: 1.25;
    margin: 0 0 .25rem;
}

.verified {
    display: inline-block;
    vertical-align: middle;
    font-size: .7rem;
    font-weight: 700;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    border: 1px solid var(--primary-line);
    margin-inline-start: .5rem;
}

.listing-name-fr {
    margin: 0 0 .75rem;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.rating { margin: 0 0 1rem; }
.rating-value { font-weight: 700; font-size: 1.15rem; }
.rating-value::before { content: "★ "; color: var(--primary); }
.rating-count { color: var(--text-muted); font-size: .9rem; margin-inline-start: .25rem; }

.listing-description { margin-block: 0 1.5rem; }

.block {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
    margin-block-end: 1rem;
}

.block h2 {
    font-size: 1.05rem;
    margin: 0 0 .6rem;
}

.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { margin-block-end: .4rem; }
.phone-label { color: var(--text-muted); font-size: .85rem; margin-inline-start: .5rem; }

.action {
    color: var(--primary-strong);
    text-decoration: none;
    font-weight: 500;
    border-block-end: 1px solid var(--primary-line);
}

.action:hover { border-block-end-width: 2px; }

.hours { inline-size: 100%; border-collapse: collapse; font-size: .95rem; }
.hours th, .hours td { text-align: start; padding: .35rem 0; border-block-end: 1px solid var(--line); }
.hours tr:last-child th, .hours tr:last-child td { border-block-end: none; }
.hours th { font-weight: 500; color: var(--text-muted); }

.hours-note {
    margin-block: .75rem 0;
    font-size: .85rem;
    color: var(--text-muted);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
    gap: .6rem;
}

.gallery img {
    inline-size: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
    background: var(--surface-alt);
}

@media (max-width: 30rem) {
    .listing-name { font-size: 1.5rem; }
    .listing-cover { max-block-size: 14rem; }
}

/* --- homepage and category pages ----------------------------------------- */

.home-hero {
    background: var(--primary-soft);
    border-block-end: 1px solid var(--primary-line);
    padding-block: 2rem;
}

.home-hero h1 { margin: .25rem 0 .75rem; font-size: 1.8rem; line-height: 1.25; }
.home-lede { margin: 0 0 .75rem; max-inline-size: 42rem; }
.home-section-title { font-size: 1.15rem; margin-block: 1.75rem .75rem; }

.cat-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: .6rem;
    /* Equal-height cards: without this a card whose French name wraps to two
       lines is taller than its neighbours and the row looks broken. */
    align-items: stretch;
}

.cat-grid li { display: flex; }

.cat-grid a {
    display: flex;
    align-items: center;
    gap: .7rem;
    inline-size: 100%;
    padding: .8rem .9rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
}

.cat-grid a:hover { border-color: var(--primary-line); }

.cat-icon-wrap {
    flex: none;
    display: inline-flex;
    color: var(--primary-strong);
}

/* The icon is an inline SVG from blade-icons, which carries no intrinsic size
   — unconstrained it renders at whatever the viewBox suggests and blows the
   card apart. */
.cat-icon {
    inline-size: 1.4rem;
    block-size: 1.4rem;
    stroke-width: 1.6;
}

.cat-label {
    display: flex;
    flex-direction: column;
    flex: 1;
    /* A flex item defaults to min-width:auto, so a long unbroken name pushes
       the count badge out of the card instead of wrapping. */
    min-inline-size: 0;
}

.cat-name { font-weight: 500; overflow-wrap: anywhere; }
.cat-alt { font-size: .82rem; color: var(--text-muted); overflow-wrap: anywhere; }

.cat-count {
    flex: none;
    font-size: .8rem;
    color: var(--text-muted);
    background: var(--surface-alt);
    border-radius: 999px;
    padding: .1rem .5rem;
}

.cat-total { color: var(--text-muted); margin-block: 0 1rem; }

.biz-list { list-style: none; margin: 0; padding: 0; }

.biz-list a {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .8rem .9rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-block-end: .5rem;
    text-decoration: none;
    color: var(--text);
}

.biz-list a:hover { border-color: var(--primary-line); }
.biz-name { font-weight: 500; }
.biz-name-fr { font-size: .88rem; color: var(--text-muted); }
.biz-address { font-size: .85rem; color: var(--text-muted); }

.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-block-start: 1.25rem;
}

.pager a { color: var(--primary-strong); text-decoration: none; font-weight: 500; }
.pager a:hover { text-decoration: underline; }
.pager-position { color: var(--text-muted); font-size: .9rem; }

.home-note { margin-block-start: 2rem; }
