
:root {
  --navy: #16243d;
  --navy-soft: #22365c;
  --gold: #b08d3e;
  --gold-light: #d6b86a;
  --cream: #faf7f1;
  --ink: #2a2a2a;
  --muted: #6b6b6b;
  --rule: #e4ddd0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Source Sans 3", "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
}

h1, h2, h3 {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  color: var(--navy);
  font-weight: 600;
  line-height: 1.2;
  /* When a heading must wrap, balance the lines ("Rutens / Mediation Group")
     instead of orphaning the last word ("Rutens Mediation / Group"). */
  text-wrap: balance;
}

a { color: var(--navy-soft); }

.container { max-width: 1060px; margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.brand {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.05rem, 4.2vw, 1.35rem);
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand span { color: var(--gold-light); }

.site-nav { display: flex; flex-wrap: wrap; gap: 1.4rem; }

.site-nav a {
  color: #e8e5de;
  text-decoration: none;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.site-nav a:hover { color: var(--gold-light); }

/* Hamburger toggle — hidden on desktop, shown on mobile for the
   collapsible nav. The admin header's nav is not collapsible. */
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 0.5rem;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

@media (max-width: 759px) {
  .nav-toggle { display: block; }

  .site-nav.collapsible { display: none; }

  .site-nav.collapsible.open {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
    margin-top: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
  }

  .site-nav.collapsible a {
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* ---------- Hero ---------- */
.hero {
  background:
    linear-gradient(160deg, rgba(22, 36, 61, 0.96), rgba(34, 54, 92, 0.88)),
    radial-gradient(circle at 80% 20%, rgba(176, 141, 62, 0.35), transparent 55%),
    var(--navy);
  color: #fff;
  padding: 4rem 0;
  text-align: center;
}

/* Mobile-first: portrait stacked above the hero text, both centered. */
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.2rem;
}

.hero-portrait {
  width: min(220px, 55vw);
  flex-shrink: 0;
}

.hero-portrait img {
  display: block;
  width: 100%;
  height: auto;
  border: 3px solid var(--gold);
  border-radius: 4px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}

.hero h1 {
  color: #fff;
  font-size: clamp(1.8rem, 7.5vw, 3.4rem);
  margin-bottom: 1rem;
}

.hero .rule {
  width: 90px;
  height: 3px;
  background: var(--gold);
  margin: 0 auto 1.4rem;
}

.hero p {
  max-width: 640px;
  margin: 0 auto 2.2rem;
  font-size: 1.15rem;
  color: #dcd9d2;
}

/* Desktop: portrait to the left of the hero text. */
@media (min-width: 760px) {
  .hero { padding: 5.5rem 0; text-align: left; }
  .hero-inner { flex-direction: row; justify-content: center; gap: 3.5rem; }
  .hero-portrait { width: 280px; }
  .hero-text .rule { margin: 0 0 1.4rem; }
  .hero-text p { margin: 0 0 2.2rem; }
}

.btn {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
  padding: 0.85rem 2.2rem;
  border: none;
  border-radius: 2px;
  cursor: pointer;
}

.btn:hover { background: var(--gold-light); }

/* ---------- Sections ---------- */
section { padding: 4.5rem 0; }

section:nth-of-type(even) { background: #fff; }

.section-heading {
  text-align: center;
  margin-bottom: 0.6rem;
  font-size: clamp(1.45rem, 6vw, 2rem);
}

.section-rule {
  width: 70px;
  height: 3px;
  background: var(--gold);
  margin: 0 auto 2.5rem;
}

/* About */
.about-body { max-width: 780px; margin: 0 auto; }
.about-body p { margin-bottom: 1.2rem; }

/* Practice areas */
.practice-intro { text-align: center; max-width: 680px; margin: 0 auto 2.5rem; }

.practice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}

.practice-card {
  background: var(--cream);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--gold);
  padding: 1.4rem 1.2rem;
  text-align: center;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.1rem;
  color: var(--navy);
}

section:nth-of-type(odd) .practice-card { background: #fff; }

/* ---------- Calendar ---------- */
.calendar-note {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 2rem;
  color: var(--muted);
}

.calendar {
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(22, 36, 61, 0.06);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--navy);
  color: #fff;
  padding: 0.8rem 1rem;
}

.calendar-header h3 {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 500;
}

.calendar-header button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 2px;
  font-size: 1rem;
  cursor: pointer;
}

.calendar-header button:hover { border-color: var(--gold-light); color: var(--gold-light); }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-grid .dow {
  text-align: center;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}

.calendar-grid .day {
  min-height: 64px;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  font-size: 0.9rem;
  color: var(--ink);
}

.calendar-grid .day:nth-child(7n) { border-right: none; }
.calendar-grid .day.outside { color: #c7c2b8; background: #fcfbf8; }
.calendar-grid .day.today {
  background: rgba(176, 141, 62, 0.12);
  font-weight: 700;
  color: var(--navy);
}

.calendar-grid .day.busy,
.calendar-grid .day.available {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.calendar-grid .day.busy::after,
.calendar-grid .day.available::after {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  border-radius: 2px;
  padding: 0.1rem 0.25rem;
  align-self: flex-start;
}

/* Unavailable: hatched shading, a corner-to-corner cross, and a struck-
   through day number. */
.calendar-grid .day.busy {
  background:
    linear-gradient(to top right,
      transparent calc(50% - 1px),
      rgba(140, 59, 46, 0.4) calc(50% - 1px),
      rgba(140, 59, 46, 0.4) calc(50% + 1px),
      transparent calc(50% + 1px)),
    repeating-linear-gradient(-45deg,
      rgba(140, 59, 46, 0.08) 0 6px,
      transparent 6px 12px),
    #f3e7e5;
}

.calendar-grid .day.busy .num {
  text-decoration: line-through;
  color: #936058;
}

.calendar-grid .day.busy::after {
  content: "Busy";
  color: #8c3b2e;
  background: rgba(255, 255, 255, 0.75);
}

.calendar-grid .day.available::after {
  content: "Available";
  color: #2e6b46;
  background: rgba(46, 107, 70, 0.12);
}

.calendar-grid .day.available { cursor: pointer; }

.calendar-grid .day.available:hover,
.calendar-grid .day.available:focus-visible {
  outline: 2px solid #2e6b46;
  outline-offset: -2px;
  background: rgba(46, 107, 70, 0.08);
}

.calendar-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.4rem;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.8rem 1rem;
  background: #fcfbf8;
  border-top: 1px solid var(--rule);
}

.legend { display: inline-flex; align-items: center; gap: 0.4rem; }

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-available { background: #2e6b46; }
.dot-busy { background: #8c3b2e; }

@media (max-width: 480px) {
  .calendar-grid .day.busy::after { content: "B"; }
  .calendar-grid .day.available::after { content: "A"; }
}

/* ---------- Contact ---------- */
.contact-blurb { text-align: center; max-width: 620px; margin: 0 auto 2rem; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.contact-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--gold);
  padding: 1.6rem 1.2rem;
}

.contact-card .label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.contact-card a { text-decoration: none; font-size: 1.05rem; color: var(--navy); }

/* Booking popup (Web3Forms) */
.contact-cta { text-align: center; margin-top: 2.5rem; }

dialog.booking-dialog {
  border: none;
  padding: 0;
  background: transparent;
  width: min(680px, calc(100vw - 2rem));
}

dialog.booking-dialog::backdrop {
  background: rgba(22, 36, 61, 0.6);
}

.booking {
  position: relative;
  background: var(--cream);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--gold);
  padding: 2rem 1.6rem;
  max-height: 85vh;
  overflow-y: auto;
}

.dialog-close {
  position: absolute;
  top: 0.5rem;
  right: 0.7rem;
  background: none;
  border: none;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0.3rem;
}

.dialog-close:hover { color: var(--navy); }

.booking h3 { text-align: center; font-size: 1.45rem; margin-bottom: 1.5rem; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

.form-grid .full { grid-column: 1 / -1; }

.booking label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--navy);
}

.booking input:not(.botcheck),
.booking textarea {
  width: 100%;
  font: inherit;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  padding: 0.6rem 0.7rem;
  border: 1px solid #cfc9bc;
  border-radius: 3px;
  background: #fff;
  margin-top: 0.35rem;
}

.booking textarea { min-height: 120px; resize: vertical; }

.booking .btn { margin-top: 1.3rem; }

.botcheck { display: none; }

#form-status { margin-top: 0.9rem; font-size: 0.95rem; color: var(--muted); }
#form-status.ok { color: #2e6b46; }
#form-status.error { color: #8c3b2e; }

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: #b9b5ac;
  text-align: center;
  padding: 1.6rem 1rem;
  font-size: 0.9rem;
}

/* ---------- Admin ---------- */
.admin-page { background: #f1efe9; min-height: 100vh; }

.admin-main { max-width: 880px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }

.admin-main h1 { margin-bottom: 0.3rem; }

.admin-main .hint { color: var(--muted); margin-bottom: 2rem; }

.admin-section {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.admin-section h2 {
  font-size: 1.2rem;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 0.5rem;
  margin-bottom: 1.2rem;
}

.field { margin-bottom: 1.1rem; }

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--navy);
  margin-bottom: 0.35rem;
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  padding: 0.6rem 0.7rem;
  border: 1px solid #cfc9bc;
  border-radius: 3px;
  background: #fffdf9;
}

.field textarea { min-height: 110px; resize: vertical; }

.field textarea.tall { min-height: 320px; }

.field .help { font-size: 0.8rem; color: var(--muted); margin-top: 0.3rem; }

.admin-bar {
  position: sticky;
  bottom: 0;
  background: var(--navy);
  padding: 0.9rem 1.5rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 1rem;
}

#save-status { color: #dcd9d2; font-size: 0.9rem; }
#save-status.error { color: #f0b4b4; }
#save-status.ok { color: var(--gold-light); }
