/* === Oahu Golf Courses Portal — v1.0 === */
/* Smartgolfcourses Design System              */

:root {
  --primary: #1B3A2F;
  --primary-darker: #0F2620;
  --gold: #C9A84C;
  --orange: #FF6800;
  --bg: #F7F3EC;
  --white: #FFFFFF;
  --text: #1A1A1A;
  --text-light: #F0EDE8;
  --border: rgba(0, 0, 0, 0.08);
  --muted: #6b6b6b;
}

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

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.serif { font-family: 'Playfair Display', Georgia, serif; }

/* === TOPBAR === */
.topbar {
  background: var(--primary);
  color: var(--text-light);
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  position: sticky; top: 0; z-index: 100;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo-circle {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: 'Playfair Display', serif; font-size: 16px; }
.brand-text span { font-size: 11px; opacity: 0.75; letter-spacing: 0.08em; text-transform: uppercase; }
.topnav { display: flex; gap: 24px; }
.topnav a {
  color: var(--text-light); text-decoration: none; font-size: 14px;
  opacity: 0.85; transition: opacity 0.2s;
}
.topnav a:hover { opacity: 1; }

/* === LAYOUT === */
.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 64px);
}

/* === SIDEBAR === */
.sidebar {
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  overflow-y: auto;
}
.search-box input {
  width: 100%; padding: 10px 12px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--white); font-family: inherit;
}
.filter-group { margin-top: 22px; }
.filter-group h4 {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: 8px;
}
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  background: var(--white); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 999px; font-size: 12px;
  cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.pill:hover { border-color: var(--primary); }
.pill.active {
  background: var(--primary); color: var(--white); border-color: var(--primary);
}

.course-list { margin-top: 26px; }
.course-list ul { list-style: none; }
.course-list li {
  padding: 10px 12px; cursor: pointer;
  border-radius: 6px; margin-bottom: 2px;
  border-left: 3px solid transparent;
  transition: background 0.12s;
}
.course-list li:hover { background: rgba(0,0,0,0.04); }
.course-list li.active {
  background: var(--white); border-left-color: var(--gold);
}
.course-list li .name { font-size: 13px; font-weight: 500; }
.course-list li .meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 3px; font-size: 11px;
}
.cat-badge {
  padding: 2px 7px; border-radius: 4px; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;
}
.cat-Public      { background: #E1F5EE; color: #0F6E56; }
.cat-Private     { background: #EEEDFE; color: #3C3489; }
.cat-Resort      { background: #FAEEDA; color: #633806; }
.cat-Municipal   { background: #E6F1FB; color: #0C447C; }
.cat-Military    { background: #FCEBEB; color: #791F1F; }
.cat-Semi-Private{ background: #F1EFE8; color: #444441; }
.stars { color: var(--gold); letter-spacing: -1px; }

/* === MAIN === */
.main { padding: 0; background: var(--bg); }
.loading { padding: 40px; color: var(--muted); }

.hero {
  background: var(--primary);
  color: var(--text-light);
  padding: 32px 40px 28px;
}
.hero .region {
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); font-weight: 600;
}
.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: 38px; font-weight: 600; margin: 6px 0 4px;
}
.hero .address { font-size: 14px; opacity: 0.85; margin-bottom: 14px; }
.hero .badges { display: flex; gap: 8px; flex-wrap: wrap; }
.hero .badge {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 5px 12px; border-radius: 999px; font-size: 12px;
}
.hero .badge.gold { background: var(--gold); color: var(--primary); border: none; font-weight: 600; }
.hero .badge.open { background: #21A179; color: white; border: none; font-weight: 500; }
.hero .badge.closed { background: #6b6b6b; color: white; border: none; font-style: italic; }

.stats-bar {
  display: grid; grid-template-columns: repeat(6, 1fr);
  background: var(--bg); padding: 22px 40px;
  border-bottom: 1px solid var(--border);
}
.stat .value { font-size: 22px; font-weight: 600; font-family: 'Playfair Display', serif; }
.stat .label { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }

.section {
  padding: 26px 40px;
  border-bottom: 1px solid var(--border);
}
.section h3 {
  font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--primary); font-weight: 600; margin-bottom: 14px;
}
.section h3::before {
  content: '●'; color: var(--orange); margin-right: 8px; font-size: 8px;
  vertical-align: middle;
}
.two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
}
.detail-row {
  display: grid; grid-template-columns: 110px 1fr;
  padding: 7px 0; font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border: none; }
.detail-row .key { color: var(--muted); font-size: 12px; }

.about-text { font-size: 15px; line-height: 1.75; color: var(--text); }

.facts-section {
  border-left: 4px solid var(--orange);
  background: rgba(255, 104, 0, 0.03);
  margin: 0 40px;
  padding: 22px 28px;
  border-radius: 0 8px 8px 0;
}
.facts-section h3 { color: var(--orange); }
.facts-section h3::before { display: none; }
.fact-card {
  margin-bottom: 16px; padding-bottom: 14px;
  border-bottom: 1px dashed rgba(255,104,0,0.2);
}
.fact-card:last-child { border: none; margin-bottom: 0; padding-bottom: 0; }
.fact-card .title { font-weight: 600; margin-bottom: 5px; font-size: 14px; }
.fact-card .body { font-size: 14px; color: var(--text); line-height: 1.6; }
.fact-card .src { font-size: 9px; color: var(--muted); margin-top: 4px; }

.source-cite { font-size: 9px; color: var(--muted); margin-top: 10px; opacity: 0.7; }

.map-placeholder {
  width: 100%; height: 280px; background: #d9d9d9;
  display: grid; place-items: center;
  border-radius: 8px; color: #666; font-size: 13px;
  text-decoration: none;
}

.map-embed {
  width: 100%; height: 280px; border: 0;
  border-radius: 8px; display: block;
}
.map-link {
  display: inline-block; margin-top: 8px; font-size: 12px;
  color: var(--orange); text-decoration: none;
}
.map-link:hover { text-decoration: underline; }

/* === Map View page === */
.map-view-page {
  padding: 0; background: var(--bg);
}
.map-view-page .map-hero {
  background: var(--primary); color: var(--text-light);
  padding: 28px 40px;
}
.map-view-page .map-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: 32px; font-weight: 600;
}
.map-view-page .map-hero p {
  font-size: 14px; opacity: 0.85; margin-top: 4px;
}
.map-view-full {
  width: 100%; height: calc(100vh - 290px); border: 0;
  display: block;
}
.external-map-link {
  display: block;
  text-align: center;
  padding: 16px;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--orange);
  text-decoration: none;
}
.external-map-link:hover { text-decoration: underline; }

/* Location section (last block on course page) */
.location-section .location-address {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 14px;
}

/* === Stat highlighted in orange (per Brand Bible) === */
.stats-bar .stat.is-highlight .value {
  color: var(--orange);
}

/* === Media gallery (Block 6) === */
.media-gallery { position: relative; width: 100%; margin-top: 6px; }
.media-frame {
  position: relative; width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 8px; overflow: hidden;
  background: #000;
}
.media-track {
  display: flex; height: 100%;
  transition: transform 0.35s ease;
  will-change: transform;
}
.media-slide {
  flex: 0 0 100%; width: 100%; height: 100%;
  position: relative;
}
.media-slide img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.media-slide video {
  width: 100%; height: 100%;
  object-fit: contain; background: #000; display: block;
}
.media-nav-prev,
.media-nav-next {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 0; cursor: pointer;
  display: grid; place-items: center;
  font-size: 22px; line-height: 1;
  color: var(--primary);
  z-index: 2;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.media-nav-prev { left: 12px; }
.media-nav-next { right: 12px; }
.media-nav-prev:hover,
.media-nav-next:hover {
  background: var(--orange); color: #fff;
}
.media-dots {
  display: flex; justify-content: center; gap: 8px;
  margin-top: 12px;
}
.media-dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  border: 0; padding: 0; cursor: pointer;
  transition: background 0.15s;
}
.media-dot:hover { background: rgba(0, 0, 0, 0.4); }
.media-dot[aria-current="true"] { background: var(--orange); }
.media-caption {
  font-size: 13px; color: var(--muted);
  margin-top: 12px; text-align: center;
  min-height: 18px;
}

/* === Mobile drawer machinery (hidden on desktop) === */
.hamburger { display: none; }
.drawer-backdrop { display: none; }
.sidebar-header { display: none; }
.sidebar-nav { display: none; }
.map-page-drawer { display: none; }

/* === MOBILE (< 768px) === */
@media (max-width: 767px) {
  /* Topbar collapsed */
  .topbar { padding: 10px 14px; }
  .logo-circle { width: 32px; height: 32px; }
  .brand { gap: 8px; }
  .brand-text strong { font-size: 14px; }
  .brand-text span { display: none; }
  .topnav { display: none; }

  /* Hamburger */
  .hamburger {
    display: inline-flex; flex-direction: column;
    justify-content: center; gap: 4px;
    width: 40px; height: 40px;
    background: transparent; border: 0;
    padding: 0; cursor: pointer;
    margin-left: auto;
  }
  .hamburger span {
    display: block; width: 22px; height: 2px;
    background: var(--text-light); border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
  }
  body.drawer-open .hamburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  body.drawer-open .hamburger span:nth-child(2) { opacity: 0; }
  body.drawer-open .hamburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  /* Layout single col */
  .layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  /* Sidebar → off-canvas drawer */
  .sidebar {
    position: fixed; top: 0; left: 0;
    width: 80vw; max-width: 320px; height: 100vh;
    z-index: 200;
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    box-shadow: 2px 0 24px rgba(0, 0, 0, 0.18);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.drawer-open .sidebar { transform: translateX(0); }
  /* Map page drawer participates in mobile only */
  .map-page-drawer { display: block; }

  /* Sidebar header (close button) */
  .sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 14px; margin-bottom: 6px;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-header-title {
    font-family: 'Playfair Display', serif;
    font-size: 16px; font-weight: 600; color: var(--primary);
  }
  .drawer-close {
    background: transparent; border: 0;
    width: 36px; height: 36px;
    font-size: 28px; line-height: 1;
    color: var(--primary); cursor: pointer;
    display: grid; place-items: center;
    border-radius: 6px;
  }
  .drawer-close:hover { background: rgba(0,0,0,0.05); }

  /* Sidebar nav (replicates topnav inside drawer) */
  .sidebar-nav {
    display: flex; flex-direction: column;
    gap: 2px; margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-nav a {
    color: var(--text); text-decoration: none;
    font-size: 14px; padding: 10px 8px;
    border-radius: 6px;
    transition: background 0.12s;
  }
  .sidebar-nav a:hover { background: rgba(0,0,0,0.04); }

  /* Backdrop */
  .drawer-backdrop {
    display: block;
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0; pointer-events: none;
    transition: opacity 0.28s ease;
    z-index: 150;
  }
  body.drawer-open .drawer-backdrop {
    opacity: 1; pointer-events: auto;
  }
  body.drawer-open { overflow: hidden; }

  /* Hero */
  .hero { padding: 24px 18px 22px; }
  .hero h1 { font-size: 28px; line-height: 1.15; }
  .hero .address { font-size: 13px; }
  .hero .region { font-size: 11px; }

  /* Stats bar 3x2 */
  .stats-bar {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px 8px;
    padding: 18px 18px;
  }
  .stat .value { font-size: 20px; }

  /* Sections */
  .section { padding: 22px 18px; }
  .two-col { grid-template-columns: 1fr; gap: 22px; }
  .detail-row { grid-template-columns: 90px 1fr; font-size: 13px; }

  .facts-section {
    margin: 0 18px; padding: 18px 16px;
  }

  /* Map embeds full width, slightly shorter */
  .map-embed { height: 240px; }

  /* Carousel — smaller arrows for mobile aesthetics */
  .media-nav-prev, .media-nav-next {
    width: 32px; height: 32px;
    font-size: 18px;
  }
  .media-nav-prev { left: 8px; }
  .media-nav-next { right: 8px; }

  /* Map View page */
  .map-view-page .map-hero { padding: 22px 18px; }
  .map-view-page .map-hero h1 { font-size: 24px; }
  .map-view-full { height: calc(100vh - 230px); }
  .external-map-link { padding: 14px; font-size: 13px; }
}
