/*
Theme Name: Niche Directory
Description: Shared editorial directory theme for focused UK service directories.
Version: 0.0.5
Requires at least: 6.6
Requires PHP: 8.1
*/

:root {
    --ink: #18221d;
    --muted: #5f6b64;
    --line: #dce3de;
    --surface: #ffffff;
    --soft: #f3f6f4;
    --green: #176b46;
    --green-dark: #0d4c31;
    --yellow: #f3c74f;
    --blue: #2b6380;
    --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--surface);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    letter-spacing: 0;
}
a { color: var(--green-dark); text-underline-offset: 3px; }
a:hover { color: var(--blue); }
img { display: block; max-width: 100%; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
button, input { font: inherit; }
.nd-wrap { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.nd-skip { position: absolute; left: -9999px; top: 0; }
.nd-skip:focus { left: 12px; top: 12px; z-index: 100; padding: 8px 12px; background: #fff; }

.nd-header { height: 72px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); }
.nd-header .nd-wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nd-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; text-decoration: none; }
.nd-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--yellow); color: var(--ink); font-size: 18px; }
.nd-nav { display: flex; align-items: center; gap: 24px; }
.nd-nav a { color: var(--ink); font-size: 14px; font-weight: 700; text-decoration: none; }
.nd-nav a:hover { color: var(--green); }

.nd-hero { min-height: 570px; display: grid; align-items: center; background-position: center; background-size: cover; position: relative; color: #fff; }
.nd-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,28,18,.88) 0%, rgba(10,28,18,.62) 44%, rgba(10,28,18,.08) 74%); }
.nd-hero-content { position: relative; width: min(650px, 100%); padding-block: 74px 92px; }
.nd-eyebrow { margin: 0 0 12px; color: #e7f2eb; font-size: 14px; font-weight: 800; text-transform: uppercase; }
h1, h2, h3 { margin-top: 0; line-height: 1.14; letter-spacing: 0; }
h1 { margin-bottom: 18px; font-size: clamp(40px, 6vw, 68px); }
.nd-hero-copy { max-width: 580px; margin: 0 0 28px; font-size: 20px; }
.nd-search { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; width: min(760px, 100%); background: #fff; border: 4px solid #fff; border-radius: 8px; box-shadow: 0 14px 40px rgba(0,0,0,.24); }
.nd-search input { min-width: 0; height: 54px; padding: 0 18px; border: 0; outline: 0; color: var(--ink); }
.nd-search input:focus { box-shadow: inset 0 0 0 2px var(--green); }
.nd-search button, .nd-button { min-height: 54px; padding: 0 24px; border: 0; border-radius: 5px; background: var(--yellow); color: #1e251f; font-weight: 800; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.nd-search button:hover, .nd-button:hover { background: #ffda6c; color: #111; }
.nd-search .nd-locate { padding-inline: 18px; border-left: 1px solid var(--line); border-radius: 0; background: var(--soft); color: var(--green-dark); }
.nd-search .nd-locate:hover { background: #e8efeb; color: var(--green-dark); }
.nd-search button:disabled { cursor: wait; opacity: .72; }

.nd-band { padding-block: 70px; }
.nd-band-soft { background: var(--soft); }
.nd-section-head { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 30px; }
.nd-section-head h2 { margin-bottom: 6px; font-size: 34px; }
.nd-section-head p { margin: 0; color: var(--muted); }
.nd-text-link { font-weight: 800; white-space: nowrap; }
.nd-location-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.nd-location { min-height: 92px; padding: 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; text-decoration: none; }
.nd-location strong { display: block; color: var(--ink); font-size: 18px; }
.nd-location span { color: var(--muted); font-size: 14px; }
.nd-location:hover { background: #f9fbfa; box-shadow: inset 0 -3px var(--yellow); }

.nd-provider-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.nd-provider-card { display: flex; flex-direction: column; min-height: 260px; padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.nd-provider-card h3 { margin-bottom: 10px; font-size: 21px; }
.nd-provider-card h3 a { color: var(--ink); text-decoration: none; }
.nd-provider-card h3 a:hover { color: var(--green); }
.nd-provider-card p { margin: 0 0 10px; color: var(--muted); }
.nd-provider-card .nd-card-location { color: var(--green-dark); font-size: 14px; font-weight: 800; }
.nd-provider-card .nd-card-distance { color: var(--ink); font-weight: 800; }
.nd-card-actions { display: flex; gap: 16px; align-items: center; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.nd-card-actions a { font-weight: 800; }

.nd-split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr); gap: 70px; align-items: start; }
.nd-split h2 { font-size: 38px; }
.nd-split p { color: var(--muted); font-size: 18px; }
.nd-checklist { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.nd-checklist li { position: relative; padding: 15px 0 15px 30px; border-bottom: 1px solid var(--line); font-weight: 700; }
.nd-checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 900; }

.nd-page-head { padding-block: 54px 38px; background: var(--soft); border-bottom: 1px solid var(--line); }
.nd-page-head h1 { margin-bottom: 10px; font-size: 44px; }
.nd-page-head p { max-width: 760px; margin: 0; color: var(--muted); font-size: 18px; }
.nd-content { padding-block: 48px 80px; }
.nd-search-results-form { margin-bottom: 30px; }
.nd-search-results-form .nd-search { border: 1px solid var(--line); box-shadow: none; }
.nd-directory-toolbar { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 28px; }
.nd-directory-toolbar .nd-search { border: 1px solid var(--line); box-shadow: none; width: min(560px, 100%); }
.nd-results { color: var(--muted); white-space: nowrap; }
.nd-pagination { margin-top: 36px; }
.nd-pagination .page-numbers { display: inline-grid; place-items: center; min-width: 38px; height: 38px; margin-right: 5px; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; }
.nd-pagination .current { background: var(--green); color: #fff; border-color: var(--green); }

.nd-profile { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 60px; }
.nd-profile h1 { font-size: 48px; }
.nd-profile-details { margin: 28px 0; border-top: 1px solid var(--line); }
.nd-detail { display: grid; grid-template-columns: 120px 1fr; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.nd-detail dt { font-weight: 800; }
.nd-detail dd { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.nd-profile-aside { padding: 26px; border: 1px solid var(--line); border-radius: 8px; }
.nd-profile-aside h2 { font-size: 23px; }
.nd-profile-aside .nd-button { width: 100%; margin-bottom: 10px; }
.nd-source-note { color: var(--muted); font-size: 13px; }

.nd-empty { padding: 44px; border: 1px solid var(--line); border-radius: 8px; text-align: center; }
.nd-footer { padding-block: 44px; background: #15221b; color: #dce6df; }
.nd-footer .nd-wrap { display: flex; justify-content: space-between; gap: 30px; }
.nd-footer a { color: #fff; }
.nd-footer p { margin: 0; }

@media (max-width: 900px) {
    .nd-location-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nd-provider-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nd-split, .nd-profile { grid-template-columns: 1fr; gap: 40px; }
    .nd-profile-aside { max-width: 520px; }
}

@media (max-width: 620px) {
    .nd-wrap { width: min(calc(100% - 28px), var(--max)); }
    .nd-header { height: 64px; }
    .nd-nav a:not(:last-child) { display: none; }
    .nd-hero { min-height: 540px; background-position: 61% center; }
    .nd-hero::before { background: rgba(10,28,18,.7); }
    .nd-hero-content { padding-block: 58px 74px; }
    h1 { font-size: 42px; }
    .nd-hero-copy { font-size: 18px; }
    .nd-search { grid-template-columns: 1fr; }
    .nd-search button { min-height: 50px; }
    .nd-band { padding-block: 50px; }
    .nd-section-head, .nd-directory-toolbar, .nd-footer .nd-wrap { align-items: flex-start; flex-direction: column; }
    .nd-section-head h2, .nd-split h2 { font-size: 30px; }
    .nd-location-grid, .nd-provider-grid { grid-template-columns: 1fr; }
    .nd-provider-card { min-height: 230px; }
    .nd-page-head h1, .nd-profile h1 { font-size: 36px; }
    .nd-detail { grid-template-columns: 1fr; gap: 2px; }
}
