/* Nagatamen Chapter — site styles
   Colors follow Order of the Arrow red, black and white. */

:root {
  --red: #b3131b;
  --red-dark: #8a0e14;
  --black: #16130f;
  --ink: #2a2622;
  --muted: #5f5850;
  --paper: #faf8f4;
  --card: #ffffff;
  --line: #e6e0d6;
  --radius: 10px;
  --wrap: 1080px;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}

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

[hidden] { display: none !important; }

a { color: var(--red); text-underline-offset: 3px; }
a:hover { color: var(--red-dark); }

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--black);
  line-height: 1.2;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--black);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  z-index: 100;
}
.skip-link:focus { left: 8px; }

/* ---------- Header ---------- */

.site-header {
  background: var(--black);
  color: #fff;
  border-bottom: 4px solid var(--red);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}
.brand:hover { color: #fff; }
.brand-mark { width: 42px; height: 42px; flex: none; }
.brand-logo { width: 48px; height: 48px; flex: none; }
.brand-logo { object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; letter-spacing: 0.02em; }
.brand-sub { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: #c9c2b8; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
}
.site-nav a {
  display: block;
  color: #fff;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 500;
}
.site-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.site-nav a[aria-current="page"] { background: var(--red); }

.nav-toggle, .nav-toggle-label { display: none; }

@media (max-width: 640px) {
  .nav-toggle-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    padding: 10px;
  }
  .nav-toggle-label span { display: block; height: 2px; background: #fff; border-radius: 2px; }
  .site-nav ul {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    background: var(--black);
    padding: 8px 12px 16px;
    border-bottom: 4px solid var(--red);
  }
  .nav-toggle:checked ~ ul { display: flex; }
  .site-nav a { padding: 12px 14px; }
}

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

.hero {
  background:
    radial-gradient(ellipse at 85% 0%, rgba(179,19,27,0.35), transparent 55%),
    linear-gradient(160deg, #221d18 0%, var(--black) 70%);
  color: #fff;
  padding: clamp(56px, 10vw, 112px) 0 clamp(48px, 8vw, 88px);
  position: relative;
  overflow: hidden;
}
.hero h1 { color: #fff; margin-bottom: 0.3em; }
.hero .eyebrow { color: #f0b9bc; }
.hero-lede { font-size: clamp(1.1rem, 2.4vw, 1.3rem); max-width: 38em; color: #e9e4dc; }
.hero-meaning {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--serif);
  font-style: italic;
  color: #fff;
  border-left: 3px solid var(--red);
  padding-left: 14px;
}
.hero-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }

.eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--red);
  margin-bottom: 10px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-ghost { border-color: rgba(255,255,255,0.5); color: #fff; }
.btn-ghost:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,0.08); }

/* ---------- Sections ---------- */

.section { padding: clamp(48px, 8vw, 80px) 0; }
.section-alt { background: #f1ece3; }
.section-head { max-width: 40em; margin-bottom: 32px; }
.section-head p { color: var(--muted); }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  border-radius: var(--radius);
  padding: 28px;
}
.card h3 { margin-bottom: 0.5em; }
.card p:last-child { margin-bottom: 0; }

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fbe9ea;
  color: var(--red);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}
.card-icon svg { width: 24px; height: 24px; }

.prose { max-width: 42em; }

.callout {
  background: var(--black);
  color: #fff;
  border-radius: var(--radius);
  padding: clamp(28px, 5vw, 44px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.callout h2 { color: #fff; margin-bottom: 0.25em; }
.callout p { color: #d8d1c7; margin: 0; }

/* ---------- About page ---------- */

.page-hero {
  background: var(--black);
  color: #fff;
  padding: clamp(40px, 7vw, 72px) 0;
}
.page-hero h1 { color: #fff; margin-bottom: 0.2em; }
.page-hero p { color: #d8d1c7; max-width: 38em; margin: 0; }
.page-hero .eyebrow { color: #f0b9bc; }

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 820px) {
  .split { grid-template-columns: 1.4fr 1fr; gap: 56px; align-items: start; }
}

.meaning-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
}
.meaning-word {
  font-family: var(--serif);
  font-size: 2.2rem;
  color: var(--black);
  margin: 0;
}
.meaning-def {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--red);
  margin: 4px 0 12px;
}
.meaning-note { color: var(--muted); font-size: 0.95rem; margin: 0; }

.team {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.team li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.team .role {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--red);
  font-weight: 600;
}
.team .name {
  display: block;
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--black);
  margin-top: 2px;
}
.team-advisers { margin-top: 16px; }
.team-advisers li { background: #f6f2ec; }

.purpose-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: purpose;
}
.purpose-list li {
  counter-increment: purpose;
  position: relative;
  padding: 0 0 18px 52px;
}
.purpose-list li::before {
  content: counter(purpose);
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.photo-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}

/* ---------- Carousel (slideshow and trip reports) ---------- */

.slideshow-section { padding: clamp(28px, 5vw, 48px) 0 0; }
.slideshow-section[hidden] { display: none; }

.carousel {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--black);
  aspect-ratio: 3 / 2;
}
.carousel[hidden] { display: none; }
.carousel-wide {
  aspect-ratio: 16 / 9;
  box-shadow: 0 10px 30px rgba(22, 19, 15, 0.18);
}
@media (max-width: 640px) {
  .carousel-wide { aspect-ratio: 4 / 3; }
}

.slides { position: absolute; inset: 0; }

.slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.slide.is-active { opacity: 1; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  .slide { transition: none; }
}
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 40px 20px 44px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
  color: #fff;
  font-size: 0.98rem;
}

.slide-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(22, 19, 15, 0.55);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s;
}
.slide-btn:hover { background: var(--red); }
.slide-btn svg { width: 22px; height: 22px; }
.slide-prev { left: 12px; }
.slide-next { right: 12px; }

.slide-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  z-index: 2;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 60px;
}
.slide-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #fff;
  background: transparent;
  cursor: pointer;
}
.slide-dot[aria-current="true"] { background: #fff; }

.carousel.single .slide-btn,
.carousel.single .slide-dots { display: none; }

/* ---------- Trip reports ---------- */

.reports { display: grid; gap: clamp(48px, 8vw, 88px); }

.report {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;
  scroll-margin-top: 90px;
}
@media (min-width: 820px) {
  .report { grid-template-columns: 1fr 1fr; gap: 48px; }
  .report:nth-child(even) .report-text { order: 2; }
  .report:nth-child(even) .report-media { order: 1; }
  .report.no-photos { grid-template-columns: 1fr; max-width: 46em; }
}
.report.no-photos .report-media { display: none; }

.report h2 { margin-bottom: 0.15em; }
.report-meta { color: var(--muted); font-size: 0.95rem; margin-bottom: 1em; }
.report-body p:last-child { margin-bottom: 0; }

.reports-empty { color: var(--muted); }

/* ---------- Events ---------- */

.event-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip {
  font: inherit; font-weight: 600; font-size: 0.92rem; cursor: pointer;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.chip[aria-pressed="true"] { background: var(--black); border-color: var(--black); color: #fff; }

.events { display: grid; gap: 14px; max-width: 52em; }
.event-month {
  font-family: var(--sans); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted); margin: 22px 0 2px;
}
.event-month:first-child { margin-top: 0; }

.event {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 6px 18px; align-items: start;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid #b9b1a5;
  border-radius: var(--radius); padding: 18px 20px;
}
.event-chapter { border-left-color: var(--red); }
@media (min-width: 640px) {
  .event { grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; }
}
.event-date {
  display: grid; justify-items: center; line-height: 1.1; padding: 6px 0;
  border-radius: 8px; background: #f3eee6; color: var(--black);
}
.event-chapter .event-date { background: #fbe9ea; color: var(--red-dark); }
.event-dow, .event-mon { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
.event-day { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; }
.event-body h3 { margin: 6px 0 2px; font-size: 1.2rem; }
.event-when { margin: 0; font-weight: 600; color: var(--ink); }
.event-where { margin: 2px 0 0; color: var(--muted); font-size: 0.95rem; }
.event-desc { margin: 8px 0 0; color: var(--muted); font-size: 0.95rem; white-space: pre-line; overflow-wrap: anywhere; }
.event-body { min-width: 0; }
.event-signup { grid-column: 2; justify-self: start; margin-top: 8px; white-space: nowrap; }
@media (min-width: 640px) {
  .event-signup { grid-column: 3; grid-row: 1; margin-top: 0; }
}
.badge-chapter { background: #fbe9ea; color: var(--red-dark); }
.badge-lodge { background: #eee9e1; color: var(--muted); }

/* ---------- Admin ---------- */

.page-hero-slim { padding: clamp(28px, 5vw, 44px) 0; }

.btn-outline { border-color: var(--line); color: var(--ink); background: var(--card); }
.btn-outline:hover { border-color: var(--red); color: var(--red); }
.btn[disabled], .btn:disabled { opacity: 0.55; cursor: not-allowed; }
button.btn { font: inherit; font-weight: 600; cursor: pointer; }

.admin-loading { color: var(--muted); }
.admin-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.admin-toolbar h2 { margin: 0; }

.admin-banner, .admin-note, .admin-flash {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
}
.admin-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  background: #fff7e6; border: 1px solid #f0d9a8;
}
.admin-banner p { margin: 4px 0 0; color: var(--muted); }
.admin-note { background: #fbe9ea; border: 1px solid #f1c2c5; }
.admin-flash { background: #e8f5ec; border: 1px solid #b9dfc5; }
.admin-error {
  background: #fbe9ea; border: 1px solid #f1c2c5; color: var(--red-dark);
  border-radius: var(--radius); padding: 12px 16px; margin: 16px 0;
}
.admin-progress { color: var(--muted); margin: 12px 0; font-weight: 600; }

.admin-group { margin-bottom: 32px; }
.admin-group h3 { font-family: var(--sans); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.admin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.admin-item {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; text-decoration: none; color: var(--ink);
}
.admin-item:hover { border-color: var(--red); color: var(--ink); }
.admin-item strong { font-family: var(--serif); font-size: 1.15rem; color: var(--black); }
.admin-item span:not(.badge) { grid-column: 1; color: var(--muted); font-size: 0.92rem; }
.admin-item .badge { grid-column: 2; grid-row: 1 / span 2; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; white-space: nowrap;
}
.badge-draft { background: #eee9e1; color: var(--muted); }
.badge-submitted { background: #fff1d6; color: #8a5a00; }
.badge-changes { background: #fbe9ea; color: var(--red-dark); }
.badge-published { background: #e3f3e8; color: #1d6b37; }

.admin-back { text-decoration: none; font-weight: 600; }
.admin-status { margin-bottom: 16px; }

.admin-form { display: grid; gap: 18px; max-width: 46em; }
.admin-form label { display: grid; gap: 6px; font-weight: 600; color: var(--black); }
.admin-form .hint, .admin-photos .hint { font-weight: 400; color: var(--muted); font-size: 0.92rem; }
.admin-form input:not([type="file"]), .admin-form textarea {
  font: inherit; font-weight: 400; color: var(--ink);
  padding: 10px 12px; border: 1px solid #cfc7ba; border-radius: 8px; background: #fff; width: 100%;
}
.admin-form input:focus, .admin-form textarea:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: var(--red); }
.admin-form textarea { line-height: 1.6; resize: vertical; }
.admin-row { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.admin-photos { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 20px; background: var(--card); }
.admin-photos legend { font-weight: 600; color: var(--black); padding: 0 6px; }
.photo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 12px 0 16px; }
.photo-card { position: relative; display: grid; gap: 6px; }
.photo-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: #eee; }
.photo-card input { font-size: 0.88rem !important; padding: 6px 8px !important; }
.photo-remove { font: inherit; font-size: 0.85rem; background: none; border: 0; color: var(--red); cursor: pointer; text-align: left; padding: 0; }
.photo-new {
  position: absolute; top: 6px; left: 6px; background: rgba(22,19,15,0.75); color: #fff;
  font-size: 0.72rem; padding: 2px 8px; border-radius: 999px;
}
.admin-form label.photo-pick { display: inline-block; justify-self: start; cursor: pointer; color: var(--ink); }

.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-actions[hidden] { display: none; }

.admin-preview { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }
.admin-preview > h2 { font-family: var(--sans); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }

.admin-toolbar-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-form select {
  font: inherit; font-weight: 400; color: var(--ink);
  padding: 10px 12px; border: 1px solid #cfc7ba; border-radius: 8px; background: #fff; width: 100%;
}
.user-list { list-style: none; margin: 20px 0 40px; padding: 0; display: grid; gap: 10px; max-width: 46em; }
.user-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px;
}
.user-row strong { display: block; color: var(--black); }
.user-row span:not(.badge) { color: var(--muted); font-size: 0.92rem; }
.user-controls { display: flex; align-items: center; gap: 14px; }
.user-controls select {
  font: inherit; padding: 6px 10px; border: 1px solid #cfc7ba; border-radius: 8px; background: #fff;
}
.user-add h3 { margin: 0; }

.admin-danger { margin-top: 12px; padding-top: 20px; border-top: 1px dashed var(--line); }
.btn-danger { background: var(--card); color: var(--red-dark); border-color: #f1c2c5; }
.btn-danger:hover { background: #fbe9ea; color: var(--red-dark); border-color: var(--red); }

.link-list { list-style: none; margin: 20px 0; padding: 0; display: grid; gap: 10px; max-width: 52em; }
.link-row { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.link-row > div:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.link-row strong { color: var(--black); }
.link-row > div:first-child span:not(.badge) { color: var(--muted); font-size: 0.92rem; }
.link-status { margin: 6px 0 10px; word-break: break-all; }
.link-edit { display: flex; gap: 8px; }
.link-edit input {
  flex: 1; min-width: 0; font: inherit; font-size: 0.95rem; padding: 8px 10px;
  border: 1px solid #cfc7ba; border-radius: 8px; background: #fff;
}
.link-edit .btn { padding: 8px 16px; }

.admin-callback { padding: 48px 20px; max-width: 40em; }
.admin-callback textarea { width: 100%; font-family: monospace; padding: 10px; }

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

.site-footer {
  background: var(--black);
  color: #c9c2b8;
  padding: 40px 0 24px;
  border-top: 4px solid var(--red);
  font-size: 0.95rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
}
.footer-name { font-family: var(--serif); color: #fff; font-size: 1.15rem; margin-bottom: 2px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.footer-links a { color: #fff; }
.footer-fine { margin-top: 28px; font-size: 0.82rem; color: #8f877d; }
.footer-fine p { margin: 0; }

/* ---------- 404 ---------- */

.not-found { text-align: center; padding: 96px 0; }
