/* NDM starter: base styles. Colours and fonts come from theme.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.65; color: var(--ink); background: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
h1, h2, h3, .h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 0.6em; color: var(--ink); }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3, .h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 760px; }
.section { padding: 4rem 0; }
.section.alt { background: var(--bg-alt); }
.intro, .lead { color: var(--muted); font-size: 1.15rem; max-width: 640px; }
.small { font-size: 0.9rem; color: var(--muted); }
.plain { list-style: none; margin: 0; padding: 0; }
.link { font-weight: 600; }

.admin-bar { background: var(--dark); color: var(--dark-ink); font-size: 0.875rem; padding: 0.4rem 0; }
.admin-bar a { color: var(--dark-ink); font-weight: 600; }
.site-notice { background: var(--accent); color: #1d1d1d; font-size: 0.95rem; padding: 0.55rem 0; text-align: center; }
.site-notice a { color: #1d1d1d; font-weight: 700; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--brand); color: var(--brand-ink); padding: 0.6rem 1rem; z-index: 100; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* Buttons */
.btn { display: inline-block; padding: 0.8rem 1.4rem; border-radius: var(--radius); font-weight: 600; text-decoration: none; border: 2px solid transparent; cursor: pointer; font-size: 1rem; line-height: 1.2; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-dark); color: var(--brand-ink); }
.btn-ghost { border-color: currentColor; color: var(--brand); background: transparent; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 1rem; }
.brand { font-family: var(--font-head); font-size: 1.3rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 1.5rem; }
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; }
.site-nav a:not(.btn):hover, .site-nav a[aria-current="page"]:not(.btn) { color: var(--brand); text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--accent); }
.nav-phone { display: none; }
.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); transition: transform 0.2s, opacity 0.2s; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero and page heads */
.hero { padding: 4.5rem 0; background: var(--bg-alt); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; }
.hero-grid.no-image { grid-template-columns: 1fr; }
.hero-grid.no-image > div { max-width: 820px; }
.hero-img { border-radius: calc(var(--radius) * 1.5); box-shadow: 0 20px 50px rgba(0,0,0,0.15); width: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; font-weight: 700; color: var(--brand); margin-bottom: 0.8rem; }
.page-head { background: var(--bg-alt); padding: 3.5rem 0 2.5rem; }
.crumbs { margin: 0 0 0.4rem; font-size: 0.9rem; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 1.5rem; }
.card { display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; text-decoration: none; color: var(--ink); transition: box-shadow 0.2s, transform 0.2s; }
.card:hover { box-shadow: 0 10px 30px rgba(0,0,0,0.08); transform: translateY(-2px); color: var(--ink); }
.card p { color: var(--muted); flex: 1; }
.card-img { margin: -1.5rem -1.5rem 1.25rem; width: calc(100% + 3rem); max-width: none; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; }
.more { color: var(--brand); font-weight: 600; }

/* Detail pages */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 3rem; }
.detail-img { border-radius: var(--radius); margin-bottom: 1.5rem; }
.side-list { border-left: 3px solid var(--accent); padding-left: 1.25rem; align-self: start; }
.side-list li { margin-bottom: 0.4rem; }
.rich ul { padding-left: 1.2rem; }
.rich li { margin-bottom: 0.3rem; }
.rich h2 { margin-top: 1.5em; font-size: 1.4rem; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.5rem 0; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.gallery figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 0.4rem; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
.form { display: grid; gap: 0.35rem; }
.form label { font-weight: 600; margin-top: 0.8rem; }
.form .opt { font-weight: 400; color: var(--muted); }
.form input, .form select, .form textarea { font: inherit; padding: 0.7rem 0.8rem; border: 1px solid #8b959c; border-radius: var(--radius); background: var(--bg); color: var(--ink); width: 100%; }
.form button { margin-top: 1.2rem; justify-self: start; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: 1rem 1.2rem; border-radius: var(--radius); margin-bottom: 1rem; }
.notice.ok { background: #e6f4ea; color: #14532d; border: 1px solid #a7d7b5; }
.notice.err { background: #fdecea; color: #7f1d1d; border: 1px solid #f3b6ae; }
.contact-card { background: var(--bg-alt); border-radius: var(--radius); padding: 1.5rem; }
.contact-card .label { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; }

/* Call to action band and footer */
.cta { background: var(--dark); color: var(--dark-ink); padding: 4rem 0; text-align: center; }
.cta h2 { color: var(--dark-ink); }
.cta p { color: var(--dark-ink); opacity: 0.85; max-width: 560px; margin: 0 auto; }
.cta .actions { justify-content: center; }
.cta .btn-ghost { color: var(--dark-ink); }
.site-footer { background: var(--dark); color: var(--dark-ink); padding: 3rem 0 1.5rem; border-top: 1px solid rgba(255,255,255,0.08); }
.site-footer a { color: var(--dark-ink); }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 2rem; }
.footer-brand { font-family: var(--font-head); font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.footer-h { font-family: var(--font-body); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--dark-ink); opacity: 0.85; margin-bottom: 0.6rem; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,0.12); font-size: 0.875rem; }

/* Demo-only colour panel (bin/demo-content.php turns it on) */
.demo-theme { position: fixed; right: 1rem; bottom: 1rem; z-index: 90; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 0.95rem; }
.demo-theme-open { background: #111; color: #fff; border: none; border-radius: 999px; padding: 0.75rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.demo-theme-panel { position: absolute; right: 0; bottom: 3.6rem; width: min(320px, calc(100vw - 2rem)); background: #fff; color: #1d2327; border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,0.25); padding: 1rem 1.1rem 1.1rem; }
.dt-head { display: flex; justify-content: space-between; align-items: center; }
.dt-close { background: none; border: none; font-size: 1.5rem; line-height: 1; cursor: pointer; width: 36px; height: 36px; }
.dt-note { font-size: 0.8rem; color: #59636b; margin: 0.2rem 0 0.8rem; }
.dt-field { display: grid; gap: 0.25rem; font-weight: 600; font-size: 0.85rem; margin-bottom: 0.7rem; }
.dt-field input[type=text], .dt-field select { font: inherit; font-weight: 400; padding: 0.5rem 0.6rem; border: 1px solid #8b959c; border-radius: 6px; }
.dt-field input[type=color] { width: 100%; height: 38px; border: 1px solid #8b959c; border-radius: 6px; padding: 2px; background: #fff; cursor: pointer; }
.dt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.75rem; }
.dt-presets { display: flex; gap: 0.5rem; margin: 0.2rem 0 0.9rem; }
.dt-swatch { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #c5ccd1; cursor: pointer; }
.dt-actions { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-top: 0.4rem; }
.dt-reset { background: #e3e7ea; border: none; border-radius: 6px; padding: 0.55rem 0.9rem; font: inherit; font-weight: 600; cursor: pointer; }
.dt-cta { background: var(--brand); color: var(--brand-ink); text-decoration: none; border-radius: 6px; padding: 0.55rem 0.9rem; font-weight: 600; }

/* Tablet */
@media (max-width: 900px) {
  .hero-grid, .detail, .contact-grid { grid-template-columns: 1fr; }
  .cards, .gallery { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* Phone: menu collapses behind the toggle */
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(0,0,0,0.08); }
  .nav-open .site-nav { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 0.5rem 1.25rem 1.25rem; }
  .site-nav li a:not(.btn) { display: block; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
  .site-nav .btn { margin-top: 1rem; display: block; text-align: center; }
  .nav-phone { display: block; }
  .section { padding: 3rem 0; }
  .hero { padding: 3rem 0; }
}
@media (max-width: 560px) {
  .cards, .gallery, .footer-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
