/* ============================================================
   Castle Combe Village & Countryside Protection Collective
   style.css — global styles, variables, shared components
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=Public+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* CSS Variables */
:root {
  --page:       #E7E6DF;
  --paper:      #F3F2EC;
  --paper-2:    #DEDDD5;
  --paper-3:    #CFCEC4;
  --stone:      #AEB0A4;
  --stone-dark: #6E7166;
  --mortar:     #5C5F55;
  --slate:      #2E4A55;
  --slate-deep: #1E2F35;
  --slate-ink:  #16242A;
  --lichen:     #6E7C4B;
  --lichen-deep:#586641;
  --alarm:      #9A3A30;
  --ink:        #1C2226;
  --ink-soft:   #474D4C;
  --line:       #CFCEC5;
  --line-2:     #B9B8AD;

  --font-display: 'Cinzel', Georgia, serif;
  --font-body:    'Public Sans', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, monospace;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Base */
html { font-size: 16px; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

a { color: inherit; }
button { font-family: inherit; }
input, textarea, button, select { font-family: inherit; font-size: inherit; }
textarea { resize: vertical; }

/* ── Navigation ── */
.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 20px 11px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: #c3cdd1;
  font-weight: 500;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}
.nav-link:hover { color: #fff; }
.nav-link.active {
  color: #e7ebe8;
  border-bottom-color: var(--lichen);
}
.nav-link.home-link {
  color: #e7ebe8;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  align-self: center;
  margin-left: 10px;
  padding: 9px 16px;
  background: var(--lichen);
  border: 1px solid var(--lichen-deep);
  border-radius: 3px;
  color: #f7f8f2;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: background 0.15s;
}
.nav-cta:hover { background: var(--lichen-deep); }

/* ── Image placeholder (replaces image-slot) ── */
.img-placeholder {
  position: absolute;
  inset: 0;
  background: var(--paper-2);
  border: 2px dashed var(--line-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--stone-dark);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 16px;
}

.img-placeholder-block {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--stone-dark);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 40px 16px;
}

/* ── Status badges ── */
.badge-monitoring {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(46,74,85,.14);
  color: var(--slate-deep);
  padding: 3px 8px;
  border: 1px solid rgba(46,74,85,.3);
}
.badge-watching {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(154,58,48,.13);
  color: var(--alarm);
  padding: 3px 8px;
  border: 1px solid rgba(154,58,48,.32);
}
.badge-closed {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--stone-dark);
  border-left: 3px solid var(--line-2);
  padding-left: 8px;
}
.badge-todo {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(154,58,48,.1);
  color: var(--alarm);
  padding: 2px 7px;
  border: 1px solid rgba(154,58,48,.28);
}

/* ── Form elements ── */
.form-input {
  padding: 11px 13px;
  border: 1px solid var(--line-2);
  background: var(--paper);
  border-radius: 3px;
  font-size: 15px;
  width: 100%;
  transition: border-color 0.15s;
}
.form-input:focus {
  outline: none;
  border-color: var(--slate);
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 20px;
  background: var(--slate);
  color: #F2F1EA;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--slate-deep);
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--slate-deep); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 20px;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--stone-dark);
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-secondary:hover { background: rgba(110,113,102,.12); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 13px 8px;
  background: none;
  color: var(--slate);
  font-weight: 600;
  font-size: 14px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
}
.btn-ghost:hover { color: var(--slate-deep); }

/* ── Mobile nav toggle ── */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px 4px;
  cursor: pointer;
  color: #e7ebe8;
  margin-left: auto;
  flex-shrink: 0;
  line-height: 1;
}
.nav-toggle svg { display: block; }

/* ── Responsive breakpoint ── */
@media (max-width: 720px) {

  /* Nav: collapse behind hamburger */
  .nav-toggle { display: flex; align-items: center; }
  .site-nav {
    display: none !important;
    flex-direction: column !important;
    width: 100%;
    padding-bottom: 10px;
    border-top: 1px solid rgba(255,255,255,.12);
  }
  .site-nav.open { display: flex !important; }
  .nav-link {
    padding: 13px 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
    border-right: none !important;
    font-size: 14px !important;
    width: 100%;
  }
  .nav-cta {
    margin: 12px 0 4px !important;
    align-self: flex-start !important;
  }

  /* Hero: two columns → one */
  .hero-grid { grid-template-columns: 1fr !important; }
  .hero-map  { display: none !important; }
  .hero-text { padding: 34px 0 28px !important; }
  .hero-btns { flex-direction: column !important; align-items: flex-start !important; }
  .hero-stats { flex-wrap: wrap !important; gap: 20px 28px !important; }

  /* Card grids: 3-col or 2-col → 1-col */
  .card-grid { grid-template-columns: 1fr !important; }

  /* Label + content grids: 200/220px + 1fr → 1-col */
  .label-grid {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
  /* Don't let the label eat vertical space */
  .label-grid > *:first-child { padding-top: 0 !important; }

  /* Contact form + aside → stack */
  .form-grid { grid-template-columns: 1fr !important; }

  /* Planning page: hide table column header row on mobile */
  .planning-header { display: none !important; }

  /* Planning feed table rows → card layout */
  .planning-row {
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto auto !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  .planning-row .p-ref   { grid-column: 1; grid-row: 1; }
  .planning-row .p-site  { grid-column: 1 / -1; grid-row: 2; }
  .planning-row .p-badge { grid-column: 2; grid-row: 1; }
  .planning-row .p-date  { display: none !important; }
  .planning-row .p-link  { grid-column: 1 / -1; grid-row: 3; padding-top: 4px; }

  /* Homepage planning preview → hide header + collapse to address + badge */
  .hp-header { display: none !important; }
  .hp-row    { grid-template-columns: 1fr auto !important; }
  .hp-ref    { display: none !important; }
  .hp-date   { display: none !important; }

  /* Footer: three columns → one */
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  /* Reduce section horizontal padding */
  .px-page { padding-left: 16px !important; padding-right: 16px !important; }

  /* Scale down display headings */
  h1 { font-size: clamp(26px, 8vw, 36px) !important; }
}

/* ── Form feedback ── */
#form-feedback {
  display: none;
  padding: 12px 16px;
  border-radius: 3px;
  font-size: 14px;
  margin-top: 8px;
}
#form-feedback.success {
  background: rgba(110,124,75,.15);
  border: 1px solid var(--lichen-deep);
  color: var(--lichen-deep);
  display: block;
}
#form-feedback.error {
  background: rgba(154,58,48,.1);
  border: 1px solid var(--alarm);
  color: var(--alarm);
  display: block;
}
