/* ============================================================
   GolfCourses.io — Main Stylesheet
   Design: Refined luxury, deep greens, cream whites, gold accents
   Fonts: Playfair Display (headings) + DM Sans (body)
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  color: #1a1a1a;
  background: #ffffff;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* --- CSS Variables --- */
:root {
  --green-dark:  #1a3d2b;
  --green-mid:   #2d6a4f;
  --green-accent:#3a8c62;
  --green-light: #52b788;
  --green-pale:  #d8f3dc;
  --gold:        #c9a84c;
  --cream:       #f9f6ef;
  --white:       #ffffff;
  --grey-bg:     #f5f5f1;
  --grey-border: #e2e2da;
  --grey-text:   #6b7280;
  --text-dark:   #111827;
  --text-body:   #374151;
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:   0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg:   0 12px 40px rgba(0,0,0,.12);
  --transition:  0.22s ease;
}

/* --- Typography --- */
h1, h2, h3, h4, h5 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-dark);
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; font-family: 'DM Sans', sans-serif; font-weight: 600; }

.section-label {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--green-accent);
  margin-bottom: .75rem;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.container--narrow { max-width: 800px; }

section { padding: 4rem 0; }
.section-head { text-align: center; margin-bottom: 2.5rem; }
.section-head p { color: var(--grey-text); margin-top: .5rem; font-size: 1.05rem; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--green-mid);
  color: var(--white);
  border-color: var(--green-mid);
}
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }

.btn-outline {
  background: transparent;
  color: var(--green-mid);
  border-color: var(--green-mid);
}
.btn-outline:hover { background: var(--green-mid); color: var(--white); }

.btn-gold {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}
.btn-gold:hover { background: #b8922e; border-color: #b8922e; }

.btn-ghost {
  background: rgba(255,255,255,.12);
  color: var(--white);
  border-color: rgba(255,255,255,.35);
}
.btn-ghost:hover { background: rgba(255,255,255,.22); }

.btn-sm { padding: .4rem .9rem; font-size: .82rem; }
.btn-lg { padding: .85rem 2rem; font-size: 1rem; }

.btn-icon { padding: .5rem .75rem; }

/* --- Site Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--green-dark);
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: var(--white);
  flex-shrink: 0;
}
.logo-icon { font-size: 1.5rem; }

.site-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
}
.site-nav a {
  color: rgba(255,255,255,.82);
  font-size: .88rem;
  font-weight: 500;
  padding: .45rem .75rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.site-nav a:hover,
.site-nav a.active { color: var(--white); background: rgba(255,255,255,.12); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: .4rem;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 60%, #3a7a58 100%);
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; text-align: center; color: var(--white); }
.hero h1 { color: var(--white); margin-bottom: .5rem; }
.hero p {
  font-size: 1.15rem;
  color: rgba(255,255,255,.8);
  margin-bottom: 2.5rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* Search bar */
.search-bar {
  display: flex;
  max-width: 680px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  padding: 1rem 1.25rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-dark);
}
.search-bar select {
  border: none;
  outline: none;
  border-left: 1px solid var(--grey-border);
  padding: .5rem 1rem;
  font-family: inherit;
  font-size: .9rem;
  color: var(--grey-text);
  background: var(--white);
  cursor: pointer;
  max-width: 160px;
}
.search-bar button {
  background: var(--green-mid);
  color: var(--white);
  border: none;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  transition: background var(--transition);
  white-space: nowrap;
}
.search-bar button:hover { background: var(--green-dark); }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat strong {
  display: block;
  font-size: 1.6rem;
  font-family: 'Playfair Display', serif;
  color: var(--white);
}
.hero-stat span {
  font-size: .82rem;
  color: rgba(255,255,255,.65);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* --- Course Cards --- */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.course-card {
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}
.course-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.course-card .badge-featured {
  position: absolute;
  top: .9rem;
  right: .9rem;
  background: var(--gold);
  color: var(--white);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .25rem .6rem;
  border-radius: 20px;
}
.card-type {
  font-size: .75rem;
  font-weight: 500;
  color: var(--green-accent);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .4rem;
}
.card-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: .5rem;
  line-height: 1.3;
}
.card-name a { color: inherit; }
.card-name a:hover { color: var(--green-mid); }
.card-address {
  font-size: .87rem;
  color: var(--grey-text);
  margin-bottom: .75rem;
  display: flex;
  gap: .3rem;
  align-items: flex-start;
  flex: 1;
}
.card-region {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .78rem;
  background: var(--green-pale);
  color: var(--green-mid);
  padding: .2rem .6rem;
  border-radius: 20px;
  margin-bottom: .9rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px solid var(--grey-border);
}

/* --- Directory page --- */
.directory-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}
.filter-sidebar {
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: sticky;
  top: 80px;
}
.filter-sidebar h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-dark);
}
.filter-group { margin-bottom: 1.25rem; }
.filter-group label {
  display: block;
  font-size: .83rem;
  font-weight: 500;
  color: var(--text-body);
  margin-bottom: .4rem;
}
.filter-group select,
.filter-group input {
  width: 100%;
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-sm);
  padding: .55rem .75rem;
  font-family: inherit;
  font-size: .9rem;
  color: var(--text-dark);
  background: var(--white);
  transition: border-color var(--transition);
}
.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--green-accent);
}

.directory-list { display: flex; flex-direction: column; gap: 1rem; }

.list-card {
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  transition: box-shadow var(--transition);
  position: relative;
}
.list-card:hover { box-shadow: var(--shadow-md); }
.list-card .card-meta {
  flex: 1;
  min-width: 0;
}
.list-card .card-map-btn {
  flex-shrink: 0;
}

/* --- Course detail page --- */
.course-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}
.course-main {}
.course-sidebar { position: sticky; top: 80px; }

.course-header {
  background: var(--green-dark);
  color: var(--white);
  padding: 2.5rem 0;
}
.course-header h1 { color: var(--white); margin-bottom: .5rem; }
.course-header .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  margin-top: .75rem;
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.9);
  font-size: .83rem;
  padding: .3rem .75rem;
  border-radius: 20px;
}

.info-card {
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.info-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--grey-border);
}
.info-row {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  margin-bottom: .75rem;
  font-size: .92rem;
}
.info-row:last-child { margin-bottom: 0; }
.info-icon { color: var(--green-accent); flex-shrink: 0; margin-top: .1rem; }
.info-label { font-weight: 500; color: var(--grey-text); min-width: 80px; font-size: .82rem; }

.action-buttons { display: flex; flex-direction: column; gap: .6rem; }
.action-buttons .btn { justify-content: center; }

/* --- Map container --- */
.map-container {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--grey-border);
  margin-bottom: 1.5rem;
}
.map-container iframe { display: block; width: 100%; }

/* --- Nearby courses --- */
.nearby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .4rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  border: 1px solid var(--grey-border);
  background: var(--white);
  color: var(--text-body);
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--green-accent); color: var(--green-accent); }
.page-btn.active { background: var(--green-mid); border-color: var(--green-mid); color: var(--white); font-weight: 600; }
.page-btn.disabled { opacity: .4; pointer-events: none; }

/* --- Advert slots --- */
.advert-slot {
  background: var(--grey-bg);
  border: 1px dashed var(--grey-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-align: center;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.advert-slot img { max-height: 250px; width: 100%; object-fit: cover; }
.advert-home_top,
.advert-directory_top { margin-bottom: 1.5rem; }
.advert-home_middle { margin: 2rem 0; }
.advert-directory_inline { margin: 1rem 0; }
.advert-footer { margin-bottom: 0; border-radius: 0; }

/* --- Region tiles --- */
.region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}
.region-tile {
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  text-align: center;
  transition: all var(--transition);
}
.region-tile:hover {
  border-color: var(--green-accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.region-tile .flag { font-size: 2rem; margin-bottom: .5rem; }
.region-tile strong { display: block; font-size: .92rem; font-weight: 600; color: var(--text-dark); }
.region-tile span { font-size: .78rem; color: var(--grey-text); }

/* --- Claim CTA Banner --- */
.claim-banner {
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  color: var(--white);
  padding: 3rem 0;
  text-align: center;
}
.claim-banner h2 { color: var(--white); margin-bottom: .75rem; }
.claim-banner p { color: rgba(255,255,255,.8); margin-bottom: 1.5rem; max-width: 540px; margin-left: auto; margin-right: auto; }

/* --- Forms (public) --- */
.form-card {
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-md);
  padding: 2rem;
}
.form-row { margin-bottom: 1.25rem; }
.form-row label {
  display: block;
  font-size: .88rem;
  font-weight: 500;
  margin-bottom: .4rem;
  color: var(--text-body);
}
.form-row input,
.form-row textarea,
.form-row select {
  width: 100%;
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-sm);
  padding: .65rem .9rem;
  font-family: inherit;
  font-size: .95rem;
  color: var(--text-dark);
  background: var(--white);
  transition: border-color var(--transition);
}
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--green-accent);
  box-shadow: 0 0 0 3px rgba(58,140,98,.12);
}
.form-row textarea { resize: vertical; min-height: 120px; }

/* --- Alerts --- */
.alert {
  padding: .9rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  margin-bottom: 1rem;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* --- Page hero (inner pages) --- */
.page-hero {
  background: var(--grey-bg);
  border-bottom: 1px solid var(--grey-border);
  padding: 2.5rem 0;
}
.page-hero h1 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin-bottom: .4rem; }
.page-hero p { color: var(--grey-text); }
.breadcrumb {
  font-size: .82rem;
  color: var(--grey-text);
  margin-bottom: .6rem;
}
.breadcrumb a { color: var(--green-accent); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 .35rem; }

/* --- Footer --- */
.site-footer {
  background: var(--green-dark);
  color: rgba(255,255,255,.75);
  padding: 3rem 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2.5rem;
}
.footer-brand .site-logo { color: var(--white); margin-bottom: .75rem; }
.footer-brand p { font-size: .88rem; max-width: 280px; line-height: 1.6; }
.footer-links h4 {
  color: var(--white);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  font-family: 'DM Sans', sans-serif;
}
.footer-links a {
  display: block;
  font-size: .87rem;
  color: rgba(255,255,255,.65);
  margin-bottom: .5rem;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 1.25rem 0;
  text-align: center;
  font-size: .82rem;
}

/* --- Utility --- */
.bg-cream { background: var(--cream); }
.bg-grey  { background: var(--grey-bg); }
.bg-green { background: var(--green-dark); color: var(--white); }
.text-center { text-align: center; }
.text-muted { color: var(--grey-text); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.d-flex { display: flex; }
.gap-1 { gap: .5rem; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }
.no-results {
  text-align: center;
  padding: 3rem;
  color: var(--grey-text);
}
.no-results .icon { font-size: 3rem; margin-bottom: 1rem; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .directory-layout { grid-template-columns: 1fr; }
  .filter-sidebar { position: static; }
  .course-layout { grid-template-columns: 1fr; }
  .course-sidebar { position: static; order: -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  section { padding: 2.5rem 0; }
  .hero { padding: 3rem 0 2.5rem; }
  .search-bar { flex-direction: column; border-radius: var(--radius-md); }
  .search-bar input { border-radius: var(--radius-md) var(--radius-md) 0 0; }
  .search-bar select { border-left: none; border-top: 1px solid var(--grey-border); max-width: 100%; }
  .search-bar button { border-radius: 0 0 var(--radius-md) var(--radius-md); width: 100%; padding: .9rem; }
  .hero-stats { gap: 1.5rem; }
  .courses-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .site-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--green-dark);
    padding: 1rem;
    gap: .25rem;
    z-index: 999;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: .65rem 1rem; }
  .nav-toggle { display: flex; }
  .list-card { flex-direction: column; }
  .page-hero { padding: 1.75rem 0; }
}

@media (max-width: 480px) {
  .region-grid { grid-template-columns: repeat(2, 1fr); }
  .courses-grid { grid-template-columns: 1fr; }
  .card-actions { flex-direction: column; }
  .card-actions .btn { width: 100%; justify-content: center; }
}

/* --- Recently viewed bar --- */
.recently-viewed {
  background: var(--grey-bg);
  border-top: 1px solid var(--grey-border);
  padding: 1.25rem 0;
}
.recently-viewed h4 {
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--grey-text);
  margin-bottom: .75rem;
}
.recent-list {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}
.recent-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: 20px;
  padding: .3rem .8rem;
  font-size: .82rem;
  color: var(--text-body);
  transition: all var(--transition);
}
.recent-chip:hover { border-color: var(--green-accent); color: var(--green-accent); }

/* Share toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--green-dark);
  color: var(--white);
  padding: .75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transform: translateY(80px);
  opacity: 0;
  transition: all .3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ============================================================
   Share Modal
   ============================================================ */
.share-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(3px);
}
.share-modal-overlay.open { display: flex; }

.share-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 2rem 1.75rem 1.75rem;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalIn .22s ease;
}
@keyframes modalIn {
  from { opacity:0; transform: translateY(16px) scale(.97); }
  to   { opacity:1; transform: translateY(0)    scale(1); }
}

.share-modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: var(--grey-bg);
  border: 1px solid var(--grey-border);
  border-radius: 50%;
  width: 32px; height: 32px;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--grey-text);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.share-modal-close:hover { background: var(--grey-border); color: var(--text-dark); }

/* OG preview image */
.share-preview {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.25rem;
  border: 1px solid var(--grey-border);
  background: var(--grey-bg);
  aspect-ratio: 1200/630;
}
.share-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.share-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: .2rem;
  text-align: center;
  color: var(--text-dark);
}
.share-subtitle {
  font-size: .85rem;
  color: var(--grey-text);
  text-align: center;
  margin-bottom: 1.25rem;
}

/* Social share buttons */
.share-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
  margin-bottom: 1.25rem;
}
.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  color: var(--white);
  transition: opacity var(--transition), transform .15s;
  border: none;
}
.share-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.share-btn:hover { opacity: .88; transform: translateY(-1px); }
.share-btn:active { transform: translateY(0); }

.share-whatsapp  { background: #25D366; }
.share-facebook  { background: #1877F2; }
.share-twitter   { background: #000000; }
.share-email     { background: var(--green-mid); }

/* Copy link row */
.share-copy-row {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.share-copy-row input {
  flex: 1;
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
  font-size: .83rem;
  color: var(--grey-text);
  background: var(--grey-bg);
  font-family: monospace;
  min-width: 0;
}

@media (max-width: 480px) {
  .share-buttons { grid-template-columns: 1fr 1fr; }
  .share-modal { padding: 1.5rem 1.25rem; }
}

/* ============================================================
   Share Modal — Mobile fixes
   ============================================================ */

/* On mobile, slide up from bottom like a native sheet */
@media (max-width: 600px) {
  .share-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .share-modal {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-width: 100%;
    padding: 1.5rem 1.25rem 2rem;
    /* Prevent the modal itself from causing scroll lock freeze */
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
    max-height: 92vh;
    animation: modalSlideUp .25s ease;
  }
  @keyframes modalSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .share-preview {
    /* Smaller preview on phones */
    max-height: 160px;
    overflow: hidden;
  }
  .share-buttons {
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
  }
  .share-btn {
    font-size: .82rem;
    padding: .6rem .5rem;
  }
}

/* iOS copy input fix */
.share-copy-row input {
  -webkit-user-select: all;
  user-select: all;
  /* Prevent iOS zoom on focus */
  font-size: 16px;
}
