/* ---- Design tokens (signed-off palette) ---- */
:root {
    --navy: #14213D;
    --navy-light: #2C3E63;
    --blue: #2C6E9B;
    --copper: #E07A3F;
    --copper-dark: #C0602A;
    --teal: #1E9E7D;
    --teal-bg: #DFF3EC;
    --teal-text: #0F6E56;
    --gray-bg: #F1EFE8;
    --gray-text: #5F5E5A;
    --bg: #F7F7F5;
    --text: #23282D;
    --text-muted: #5A6068;
    --border: #E3E2DC;
    --radius: 10px;
    --max-width: 1120px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
}

h1, h2, h3 { line-height: 1.25; color: var(--navy); margin: 0 0 0.5em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- Header ---- */
.site-header {
    background: var(--navy);
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.site-header__logo {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}
.site-header__logo:hover { text-decoration: none; }
.site-header__nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.site-header__nav a { color: #C7D2E0; font-size: 0.9rem; }
.site-header__nav a:hover { color: #fff; }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
}
.nav-toggle__bar {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 1px;
}

@media (max-width: 767px) {
    .nav-toggle { display: flex; }
    .site-header__nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0;
        margin-top: 12px;
    }
    .site-header__nav.is-open { display: flex; }
    .site-header__nav a,
    .site-header__nav .nav-logout-form,
    .site-header__nav .nav-logout-button {
        width: 100%;
    }
    .site-header__nav a,
    .site-header__nav .nav-logout-button {
        padding: 12px 0;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        font-size: 1rem;
        text-align: left;
    }
}

/* ---- Hero ---- */
.hero {
    background: var(--navy);
    color: #fff;
    padding: 44px 0 56px;
    text-align: center;
}
.hero h1 { color: #fff; font-size: 1.8rem; margin-bottom: 8px; }
.hero__subtitle { color: #C7D2E0; margin-bottom: 22px; }
.hero__search {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 480px;
    margin: 0 auto;
}

@media (min-width: 640px) {
    .hero__search { flex-direction: row; }
}

/* ---- Form controls ---- */
input[type="text"], select {
    height: 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 12px;
    font-size: 0.95rem;
    background: #fff;
    color: var(--text);
    width: 100%;
}

.button {
    display: inline-block;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 20px;
    height: 42px;
    line-height: 40px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    background: #fff;
    color: var(--navy);
}
.button:hover { text-decoration: none; border-color: var(--blue); }
.button--accent { background: var(--copper); border-color: var(--copper); color: #fff; }
.button--accent:hover { background: var(--copper-dark); border-color: var(--copper-dark); }

/* ---- Sections ---- */
.section { padding: 36px 0; }
.section-intro { color: var(--text-muted); }

/* ---- Category grid ---- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 640px) {
    .category-grid { grid-template-columns: repeat(4, 1fr); }
}
.category-tile {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 12px;
    text-align: center;
    color: var(--navy);
    font-weight: 600;
    font-size: 0.9rem;
}
.category-tile:hover { border-color: var(--blue); text-decoration: none; }
.category-tile__name { display: block; }
.category-tile__desc { display: block; margin-top: 6px; font-weight: 400; font-size: 0.8rem; color: var(--text-muted); }
.category-tile__count { display: block; margin-top: 6px; font-weight: 400; font-size: 0.75rem; color: var(--text-muted); }

/* ---- Chip row (region -> category quick links) ---- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.85rem;
    color: var(--navy);
}
.chip:hover { border-color: var(--blue); text-decoration: none; }

/* ---- Results grid / company cards ---- */
.directory-map {
    height: 320px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--gray-bg);
    margin: 16px 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    overflow: hidden;
}
@media (min-width: 640px) {
    .directory-map { height: 420px; }
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 20px;
}
@media (min-width: 700px) {
    .results-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .results-grid { grid-template-columns: repeat(3, 1fr); }
}
.company-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}
.company-card__top {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}
.company-card__top .badge { margin-left: auto; }
.company-card__name { margin: 0; font-size: 1rem; flex: 1 1 120px; min-width: 0; }
.company-card__logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 3px;
    flex-shrink: 0;
}
.company-card__location {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 6px 0;
}
.company-card .button { margin-top: 10px; height: 34px; line-height: 32px; padding: 0 14px; font-size: 0.85rem; }
.company-card__description {
    font-size: 0.9rem;
    color: var(--text);
    margin: 6px 0 0;
}
.empty-state { color: var(--text-muted); padding: 20px 0; }

/* ---- Badges ---- */
.badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
}
.badge--verified { background: var(--teal-bg); color: var(--teal-text); }
.badge--unclaimed { background: var(--gray-bg); color: var(--gray-text); }

/* ---- Breadcrumbs ---- */
.breadcrumbs {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 18px 0;
}
.breadcrumbs__sep { margin: 0 6px; }

/* ---- Listing detail ---- */
.listing {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    padding-bottom: 40px;
}
@media (min-width: 800px) {
    .listing { grid-template-columns: 2fr 1fr; }
}
.listing__title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.listing__logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 4px;
}
.listing__location { color: var(--text-muted); }
.listing__categories {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 0 0 16px;
}
.listing__categories li {
    background: var(--gray-bg);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.82rem;
}
.listing__description { white-space: pre-line; }

.listing__accreditations {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 0 0 16px;
}
.accreditation-badge {
    background: var(--teal-bg);
    color: var(--teal-text);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 600;
}

.listing__gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 20px 0;
}
@media (min-width: 480px) {
    .listing__gallery { grid-template-columns: repeat(3, 1fr); }
}
.listing__gallery img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.claim-callout {
    background: #fff;
    border: 1px dashed var(--copper);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 20px;
}
.claim-callout p { margin: 0 0 10px; }

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.pricing-prose { max-width: 640px; }
.pricing-prose ul { margin: 0 0 1em; padding-left: 1.3em; }
.pricing-prose li { margin-bottom: 0.5em; }

.pricing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 20px 0 32px;
}
@media (min-width: 900px) {
    .pricing-grid { grid-template-columns: repeat(3, 1fr); }
}
.pricing-card { display: flex; flex-direction: column; padding: 20px; }
.pricing-card--featured { border-color: var(--copper); border-width: 2px; }
.pricing-card .badge { align-self: flex-start; margin-bottom: 8px; }
.pricing-card h2 { font-size: 1.1rem; margin-bottom: 4px; }
.pricing-card__price { font-size: 1.6rem; font-weight: 700; color: var(--navy); margin: 0 0 10px; }
.pricing-card__price span { font-size: 0.9rem; font-weight: 400; color: var(--text-muted); }
.pricing-card__features { margin: 12px 0 20px; padding-left: 18px; color: var(--text-muted); font-size: 0.9rem; }
.pricing-card__features li { margin-bottom: 6px; }
.pricing-card .button { margin-top: auto; text-align: center; }

.claim-summary { margin: 16px 0; }
.claim-summary h3 { margin: 0 0 6px; }
.listing__contact p { margin: 0 0 10px; display: flex; gap: 8px; align-items: center; }
.listing__contact p:last-child { margin-bottom: 0; }
.listing__map {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-top: 16px;
    width: 100%;
    height: auto;
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px 0 40px;
    font-size: 0.9rem;
}
.pagination__status { color: var(--text-muted); }

/* ---- Not found ---- */
.not-found { padding: 60px 0; text-align: center; }

/* ---- Footer ---- */
.site-footer {
    background: var(--navy);
    color: #8FA3C0;
    padding: 24px 0;
    margin-top: 40px;
}
.site-footer__regions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-bottom: 14px;
}
.site-footer__regions a { color: #8FA3C0; font-size: 0.85rem; }
.site-footer__regions a:hover { color: #fff; }
.site-footer__copy { font-size: 0.8rem; margin: 0; color: #6E85A8; }
.site-footer__copy a { color: #8FA3C0; }
.site-footer__copy a:hover { color: #fff; }

/* ---- Cookie banner ---- */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    background: var(--navy);
    border-top: 1px solid var(--navy-light);
    padding: 16px 0;
}
.cookie-banner__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
}
.cookie-banner p {
    margin: 0;
    color: #C7D2E0;
    font-size: 0.85rem;
    flex: 1 1 260px;
}
.cookie-banner a { color: #fff; text-decoration: underline; }
.cookie-banner__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ---- Nav logout (button styled to match nav links) ---- */
.nav-logout-form { margin: 0; display: inline; }
.nav-logout-button {
    background: none;
    border: none;
    padding: 0;
    color: #C7D2E0;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
}
.nav-logout-button:hover { color: #fff; text-decoration: underline; }

/* ---- Forms (auth, submission) ---- */
.container.narrow { max-width: 560px; padding-top: 24px; padding-bottom: 40px; }
.container.narrow ul { margin: 0 0 1em; padding-left: 1.3em; }
.container.narrow li { margin-bottom: 0.3em; }
.stacked-form { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; }
.stacked-form label { font-size: 0.85rem; font-weight: 600; color: var(--navy); margin-top: 12px; }
.stacked-form input[type="text"],
.stacked-form input[type="email"],
.stacked-form input[type="password"],
.stacked-form input[type="url"],
.stacked-form input[type="file"],
.stacked-form select,
.stacked-form textarea {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 0.95rem;
    background: #fff;
    color: var(--text);
    width: 100%;
    font-family: inherit;
}
.stacked-form textarea { resize: vertical; }
.stacked-form button { margin-top: 20px; align-self: flex-start; }
.edit-current-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 4px;
    margin-top: 6px;
}
.edit-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 6px;
}
.edit-gallery-item {
    text-align: center;
}
.edit-gallery-item img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 4px;
}
.edit-gallery-item .checkbox-label { margin-top: 0; justify-content: center; }
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 16px;
}
@media (min-width: 560px) {
    .form-row { grid-template-columns: 1fr 1fr; }
}
.checkbox-group {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}
@media (min-width: 480px) {
    .checkbox-group { grid-template-columns: 1fr 1fr; }
}
.checkbox-group legend { font-weight: 600; color: var(--navy); padding: 0 6px; font-size: 0.9rem; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 400; margin: 0; }
.checkbox-label input { width: auto; }
.form-errors {
    background: #FBEAEA;
    border: 1px solid #E8B4B4;
    color: #8A3232;
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-top: 16px;
}
.form-errors p { margin: 0 0 4px; font-size: 0.9rem; }
.form-errors p:last-child { margin-bottom: 0; }
.form-success {
    background: var(--teal-bg);
    color: var(--teal-text);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin: 16px 0;
}
.form-footnote { font-size: 0.88rem; color: var(--text-muted); margin-top: 16px; }

/* ---- Admin ---- */
.admin-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}
.admin-nav {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}
.admin-nav__link {
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
}
.admin-nav__link:hover { color: var(--navy); text-decoration: none; }
.admin-nav__link--active { color: var(--navy); border-bottom-color: var(--copper); }
.import-results-heading { margin-top: 28px; }
.import-results {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 0.88rem;
}
.import-results td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.import-results tr:last-child td { border-bottom: none; }
.moderation-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}
.moderation-card__main { flex: 1; min-width: 240px; }
.moderation-card__actions { display: flex; gap: 8px; flex-shrink: 0; }
.moderation-thumbnails { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.moderation-thumbnails img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
