/* Shipyards Directory — mobile-first, no framework. */

:root {
    /* Sampled from the logo artwork so the site and the mark agree. */
    --navy: #012451;
    --navy-dark: #011a3c;
    --orange: #b63a05;
    --accent: #1a5f9e;
    --bg: #f6f8fa;
    --surface: #ffffff;
    --text: #1a2734;
    --muted: #5d6b7a;
    --border: #dfe5ea;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(13, 59, 92, .06), 0 4px 14px rgba(13, 59, 92, .06);
    --max: 1180px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --navy: #012451;
        --navy-dark: #011a3c;
        --orange: #e2743c;
        --accent: #6ab3e8;
        --bg: #11181f;
        --surface: #18222c;
        --text: #e6edf3;
        --muted: #9aacbd;
        --border: #27333f;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
    }
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.2rem, 2.6vw, 1.5rem); }

img { max-width: 100%; height: auto; }

.container { width: min(100% - 2rem, var(--max)); margin-inline: auto; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 100;
    background: var(--surface); color: var(--text); padding: .75rem 1rem;
}
.skip-link:focus { left: .5rem; top: .5rem; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Header ----------
   The logo artwork has a solid white background (no alpha), so the header stays light
   in both colour schemes — on a dark bar the mark would read as a pasted-on white box.
   The navy brand colour carries through the footer and headings instead. */

.site-header {
    background: #fff;
    color: var(--navy);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(1, 36, 81, .06);
}

.header-inner {
    display: flex; flex-direction: column; gap: .85rem;
    padding: .7rem 0;
}

@media (min-width: 720px) {
    .header-inner { flex-direction: row; align-items: center; justify-content: space-between; }
}

.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { display: block; width: 200px; height: auto; }

@media (max-width: 420px) {
    /* Keep the wordmark legible rather than letting it shrink to nothing. */
    .brand img { width: 168px; }
}

.header-search { display: flex; gap: .4rem; flex: 1; max-width: 460px; }
.header-search input { flex: 1; min-width: 0; }

input[type="search"], input[type="text"] {
    padding: .6rem .75rem; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); color: var(--text); font: inherit; font-size: .95rem;
}

button, .button {
    display: inline-block; padding: .6rem 1rem; border: 1px solid transparent;
    border-radius: var(--radius); background: var(--accent); color: #fff;
    font: inherit; font-size: .95rem; font-weight: 600; cursor: pointer;
    text-decoration: none; text-align: center; white-space: nowrap;
}
button:hover, .button:hover { filter: brightness(1.08); }

.button-disabled { background: var(--border); color: var(--muted); cursor: default; }
.button-disabled:hover { filter: none; }

/* ---------- Hero ---------- */

.hero { padding: 2.5rem 0 1.5rem; text-align: center; }
.hero-lede { max-width: 62ch; margin: 0 auto 1.5rem; color: var(--muted); font-size: 1.05rem; }

.hero-search { display: flex; flex-direction: column; gap: .5rem; max-width: 620px; margin: 0 auto; }
.hero-search input { padding: .8rem 1rem; font-size: 1rem; }
@media (min-width: 620px) { .hero-search { flex-direction: row; } .hero-search input { flex: 1; } }

/* ---------- Listing ---------- */

.page-title { margin-top: 1rem; }

.breadcrumb { padding: 1rem 0 .25rem; font-size: .9rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: .4rem; color: var(--muted); }
.breadcrumb [aria-current] { color: var(--muted); }

.result-meta { color: var(--muted); font-size: .9rem; margin: .25rem 0 1rem; }

.yard-grid {
    list-style: none; margin: 0 0 2rem; padding: 0;
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.yard-card {
    height: 100%; padding: 1.1rem; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: .45rem;
}

.yard-name { font-size: 1.08rem; margin: 0; }
.yard-name a { color: inherit; text-decoration: none; }
.yard-name a:hover { color: var(--accent); text-decoration: underline; }

.tag {
    display: inline-block; padding: .15rem .55rem; border-radius: 999px;
    background: color-mix(in srgb, var(--orange) 12%, transparent);
    color: var(--orange); font-size: .78rem; font-weight: 600; text-transform: lowercase;
}

.yard-category, .yard-location, .yard-description { margin: 0; }
.yard-location { color: var(--muted); font-size: .88rem; }
.yard-description { color: var(--text); font-size: .92rem; }

.yard-specs { display: flex; flex-wrap: wrap; gap: .25rem 1.2rem; margin: .35rem 0 0; font-size: .82rem; }
.yard-specs div { display: flex; gap: .35rem; }
.yard-specs dt { color: var(--muted); margin: 0; }
.yard-specs dd { margin: 0; font-weight: 600; }

.empty-state {
    padding: 3rem 1rem; text-align: center; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); margin: 1.5rem 0;
}

.pagination {
    display: flex; align-items: center; justify-content: center; gap: 1rem;
    margin: 0 0 3rem; flex-wrap: wrap;
}
.pagination-current { color: var(--muted); font-size: .9rem; }

/* ---------- Detail page ---------- */

.yard-layout { display: grid; gap: 1.5rem; margin-bottom: 3rem; }
@media (min-width: 900px) { .yard-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }

.yard-main {
    padding: 1.5rem; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}

.yard-header { margin-bottom: 1rem; }
.yard-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 0; }
.yard-lede { font-size: 1.05rem; color: var(--text); margin: 0 0 1.5rem; }

.yard-aside { display: grid; gap: 1rem; }
@media (min-width: 900px) { .yard-aside { position: sticky; top: 1rem; } }

.card {
    padding: 1.1rem; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

.detail-list { margin: 0 0 1rem; display: grid; grid-template-columns: auto 1fr; gap: .4rem .9rem; font-size: .92rem; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 600; }
.detail-list address { font-style: normal; font-weight: 400; }

.nearby-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; font-size: .92rem; }
.nearby-list li { display: flex; flex-direction: column; }

.button-primary { width: 100%; background: var(--navy); }

.muted { color: var(--muted); }
.small { font-size: .82rem; }

/* Rendered markdown profile */
.prose h2 { margin-top: 0; font-size: 1.35rem; }
.prose h3 { margin-top: 1.5rem; font-size: 1.05rem; color: var(--navy); }
@media (prefers-color-scheme: dark) { .prose h3 { color: var(--accent); } }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .3rem; }
.prose p { margin: 0 0 1rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: .4rem .6rem; text-align: left; }

/* ---------- Maps ---------- */

.map-section { margin: 0 0 2.5rem; }
.map-section h2 { margin-bottom: .25rem; }
.map-note { color: var(--muted); font-size: .88rem; margin: 0 0 .75rem; }

.map {
    height: 420px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); box-shadow: var(--shadow); z-index: 0;
}
@media (max-width: 620px) { .map { height: 320px; } }

/* Compact variant for the detail-page sidebar. */
.map-small { height: 220px; box-shadow: none; }

/* Circular pins built with CSS rather than Leaflet's default sprite, so they pick up
   the brand colours and stay crisp at any density. */
.map-pin {
    background: var(--accent); border: 2px solid #fff; border-radius: 50%;
    box-shadow: 0 1px 4px rgba(1, 36, 81, .5); cursor: pointer;
}
.map-pin-primary { background: var(--orange); border-width: 3px; }
.map-pin:hover, .map-pin:focus { filter: brightness(1.15); }

.map-popup { display: flex; flex-direction: column; gap: .15rem; font: inherit; }
.map-popup a, .map-popup strong { font-size: .95rem; font-weight: 600; }
.map-popup-category { color: var(--muted); font-size: .8rem; }

/* Leaflet renders its own light chrome; keep it readable in dark mode. */
.leaflet-container { font: inherit; background: var(--bg); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); }
.leaflet-bar a { background: var(--surface); color: var(--text); border-bottom-color: var(--border); }
.leaflet-bar a:hover { background: var(--bg); color: var(--text); }
.leaflet-control-attribution { background: rgba(255, 255, 255, .8); color: #333; }
.leaflet-control-attribution a { color: #0b5c93; }

/* ---------- Footer ---------- */

.site-footer { background: var(--navy-dark); color: #b9d3e4; margin-top: auto; }
.footer-inner {
    display: flex; flex-direction: column; gap: .5rem; align-items: center;
    padding: 1.5rem 0; font-size: .88rem; text-align: center;
}
@media (min-width: 620px) { .footer-inner { flex-direction: row; justify-content: space-between; } }
.footer-inner nav { display: flex; gap: 1.2rem; }
.footer-inner a { color: #b9d3e4; }

body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }
