/* ============================================
   UCMS NJ — Union County Medical Society
   Design inspired by bouldermedsociety.org
   Clean, Squarespace-style layout
   ============================================ */

:root {
  --slate: #3d5a6e;
  --slate-dark: #2c4456;
  --slate-darker: #1e3244;
  --white: #ffffff;
  --off-white: #f9f9f9;
  --gray-100: #f2f2f2;
  --gray-200: #e0e0e0;
  --gray-300: #c4c4c4;
  --gray-400: #9e9e9e;
  --gray-500: #757575;
  --gray-600: #555555;
  --gray-700: #333333;
  --text: #333333;
  --text-light: #555555;
  --text-muted: #888888;
  --link: #3d5a6e;
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Open Sans', 'Segoe UI', sans-serif;
  --max-width: 1200px;
  --transition: 0.25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--white);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gray-700); }
h1, h2, h3, h4, h5 { font-family: var(--font-heading); color: var(--gray-700); line-height: 1.2; font-weight: 400; }
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
h4 { font-size: 1.15rem; font-weight: 600; font-family: var(--font-body); }
p { margin-bottom: 1rem; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 3rem; }
.text-center { text-align: center; }

/* ===== HEADER ===== */
.site-header { background: var(--white); padding: 1rem 0; position: relative; z-index: 100; }
.header-top { display: none; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.logo img { height: 65px; width: auto; }
.main-nav { display: flex; align-items: center; }
.main-nav a { padding: 0.5rem 1.1rem; font-size: 0.9rem; font-weight: 400; color: var(--gray-600); letter-spacing: 0.02em; transition: color var(--transition); }
.main-nav a:hover, .main-nav a.active { color: var(--gray-700); }
.nav-cta { display: none; }
.mobile-toggle { display: none; background: none; border: none; width: 30px; height: 24px; cursor: pointer; flex-direction: column; justify-content: space-between; }
.mobile-toggle span { display: block; width: 100%; height: 2px; background: var(--gray-700); transition: all 0.3s; }

/* ===== HERO ===== */
.hero { position: relative; min-height: 560px; display: flex; align-items: center; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center top; }
.hero-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to right, rgba(30,50,68,0.82) 0%, rgba(30,50,68,0.55) 50%, rgba(30,50,68,0.3) 100%); }
.hero .container { position: relative; z-index: 2; padding: 4rem 0; max-width: 750px; margin-left: 3rem; margin-right: auto; }
.hero-content h1 { color: var(--white); font-size: clamp(2rem, 4.5vw, 3.2rem); line-height: 1.2; font-weight: 400; margin-bottom: 0; }
.hero-image { display: none; }
.hero-buttons { display: none; }
.hero-stats { display: none; }

/* ===== MISSION BAND ===== */
.mission-band { background: var(--slate); color: var(--white); padding: 5rem 0; }
.mission-band .container { display: grid; grid-template-columns: 1fr 1.4fr; gap: 4rem; align-items: start; }
.mission-band h2 { color: var(--white); font-size: clamp(2rem, 4vw, 3rem); line-height: 1.15; }
.mission-band p { color: rgba(255,255,255,0.88); font-size: 1.05rem; line-height: 1.85; margin: 0; }

/* ===== CARDS ===== */
.cards-section { padding: 5rem 0; background: var(--white); }
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
.card { border: 1px solid var(--gray-200); text-align: center; background: var(--white); transition: border-color var(--transition); }
.card:hover { border-color: var(--gray-300); }
.card-img { width: 100%; aspect-ratio: 16/10; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1.75rem 1.5rem 2rem; }
.card-body h3 { margin-bottom: 1.25rem; color: var(--gray-700); font-size: 1.5rem; }
.card-body p { color: var(--text-light); font-size: 0.92rem; line-height: 1.7; margin-bottom: 1.5rem; }

/* ===== BUTTONS ===== */
.btn { display: inline-block; padding: 0.85rem 2rem; font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; border: none; cursor: pointer; transition: all var(--transition); text-decoration: none; line-height: 1; }
.btn-slate { background: var(--slate); color: var(--white); }
.btn-slate:hover { background: var(--slate-dark); color: var(--white); }
.btn-outline { background: transparent; color: var(--slate); border: 2px solid var(--slate); }
.btn-outline:hover { background: var(--slate); color: var(--white); }
.btn-white { background: var(--white); color: var(--slate-dark); }
.btn-white:hover { background: var(--gray-100); color: var(--slate-darker); }
.btn-lg { padding: 1rem 2.5rem; font-size: 0.9rem; }
.btn-sm { padding: 0.65rem 1.5rem; font-size: 0.8rem; }

/* Keep old class names working */
.btn-primary { background: var(--slate); color: var(--white); }
.btn-primary:hover { background: var(--slate-dark); color: var(--white); }
.btn-gold { background: var(--slate); color: var(--white); }
.btn-gold:hover { background: var(--slate-dark); color: var(--white); }
.btn-outline-white { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,0.5); }
.btn-outline-white:hover { background: var(--white); color: var(--slate-dark); }

/* ===== SECTIONS ===== */
.section-pad { padding: 5rem 0; }
.section-pad-sm { padding: 3rem 0; }
.bg-offwhite { background: var(--off-white); }
.bg-slate { background: var(--slate); color: var(--white); }
.section-label { font-family: var(--font-body); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--slate); margin-bottom: 0.5rem; }
.section-subtitle { font-size: 1.05rem; color: var(--text-light); max-width: 600px; margin: 0.75rem auto 0; line-height: 1.7; }
.gold-rule { display: none; }

/* ===== TWO-COL ===== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.two-col img { width: 100%; }

/* ===== NEWS ===== */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }
.news-card { border: 1px solid var(--gray-200); padding: 2rem; transition: border-color var(--transition); }
.news-card:hover { border-color: var(--gray-300); }
.news-date { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate); margin-bottom: 0.75rem; }
.news-card h4 { margin-bottom: 0.5rem; font-family: var(--font-heading); font-size: 1.2rem; font-weight: 400; }
.news-card p { color: var(--text-light); font-size: 0.92rem; margin-bottom: 0; }

/* ===== PHYSICIAN SEARCH ===== */
.physician-search-section { background: var(--off-white); }
.search-form-card { max-width: 900px; margin: 0 auto; border: 1px solid var(--gray-200); padding: 2.5rem; background: var(--white); }
.search-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-600); margin-bottom: 0.4rem; }
.form-control { width: 100%; padding: 0.7rem 0.9rem; font-family: var(--font-body); font-size: 0.95rem; border: 1px solid var(--gray-300); background: var(--white); color: var(--text); transition: border-color var(--transition); border-radius: 0; -webkit-appearance: none; }
.form-control:focus { outline: none; border-color: var(--slate); }
.form-divider { grid-column: 1 / -1; text-align: center; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); position: relative; padding: 0.5rem 0; }
.form-divider::before, .form-divider::after { content: ''; position: absolute; top: 50%; width: calc(50% - 1.5rem); height: 1px; background: var(--gray-200); }
.form-divider::before { left: 0; }
.form-divider::after { right: 0; }
.search-actions { grid-column: 1 / -1; display: flex; justify-content: center; gap: 1rem; margin-top: 0.5rem; }
.search-results { margin-top: 2.5rem; }
.results-count { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; }
.physician-card { border: 1px solid var(--gray-200); padding: 1.25rem 1.5rem; margin-bottom: 0.75rem; display: grid; grid-template-columns: 56px 1fr auto; gap: 1.25rem; align-items: center; transition: border-color var(--transition); }
.physician-card:hover { border-color: var(--gray-300); }
.physician-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--slate); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--white); font-weight: 600; }
.physician-info h4 { margin-bottom: 0.15rem; color: var(--gray-700); font-size: 1rem; }
.physician-specialty { font-size: 0.88rem; color: var(--slate); }
.physician-address { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.15rem; }
.physician-distance { font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; }
.empty-state { text-align: center; padding: 3rem 2rem; color: var(--text-muted); }
.empty-state-icon { font-size: 2rem; margin-bottom: 0.75rem; opacity: 0.5; }

/* ===== OFFICERS ===== */
.officers-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; }
.officer-card { text-align: center; padding: 2rem 1.25rem; border: 1px solid var(--gray-200); }
.officer-avatar { width: 80px; height: 80px; border-radius: 50%; background: var(--slate); margin: 0 auto 1.25rem; display: flex; align-items: center; justify-content: center; color: var(--white); font-family: var(--font-heading); font-size: 1.4rem; }
.officer-card h4 { margin-bottom: 0.2rem; }
.officer-role { font-size: 0.78rem; color: var(--slate); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }

/* ===== BENEFITS ===== */
.benefits-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.benefit-item { display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem; border: 1px solid var(--gray-200); }
.benefit-icon { flex-shrink: 0; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.benefit-item h4 { font-size: 0.95rem; margin-bottom: 0.2rem; }
.benefit-item p { font-size: 0.88rem; color: var(--text-light); margin: 0; }

/* ===== CONTACT ===== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; }
.contact-info-item { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.5rem; }
.contact-info-icon { font-size: 1.2rem; margin-top: 0.15rem; }
.contact-info-item h4 { font-size: 0.9rem; margin-bottom: 0.1rem; }
.contact-info-item p { color: var(--text-light); font-size: 0.88rem; margin: 0; }
.contact-form .form-group { margin-bottom: 1.25rem; }
.contact-form textarea.form-control { min-height: 130px; resize: vertical; }

/* ===== PAGE HEADER ===== */
.page-header { background: var(--slate-darker); padding: 4rem 0 3.5rem; color: var(--white); }
.page-header h1 { color: var(--white); margin-bottom: 0.5rem; }
.page-header p { color: rgba(255,255,255,0.7); font-size: 1.05rem; margin: 0; }
.breadcrumb { font-size: 0.82rem; color: rgba(255,255,255,0.45); margin-bottom: 0.75rem; }
.breadcrumb a { color: rgba(255,255,255,0.45); }
.breadcrumb a:hover { color: rgba(255,255,255,0.8); }

/* ===== TIMELINE ===== */
.history-timeline { position: relative; max-width: 800px; margin: 0 auto; padding-left: 3rem; }
.history-timeline::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--gray-200); }
.timeline-item { position: relative; margin-bottom: 2.5rem; }
.timeline-item::before { content: ''; position: absolute; left: -3rem; top: 0.4rem; width: 10px; height: 10px; border-radius: 50%; background: var(--slate); border: 3px solid var(--white); box-shadow: 0 0 0 2px var(--slate); transform: translateX(-4px); }
.timeline-year { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 600; color: var(--gray-700); margin-bottom: 0.3rem; }
.timeline-item p { color: var(--text-light); font-size: 0.95rem; margin: 0; }

/* ===== GALLERY ===== */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.gallery-item { overflow: hidden; aspect-ratio: 4/3; border: 1px solid var(--gray-200); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.gallery-item:hover img { transform: scale(1.05); }

/* ===== CTA BAND ===== */
.cta-banner { background: var(--slate); padding: 5rem 0; text-align: center; color: var(--white); }
.cta-banner h2 { color: var(--white); margin-bottom: 1rem; }
.cta-banner p { color: rgba(255,255,255,0.85); font-size: 1.1rem; margin-bottom: 2rem; max-width: 600px; margin-left: auto; margin-right: auto; }

/* ===== NEWSLETTER ===== */
.newsletter-form { display: flex; gap: 0; max-width: 440px; }
.newsletter-form input { flex: 1; border-right: none; }
.newsletter-form .btn { white-space: nowrap; }

/* ===== FOOTER ===== */
.site-footer { background: var(--slate-darker); color: rgba(255,255,255,0.75); padding: 4rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 3rem; align-items: start; margin-bottom: 2.5rem; }
.footer-brand { font-size: 0.88rem; line-height: 1.8; }
.footer-brand strong { color: var(--white); display: block; margin-bottom: 0.25rem; }
.footer-brand img { height: 70px; margin: 0 auto 1rem; background: white; padding: 6px 10px; }
.footer-brand p { font-size: 0.88rem; }
.footer-heading { font-family: var(--font-body); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-bottom: 1rem; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.35rem; font-size: 0.88rem; }
.footer-links a { color: rgba(255,255,255,0.65); }
.footer-links a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.5rem; display: flex; justify-content: center; gap: 2rem; font-size: 0.8rem; color: rgba(255,255,255,0.35); }
.footer-bottom a { color: rgba(255,255,255,0.45); }
.footer-bottom a:hover { color: var(--white); }

/* ===== ADMIN ===== */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--slate-darker); color: var(--white); padding: 2rem 0; }
.admin-sidebar .logo { padding: 0 1.5rem; margin-bottom: 2rem; }
.admin-sidebar .logo img { height: 40px; filter: brightness(10); }
.admin-nav { list-style: none; }
.admin-nav a { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 1.5rem; color: rgba(255,255,255,0.55); font-size: 0.88rem; transition: all var(--transition); }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,0.08); color: var(--white); }
.admin-main { background: var(--off-white); padding: 2rem; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.admin-card { background: var(--white); border: 1px solid var(--gray-200); }
.admin-card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-200); display: flex; justify-content: space-between; align-items: center; }
.admin-card-header h3 { font-size: 1rem; margin: 0; font-family: var(--font-body); }
.admin-card-body { padding: 1.5rem; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; padding: 0.7rem 1rem; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); border-bottom: 2px solid var(--gray-200); }
.admin-table td { padding: 0.8rem 1rem; font-size: 0.88rem; border-bottom: 1px solid var(--gray-100); }
.admin-table tr:hover td { background: var(--off-white); }
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 3px; font-size: 0.72rem; font-weight: 600; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.stat-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card-admin { background: var(--white); padding: 1.5rem; border: 1px solid var(--gray-200); }
.stat-number { font-family: var(--font-heading); font-size: 2rem; color: var(--gray-700); line-height: 1; margin-bottom: 0.25rem; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }
.edit-actions { display: flex; gap: 0.4rem; }
.btn-icon { background: none; border: 1px solid var(--gray-200); padding: 0.35rem 0.5rem; cursor: pointer; font-size: 0.82rem; transition: all var(--transition); }
.btn-icon:hover { background: var(--gray-100); }
.btn-icon.danger:hover { background: #fef2f2; border-color: #fca5a5; }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(30,50,68,0.5); backdrop-filter: blur(3px); z-index: 2000; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: all 0.2s; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal { background: var(--white); box-shadow: 0 16px 48px rgba(0,0,0,0.15); width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto; transform: translateY(16px); transition: transform 0.2s; }
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 1.75rem; border-bottom: 1px solid var(--gray-200); }
.modal-header h3 { margin: 0; font-family: var(--font-body); font-size: 1rem; }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--gray-400); }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.75rem; }
.modal-footer { padding: 1rem 1.75rem; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 0.75rem; }

.loading-spinner { display: inline-block; width: 28px; height: 28px; border: 3px solid var(--gray-200); border-top-color: var(--slate); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .container { padding: 0 2rem; }
  .hero .container { margin-left: 2rem; }
  .mission-band .container { grid-template-columns: 1fr; gap: 1.5rem; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
  .two-col { grid-template-columns: 1fr; gap: 2rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; text-align: center; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .main-nav { display: none; }
  .mobile-toggle { display: flex; }
  .main-nav.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--white); box-shadow: 0 8px 24px rgba(0,0,0,0.08); padding: 1rem 0; z-index: 999; }
  .main-nav.open a { padding: 0.65rem 2rem; }
  .hero { min-height: 400px; }
  .hero .container { margin-left: auto; padding: 3rem 2rem; }
  .hero-content h1 { font-size: 2rem; }
  .cards-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
  .search-form-grid { grid-template-columns: 1fr; }
  .officers-grid { grid-template-columns: repeat(2, 1fr); }
  .benefits-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; }
  .section-pad { padding: 3.5rem 0; }
  .mission-band { padding: 3.5rem 0; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .physician-card { grid-template-columns: 1fr; }
  .physician-avatar { display: none; }
}
@media (max-width: 480px) {
  .container { padding: 0 1.25rem; }
  .officers-grid { grid-template-columns: 1fr; }
  .newsletter-form { flex-direction: column; }
  .newsletter-form input { border-right: 1px solid var(--gray-300); }
}
