:root {
  --brand-main: #2fa8d3;
  --brand-hover: rgba(47, 168, 211, 0.12); /* Subtle tint */
}

/* =========================================================
   TYPOGRAPHY
   ========================================================= */
.elms-sans-body {
  font-family: "Elms Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
}

body {
  font-family:
    "Elms Sans",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  margin: 0;
  padding: 0;
  background: #f5f5f5;
  line-height: 30px;
  font-weight: 300;
}

/* =========================================================
   HEADER
   ========================================================= */
header {
  background: #41b8e5;
  color: white;
  padding: 1rem 2rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
}

header h1 {
  text-align: left;
  margin: 0;
  width: 100%;
}

header button {
  background: white;
  color: #c62828;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}
header img {
  height: 56px;
  width: auto;
  display: block;
  justify-self: end;
}
/* =========================================================
   TOP NAVIGATION
   ========================================================= */
.main-nav {
  background: #2fa8d3;
  padding: 0.7rem 1.2rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  font-family: "Elms Sans", sans-serif;
  flex-wrap: wrap; /* ✅ allow wrap on mobile */
}

.main-nav a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  transition: background 0.2s;
}

.main-nav a:hover {
  background: rgba(255, 255, 255, 0.25);
}

.main-nav a.active {
  background: rgba(255, 255, 255, 0.35);
}

.nav-right {
  margin-left: auto;
  display: flex;
  gap: 0.6rem;
  flex-wrap: nowrap; /* keep login/logout together */
}

#logoutButton {
  background: white;
  color: #c62828;
  border: none;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

/* =========================================================
   LAYOUT
   ========================================================= */
main {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.hero {
  text-align: center;
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

.hero h2 {
  margin-top: 0;
}

/* Cards / Containers */
.card,
.card_login {
  overflow: hidden;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  align-items: start; /* <-- IMPORTANT: don't stretch cards to same height */
}
.card {
  background: #fff;
  padding: 1.25rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  color: #333;
}
.card_login {
  background: rgba(65, 184, 229, 0.18);
  border: 1px solid rgba(65, 184, 229, 0.35);
  padding: 0.1rem 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

@media (min-width: 900px) {
  .card_login {
    padding-bottom: 0.75rem; /* makes it feel a bit tighter */
  }
}
.account-card {
  padding: 30px;
  border-radius: 20px; /* keeps your lovely rounded feel */
}

.account-wrapper {
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* =========================================================
   FORMS
   ========================================================= */
label {
  display: block;
  margin: 0.5rem 0 0.25rem;
  font-size: 0.9rem;
}

input {
  width: 100%;
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  box-sizing: border-box;
  font-family: "Elms Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-size: 1em;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-block;
  margin-top: 0.75rem;
  background: #c62828;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

.btn.secondary {
  background: #555;
}

/* =========================================================
   STATUS MESSAGES
   ========================================================= */
.error {
  color: #c62828;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.success {
  color: green;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* =========================================================
   BADGES
   ========================================================= */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge.paid {
  background: #e0f2f1;
  color: #00796b;
}

.badge.unpaid {
  background: #ffebee;
  color: #c62828;
}

/* =========================================================
   INFO GRID (Member fields)
   ========================================================= */
.info-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  padding: 6px 0;
  align-items: center;
}

.info-label {
  font-weight: 600;
  color: #000;
}

.info-value {
  font-size: 1rem;
  color: #333;
}

/* =========================================================
   PAYMENT SELECTION BLOCK
   ========================================================= */
.payment-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 35px;
  margin-bottom: 20px;
  width: 100%;
}

.payment-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
}

.payment-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

.pay-btn {
  min-width: 110px;
}

/* =========================================================
   MODALS
   ========================================================= */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

/* =========================================================
   TABLES (Payment history)
   ========================================================= */
.history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.history-table th,
.history-table td {
  border-bottom: 1px solid #ddd;
  padding: 6px 4px;
  text-align: left;
}

.history-table th {
  font-weight: 600;
}
/* ------------------------------------------------------
   MOBILE RESPONSIVE FIXES (iOS overflow protection)
   ------------------------------------------------------ */
@media (max-width: 600px) {
  .main-nav {
    justify-content: center; /* nicer when it wraps */
  }

  .nav-right {
    width: 100%; /* take full row */
    justify-content: flex-end; /* push Login to the right */
    margin-left: 0; /* don't try to push off-screen */
  }
  /* Force wrapping for long data items (emails, long names) */
  .info-value {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
  }

  /* Narrower button layout on small screens */
  .payment-buttons {
    flex-wrap: wrap;
    gap: 10px;
  }

  .pay-btn {
    min-width: 90px;
    padding: 0.45rem 0.8rem;
    font-size: 0.9rem;
  }

  /* Ensure title does not overflow */
  .payment-title {
    font-size: 1rem;
    padding: 0 10px;
  }

  /* Reduce card horizontal padding on mobile */
  .account-card {
    padding: 20px;
  }

  /* Reduce grid column widths so labels don’t push content off screen */
  .info-row {
    grid-template-columns: 130px 1fr;
  }
}
/* ============================================================
   HERO PHOTO UPGRADE
============================================================ */
.hero.hero--photo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 80px; /* top heavier than bottom */
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  margin: 27px auto;
  color: #fff;
  background-size: cover;
  background-position: center;
}
.hero.hero--photo {
  /* Fallback that ALWAYS works */
  background-image: url("/boats-for-sail/images/hero-paper-tigers.jpg");
  background-size: cover;
  background-position: center;

  /* Prefer WebP when supported */
  background-image: -webkit-image-set(
    url("/boats-for-sail/images/hero-paper-tigers.webp") 1x,
    url("/boats-for-sail/images/hero-paper-tigers.jpg") 1x
  );
  background-image: image-set(url("/boats-for-sail/images/hero-paper-tigers.webp") 1x, url("/boats-for-sail/images/hero-paper-tigers.jpg") 1x);
}

/* overlay for readability */
.hero.hero--photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(3, 16, 33, 0.55), rgba(3, 16, 33, 0.35));
  display: flex;
  align-items: flex-end; /* pushes content toward bottom */
}

.hero.hero--photo .hero-inner {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  margin-top: 70px; /* adjust to taste */
}

.hero.hero--photo h2 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 2.6vw, 2.6rem);
  letter-spacing: 0.2px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.hero.hero--photo p {
  margin: 0 auto;
  max-width: 760px;
  font-size: 1.05rem;
  line-height: 1.6;
  opacity: 0.95;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Mobile: keep heads in frame better */
@media (max-width: 700px) {
  .hero.hero--photo {
    padding: 42px 18px;
    background-position: 55% center;
    border-radius: 14px;
  }
}
