/* ----------------- Base layout ----------------- */

:root {
  font-family: "EB Garamond", Garamond, "Apple Garamond", serif;
  background: #f3f4f6;
  color: #111827;
}

body {
  margin: 0;
  padding: 1.5rem;
  display: flex;
  flex-direction: column; /* stack card + footer */
  align-items: center;    /* center horizontally */
  background: #f3f4f6;
}

.page {
  max-width: 900px;
  width: 100%;
  background: #ffffff;
  padding: 1.5rem 1.5rem 2.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
  box-sizing: border-box;
}

/* Footer sits under the card */
.footer {
  max-width: 900px;
  width: 100%;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e5e7eb;
  font-size: 0.8rem;
  color: #6b7280;
  text-align: center;
  line-height: 1.4;
}

.section-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 1.25rem 0;
}

/* ----------------- Global links ----------------- */

a {
  color: #1E6091;                /* Open Water blue */
  text-decoration: none;
}

a:hover,
a:focus {
  color: #164d75;                /* slightly darker on hover */
  text-decoration: underline;
}

/* ----------------- Page title/subtitle ----------------- */

.page-title {
  text-align: center;
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: #111827;
}

.page-subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: #4b5563;
  margin: 0 0 1rem;
}

/* ----------------- Logo ----------------- */

.logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.logo-image {
  max-width: 900px;
  width: 100%;
  height: auto;
}

/* ----------------- Verse block ----------------- */

.verse {
  text-align: center;
  margin-bottom: 1.5rem;
}

.verse-text {
  font-size: 0.95rem;
  color: #374151;
  line-height: 1.5;
  font-style: italic;
}

.verse-ref {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #111827;
  text-align: right;
}

/* ----------------- Intro block ----------------- */

.intro {
  margin-bottom: 1.75rem;
}

/* Full-width opening paragraph about the book */
.intro-book {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #111827;
}

/* 2-column layout: hands photo (40%) + LAMP info (60%) */

.intro-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.intro-table td,
.intro-table th {
  border-bottom: none !important;
}

.intro-col {
  padding: 0.25rem 0.75rem;
  vertical-align: middle;       /* ensures vertical centering */
}

.intro-col-left {
  width: 40%;
}

.intro-col-right {
  width: 60%;
  text-align: center;
  vertical-align: middle;
}

/* Hands image — shrinks first, fills its 40% column */
.intro-photo {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  margin: 0.25rem auto;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
}

/* LAMP block */

.intro-lamp {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;     /* vertical center inside cell */
  height: 100%;
}

/* Slightly smaller logo, fits 60% column cleanly */
.lamp-logo {
  max-width: 70%;
  height: auto;
  margin: 0 auto 0.4rem auto;
  display: block;
}

/* Mission lines: keep sans-serif */
.intro-mission-lines {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 0.78rem;
  color: #4b5563;
  line-height: 1.35;
  text-align: center;
}

.intro-mission-lines div {
  margin-bottom: 0.15rem;
}

/* Keep mission lines on one line each on desktop */
@media (min-width: 769px) {
  .intro-mission-lines div {
    white-space: nowrap;
  }
}

/* Mobile: stack vertically and allow wrapping */
@media (max-width: 768px) {
  .intro-table,
  .intro-table tr,
  .intro-col {
    display: block;
    width: 100%;
    text-align: center;
  }

  .intro-mission-lines div {
    white-space: normal !important;
  }

  .intro-photo {
    max-width: 80%;
    margin-bottom: 0.75rem;
  }
}

/* ----------------- Generic sections & text ----------------- */

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-text {
  margin: 1.25rem 0 1rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #374151;
}

.section-heading {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}

.summary {
  margin: 0.5rem 0 1rem;
  font-size: 0.9rem;
  text-align: center;
  color: #374151;
}

.summary strong {
  font-weight: 600;
}

.small {
  font-size: 0.78rem;
  color: #6b7280;
}

/* ----------------- Table & net display ----------------- */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: #f9fafb;
}

th,
td {
  padding: 0.45rem 0.4rem;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}

th {
  text-align: left;
  font-weight: 600;
  color: #374151;
  font-size: 0.85rem;
}

td.league {
  width: 7.5rem;
  text-align: left;
  font-weight: 600;
}

td.amount {
  width: 5rem;
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: #4b5563;
}

td.slots {
  font-family: "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Light row backgrounds for each zone */
.zone-deep ~ tr:not(.zone-row) td {
  background: rgba(12, 45, 72, 0.06);
}

.zone-open ~ tr:not(.zone-row) td {
  background: rgba(30, 96, 145, 0.06);
}

.zone-harbor ~ tr:not(.zone-row) td {
  background: rgba(47, 119, 104, 0.06);
}

.zone-dock ~ tr:not(.zone-row) td {
  background: rgba(181, 228, 140, 0.12);
}

/* Slot (fish / empty) */

.slot {
  display: inline-flex;
  width: 1.4rem;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.08s ease-out;
}

.slot:hover {
  transform: translateY(-1px) scale(1.07);
}

.slot.filled {
  /* 🐟 */
}

.slot.empty {
  opacity: 0.7;
}

/* LEGEND */

.legend {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #6b7280;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Zone header rows */

.zone-row td {
  border-bottom: none;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-top: 0.65rem;
  padding-bottom: 0.35rem;
}

.zone-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.zone-label span.zone-name {
  opacity: 0.9;
}

.zone-deep {
  background: #0C2D48;
  color: #e5f2ff;
}

.zone-open {
  background: #1E6091;
  color: #e5f2ff;
}

.zone-harbor {
  background: #2f7768;
  color: #e6fffa;
}

.zone-dock {
  background: #b5e48c;
  color: #1f2933;
}

/* Public view: make league hyperlinks visually obvious */

#public-view .league a {
  color: #1E6091;
  text-decoration: underline;
  font-weight: 600;
}

#public-view .league a:hover {
  color: #164d75;
  text-decoration-thickness: 2px;
}

/* Public view: empty-slot links look clickable */

#public-view td.slots a .slot.empty {
  color: #1E6091;
}

#public-view td.slots a:hover .slot.empty {
  transform: translateY(-1px) scale(1.07);
  color: #164d75;
}

/* Only empty slots are clickable in public view */

#public-view .slot.empty {
  cursor: pointer;
}

/* ----------------- Modal styles ----------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem 1.5rem 1.75rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.3);
  position: relative;
}

/* Header: title + meta stacked */
.modal-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
}

/* Meta row: zone badge + nav */
.modal-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.modal-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.modal-nav button {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.9rem;
  background: #f9fafb;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.modal-nav button:hover {
  background: #e5e7eb;
}

/* Close button pinned to top-right of the modal */
.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  color: #6b7280;
}

.modal-close:hover {
  color: #111827;
}

/* Amount, subtitle */

.modal-amount {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.modal-subtitle {
  font-size: 0.9rem;
  color: #4b5563;
  margin-bottom: 0.75rem;
}

/* Stripe pay header inside modal */
.modal-amount-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.modal-pay-header {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: #6b7280;
  margin: 0;
}

.stripe-badge {
  height: 16px;
  width: auto;
}

.modal-pay-header {
  margin-top: 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.stripe-badge {
  height: 18px;
  width: auto;
  display: block;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.modal-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}

/* Buttons override base link color */
.btn-primary {
  background: #1d4ed8;
  color: #ffffff;
  border-color: #1d4ed8;
  font-weight: 600;
}

.btn-primary:hover {
  background: #1e40af;
  border-color: #1e40af;
}

.btn-secondary {
  background: #f9fafb;
  color: #111827;
  border-color: #d1d5db;
}

.btn-secondary:hover {
  background: #e5e7eb;
}

/* Bank / ACH info block */

.modal-bank {
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  font-size: 0.8rem;
  color: #4b5563;
}

.modal-bank-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #111827;
}

.modal-bank ul {
  margin: 0.25rem 0 0.4rem 1.1rem;
  padding: 0;
}

.modal-bank li {
  margin-bottom: 0.1rem;
}

.modal-bank-note {
  font-size: 0.76rem;
  color: #6b7280;
}

/* Zone badge inside modal */

.zone-badge {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.zone-badge.zone-deep {
  background: #0C2D48;
  color: #e5f2ff;
}

.zone-badge.zone-open {
  background: #1E6091;
  color: #e5f2ff;
}

.zone-badge.zone-harbor {
  background: #2f7768;
  color: #e6fffa;
}

.zone-badge.zone-dock {
  background: #b5e48c;
  color: #1f2933;
}

/* ----------------- Responsive tweaks ----------------- */

@media (max-width: 640px) {
  td.amount {
    font-size: 0.8rem;
  }
  .slot {
    width: 1.2rem;
  }
  /* Hide Monthly column on small screens */
  th:nth-child(2),
  td.amount {
    display: none;
  }
  .modal {
    margin: 0 1rem;
  }
}
