/* Country Club Collective — base styles */

:root {
  --navy-900: #141f33;
  --navy-800: #1a2740;
  --navy-700: #22324f;
  --gold: #a8875a;
  --gold-light: #c4a678;
  --cream: #f4f1ea;
  --ivory: #faf8f3;
  --ink: #1a2740;
  --muted: #5c6577;

  --serif: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --max: 1200px;
  --gutter: clamp(16px, 4vw, 48px);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
}

.rule {
  width: 120px;
  height: 1px;
  background: var(--gold);
  border: 0;
  margin: 2rem auto;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 1rem;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy-800);
  color: var(--cream);
  border-bottom: 1px solid rgba(168, 135, 90, 0.5);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--cream);
}

.brand img { width: 48px; height: 48px; }

.brand span {
  font-size: 0.95rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav a {
  white-space: nowrap;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cream);
  padding: 0.5rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--gold-light);
  border-bottom-color: var(--gold);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(168, 135, 90, 0.6);
  color: var(--cream);
  width: 44px;
  height: 44px;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 20px;
  height: 1px;
  background: currentColor;
  margin: 0 auto;
  position: relative;
  content: "";
}

.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

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

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy-800);
    border-bottom: 1px solid rgba(168, 135, 90, 0.5);
    display: none;
  }

  .nav.is-open { display: block; }

  .nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.5rem;
  }

  .nav li { border-top: 1px solid rgba(244, 241, 234, 0.08); }
  .nav a { display: block; padding: 1rem 0; border-bottom: 0; }
}

@media (max-width: 480px) {
  .brand span { font-size: 0.72rem; letter-spacing: 0.18em; }
  .brand img { width: 40px; height: 40px; }
}

/* Utility bar above the main menu */
.site-header .utility {
  min-height: 0;
  justify-content: flex-end;
  padding-top: 0.6rem;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gold-light);
  border: 1px solid rgba(168, 135, 90, 0.6);
  padding: 0.4rem 0.85rem;
  transition: background 0.2s, color 0.2s;
}

.login-btn:hover,
.login-btn[aria-current="page"] { background: var(--gold); color: var(--navy-900); }

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

.hero {
  background: linear-gradient(160deg, var(--navy-700) 0%, var(--navy-800) 45%, var(--navy-900) 100%);
  color: var(--cream);
  text-align: center;
  padding: clamp(5rem, 14vw, 10rem) 0;
}

.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 4.25rem);
  margin: 0;
}

.hero .tagline,
.page-hero .tagline {
  font-size: clamp(0.8rem, 1.6vw, 1.05rem);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  line-height: 1.9;
  margin: 0 auto 3rem;
}

.btn {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 1rem 2.25rem;
  border: 1px solid var(--gold);
  color: var(--cream);
  transition: background 0.2s, color 0.2s;
}

.btn:hover { background: var(--gold); color: var(--navy-900); }

.btn--dark { color: var(--navy-800); }
.btn--dark:hover { color: var(--cream); }

/* The divider spans exactly the width of the tagline beneath it. */
.hero__sub { display: table; margin: 0 auto 3rem; max-width: 100%; }
.hero__sub .tagline { margin-bottom: 0; }
.hero__sub .rule { width: 100%; }
/* Offset the trailing letter-spacing so the text and line stay centred together. */
.hero__sub .tagline { margin-right: -0.25em; }

/* Keep each tagline line (split with <br>) on one line wherever it fits. */
@media (min-width: 760px) {
  .hero .tagline { white-space: nowrap; }
}

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

.section { padding: clamp(4rem, 9vw, 7rem) 0; }

.section--cream { background: var(--cream); }

.section--navy {
  background: var(--navy-800);
  color: var(--cream);
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3.5rem;
}

.section-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }

.section-head p { color: var(--muted); margin: 0; }
.section--navy .section-head p { color: rgba(244, 241, 234, 0.75); }

.intro {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.75;
}

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

.card {
  background: #fff;
  border: 1px solid rgba(26, 39, 64, 0.08);
  display: flex;
  flex-direction: column;
}

.card__media {
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(160deg, rgba(34, 50, 79, 0.9), rgba(20, 31, 51, 0.95)),
    var(--navy-800);
  display: grid;
  place-items: center;
  color: rgba(168, 135, 90, 0.6);
}

.card__media img { width: 64px; opacity: 0.35; }

.card__body { padding: 1.75rem; flex: 1; display: flex; flex-direction: column; }
.card__body h3 { font-size: 1.4rem; }
.card__body p { color: var(--muted); margin: 0 0 1.5rem; flex: 1; }

.card__link {
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gold);
}

.card__link:hover { color: var(--navy-800); }

.pillars {
  display: grid;
  gap: 3rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  text-align: center;
}

.pillars h3 { font-size: 1.35rem; color: var(--cream); }
.pillars p { color: rgba(244, 241, 234, 0.75); margin: 0; }

.pillar-num {
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--gold);
  letter-spacing: 0.2em;
  display: block;
  margin-bottom: 1rem;
}

.center { text-align: center; margin-top: 3rem; }

/* ---------- Page header (interior pages) ---------- */

.page-hero {
  background: linear-gradient(160deg, var(--navy-700) 0%, var(--navy-900) 100%);
  color: var(--cream);
  text-align: center;
  padding: clamp(4rem, 10vw, 6.5rem) 0;
}

.page-hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0; }

.placeholder {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  color: var(--muted);
}

/* ---------- Contact form ---------- */

.form {
  max-width: 640px;
  margin: 0 auto;
  display: grid;
  gap: 1.25rem;
}

.form label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  color: var(--navy-800);
}

.form input,
.form textarea {
  width: 100%;
  font: inherit;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(26, 39, 64, 0.2);
  background: #fff;
  color: var(--ink);
}

.form input:focus,
.form textarea:focus { outline: 2px solid var(--gold); outline-offset: -1px; }

.form textarea { min-height: 160px; resize: vertical; }

.form button { justify-self: start; background: none; cursor: pointer; }

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

.site-footer {
  background: var(--navy-900);
  color: rgba(244, 241, 234, 0.7);
  padding: 4rem 0 2rem;
  font-size: 0.9rem;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(168, 135, 90, 0.35);
}

.site-footer .nav ul { gap: 1.5rem; flex-wrap: wrap; }

.site-footer .nav {
  position: static;
  display: block;
  background: none;
  border: 0;
}

.site-footer .nav ul { flex-direction: row; padding: 0; }
.site-footer .nav li { border: 0; }
.site-footer .nav a { padding: 0.25rem 0; color: rgba(244, 241, 234, 0.7); }

.footer-bottom {
  padding-top: 2rem;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ---------- Clubs mega menu ---------- */

.site-header .container { position: relative; }

.btn--gold { background: var(--gold); color: var(--navy-900); }
.btn--gold:hover { background: var(--navy-800); color: var(--cream); border-color: var(--navy-800); }
.btn--block { display: block; text-align: center; margin-top: 0.75rem; }

.mega { display: none; }

@media (min-width: 1141px) {
  .has-mega { position: static; }

  .mega {
    position: absolute;
    top: 100%;
    left: var(--gutter);
    right: var(--gutter);
    background: var(--ivory);
    color: var(--ink);
    border-top: 2px solid var(--gold);
    box-shadow: 0 24px 48px rgba(10, 16, 28, 0.35);
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 2rem 2.5rem 2.5rem;
    text-align: left;
  }

  /* Opened by JS (with a short close delay) or by keyboard focus. */
  .has-mega:focus-within > .mega,
  .has-mega.is-open > .mega { display: block; }

  /* Invisible bridge over the gap between the menu link and the panel,
     so moving the mouse down to the panel doesn't close it. */
  .mega::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 48px;
  }

  .has-mega.is-closed > .mega { display: none; }
}

.mega__head {
  display: flex;
  align-items: flex-end;
  gap: 2rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid rgba(26, 39, 64, 0.12);
}

.mega__head .eyebrow { margin-bottom: 0.25rem; }

.mega__title {
  font-family: var(--serif);
  font-size: 1.6rem;
  margin: 0;
  white-space: nowrap;
}

.mega__title span {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: 0.75rem;
}

.mega__search,
.dir-search {
  flex: 1;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(26, 39, 64, 0.2);
  background: #fff;
  color: var(--ink);
}

.mega__search:focus,
.dir-search:focus { outline: 2px solid var(--gold); outline-offset: -1px; }

.nav .mega a { border-bottom: 0; }

.nav .mega__all {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  white-space: nowrap;
  padding: 0.75rem 0;
}

.mega__cols {
  column-width: 230px;
  column-gap: 2.5rem;
}

.mega__region {
  break-inside: avoid-column;
  margin-bottom: 1.75rem;
}

.mega__region h3 {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0 0 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--gold);
}

.nav .mega__region h3 a { color: var(--gold); letter-spacing: inherit; font-size: inherit; padding: 0; }

.nav .mega__region ul { display: block; padding: 0; }
.nav .mega__region li { border: 0; }

.nav .mega__region li a {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  padding: 0.22rem 0;
  line-height: 1.35;
}

.nav .mega__region li a:hover { color: var(--gold); }

.mega__city { color: var(--muted); font-size: 0.75rem; }

.mega__empty { color: var(--muted); margin: 0; }

/* ---------- Club directory ---------- */

.dir-tools { max-width: 640px; margin: 0 auto 2rem; display: flex; }

.dir-jump {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 3.5rem;
}

.dir-jump a {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.5rem 0.9rem;
  border: 1px solid rgba(26, 39, 64, 0.15);
}

.dir-jump a:hover { border-color: var(--gold); color: var(--gold); }
.dir-jump span { color: var(--gold); margin-left: 0.3rem; }

.dir-region { margin-bottom: 3.5rem; scroll-margin-top: 140px; }

.dir-region h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--gold);
  margin-bottom: 1.5rem;
}

.dir-region h2 span,
.page-hero .club-type {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-left: 0.5rem;
}

.dir-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.dir-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.1rem 1.25rem;
  background: #fff;
  border: 1px solid rgba(26, 39, 64, 0.08);
  border-left: 2px solid var(--gold);
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s;
}

.dir-card:hover { box-shadow: 0 8px 24px rgba(20, 31, 51, 0.12); transform: translateY(-1px); }

.dir-card__name { font-family: var(--serif); font-size: 1.1rem; line-height: 1.3; }
.dir-card__city { font-size: 0.85rem; color: var(--muted); }
.dir-card__meta { font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--gold); }

/* ---------- Club profile ---------- */

.page-hero--club .club-type { margin: 1.25rem 0 0; display: block; }

.breadcrumb {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  color: rgba(244, 241, 234, 0.6);
}

.breadcrumb a { text-decoration: none; color: rgba(244, 241, 234, 0.8); }
.breadcrumb a:hover { color: var(--gold-light); }
.breadcrumb span { margin: 0 0.4rem; color: var(--gold); }

.club-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 4rem;
  align-items: start;
}

@media (max-width: 960px) {
  .club-layout { grid-template-columns: 1fr; gap: 3rem; }
}

.club-main h2 {
  font-size: 1.6rem;
  margin: 2.75rem 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(168, 135, 90, 0.5);
}

.club-main h2:first-child { margin-top: 0; }
.club-main p { margin: 0 0 1.1rem; font-size: 1.02rem; }

.table-wrap { overflow-x: auto; }

.golf-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }

.golf-table th {
  text-align: left;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 1px solid rgba(26, 39, 64, 0.15);
}

.golf-table td {
  padding: 0.8rem 0.75rem 0.8rem 0;
  border-bottom: 1px solid rgba(26, 39, 64, 0.08);
  vertical-align: top;
}

.golf-table td small { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 0.2rem; }

.highlights { padding-left: 1.1rem; margin: 0; }
.highlights li { margin-bottom: 0.5rem; }
.highlights li::marker { color: var(--gold); }

.sources ul { list-style: none; padding: 0; margin: 0; font-size: 0.8rem; }
.sources li { margin-bottom: 0.35rem; overflow-wrap: anywhere; }
.sources a { color: var(--muted); }
.club-main .sources h2 { font-size: 1.1rem; margin-top: 2.75rem; }

.club-main .verified { font-size: 0.8rem; color: var(--muted); margin-top: 2rem; font-style: italic; }

.club-aside {
  background: #fff;
  border: 1px solid rgba(26, 39, 64, 0.08);
  border-top: 2px solid var(--gold);
  padding: 2rem;
  position: sticky;
  top: 144px;
}

.club-aside h3 {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
}

.facts { margin: 0 0 1.75rem; }
.fact { padding: 0.65rem 0; border-bottom: 1px solid rgba(26, 39, 64, 0.08); }
.fact dt { font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); }
.fact dd { margin: 0.15rem 0 0; }
.fact dd a { color: var(--ink); }

.chips { list-style: none; padding: 0; margin: 0 0 1.75rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chips li { font-size: 0.75rem; padding: 0.35rem 0.7rem; background: var(--cream); border: 1px solid rgba(168, 135, 90, 0.35); }

/* ---------- Club photography ---------- */

.page-hero--photo {
  position: relative;
  background-color: var(--navy-800);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  padding: clamp(7rem, 18vw, 12rem) 0 clamp(4rem, 9vw, 6rem);
}

.page-hero--photo h1 { text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35); }

.gallery { background: var(--navy-900); padding: 0 0 clamp(2.5rem, 5vw, 4rem); }

.gal {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: clamp(140px, 17vw, 230px);
  margin-top: -1px;
}

.gal__item { margin: 0; position: relative; overflow: hidden; background: var(--navy-700); }
.gal__item--lead { grid-column: span 2; grid-row: span 2; }
.gal--1 .gal__item--lead { grid-column: 1 / -1; }
.gal--2 .gal__item { grid-column: span 2; grid-row: span 2; }
.gal--3 .gal__item:not(.gal__item--lead) { grid-column: span 2; }
.gal--4 .gal__item:last-child { grid-column: span 2; }

.gal__item a { display: block; height: 100%; }

.gal__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, filter 0.3s;
}

.gal__item a:hover img { transform: scale(1.04); filter: brightness(1.05); }

.gal__tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cream);
  background: rgba(20, 31, 51, 0.7);
  padding: 0.3rem 0.55rem;
  pointer-events: none;
}

@media (max-width: 700px) {
  .gal { grid-template-columns: 1fr 1fr; grid-auto-rows: 130px; }
  .gal__item--lead,
  .gal--2 .gal__item,
  .gal--3 .gal__item:not(.gal__item--lead),
  .gal--4 .gal__item:last-child { grid-column: 1 / -1; grid-row: span 2; }
  .gal--3 .gal__item:not(.gal__item--lead) { grid-row: span 1; }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 16, 28, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem 1.5rem;
}

.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 9rem); object-fit: contain; }

.lightbox p {
  color: rgba(244, 241, 234, 0.8);
  font-size: 0.85rem;
  margin: 1rem 0 0;
  text-align: center;
  max-width: 70ch;
}

.lightbox button {
  position: absolute;
  background: none;
  border: 1px solid rgba(168, 135, 90, 0.6);
  color: var(--cream);
  width: 44px;
  height: 44px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox button:hover { background: var(--gold); color: var(--navy-900); }
.lightbox .lb-close { top: 1rem; right: 1rem; }
.lightbox .lb-prev { left: 1rem; top: 50%; }
.lightbox .lb-next { right: 1rem; top: 50%; }

.page-hero--photo .eyebrow { color: var(--gold-light); text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6); }
.page-hero--photo .breadcrumb,
.page-hero--photo .club-type { text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6); }
.hero-tag { left: auto; right: 12px; bottom: 12px; }
