/* ============================================================
   Grundejerforeningen Espedammen – Main Stylesheet
   ============================================================ */

/* --- Variables & Reset ------------------------------------ */
:root {
  --primary:        #2E7D32;
  --primary-dark:   #1B5E20;
  --primary-light:  #4CAF50;
  --primary-soft:   #E8F5E9;
  --accent:         #F9A825;
  --accent-soft:    #FFF8E1;
  --text:           #212529;
  --text-muted:     #6c757d;
  --bg-light:       #F8FAF8;
  --card-shadow:    0 2px 16px rgba(46,125,50,.09);
  --radius-lg:      1rem;
  --radius-xl:      1.5rem;
}

/* Bootstrap primary override */
.bg-primary        { background-color: var(--primary) !important; }
.btn-primary       { background-color: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background-color: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background-color: var(--primary); border-color: var(--primary); color: #fff; }
.text-primary      { color: var(--primary) !important; }
.border-primary    { border-color: var(--primary) !important; }
.badge.bg-primary  { background-color: var(--primary) !important; }
.alert-primary     { background-color: var(--primary-soft); border-color: #a5d6a7; color: var(--primary-dark); }
.alert-primary a   { color: var(--primary-dark); }
.form-control:focus, .form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 .25rem rgba(46,125,50,.15);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: .9375rem;
  color: var(--text);
  background-color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main, section { flex: 1; }

/* --- Utility ------------------------------------------------ */
.bg-primary-soft  { background-color: var(--primary-soft) !important; }
.text-accent      { color: var(--accent) !important; }
.bg-accent        { background-color: var(--accent) !important; }
.text-white-75    { color: rgba(255,255,255,.75); }
.min-vh-75        { min-height: 75vh; }
.min-width-0      { min-width: 0; }

/* --- Navbar ------------------------------------------------- */
.navbar {
  background-color: var(--primary) !important;
  padding: .75rem 0;
}
.navbar-brand { font-size: 1.2rem; letter-spacing: -.3px; }
.navbar-dark .navbar-nav .nav-link {
  color: rgba(255,255,255,.85);
  font-size: .875rem;
  font-weight: 500;
  padding: .5rem .75rem;
  border-radius: .5rem;
  transition: background .15s, color .15s;
}
.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.12);
}
.dropdown-menu {
  border: 0;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  border-radius: var(--radius-lg);
  padding: .5rem;
}
.dropdown-item {
  border-radius: .5rem;
  font-size: .875rem;
  padding: .5rem .75rem;
}
.dropdown-item:hover { background-color: var(--primary-soft); color: var(--primary-dark); }

/* --- Hero Section ------------------------------------------ */
.hero-section {
  position: relative;
  min-height: 75vh;
  display: flex;
  align-items: center;
  background:
    linear-gradient(160deg, rgba(27,94,32,.92) 0%, rgba(46,125,50,.85) 50%, rgba(27,94,32,.95) 100%),
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,.02) 0px,
      rgba(255,255,255,.02) 1px,
      transparent 1px,
      transparent 12px
    );
  background-color: var(--primary-dark);
  padding: 5rem 0;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 80% 50%, rgba(76,175,80,.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(249,168,37,.08) 0%, transparent 60%);
  pointer-events: none;
}
.hero-overlay { display: none; }
.hero-section--compact {
  min-height: auto;
  padding: 4rem 0;
}

/* --- Homepage info sections ------------------------------ */
.info-section h2 { font-size: 1.5rem; }
.info-section h3 { color: var(--primary-dark); }
.info-section ul { padding-left: 1.25rem; }
.info-section ul li { margin-bottom: .35rem; }

.changelog-entry + .changelog-entry {
  padding-top: 1rem;
  border-top: 1px solid #e9ecef;
}

.external-links a {
  display: block;
  padding: .45rem 0;
  color: var(--primary);
  text-decoration: none;
  font-size: .9375rem;
  transition: color .15s;
}
.external-links a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* --- Page Hero (subpages) ---------------------------------- */
.page-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: '';
  position: absolute;
  top: -50%; right: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 70%);
  pointer-events: none;
}

/* --- Breadcrumb on dark bg --------------------------------- */
.breadcrumb-light .breadcrumb-item a { color: rgba(255,255,255,.7); text-decoration: none; }
.breadcrumb-light .breadcrumb-item a:hover { color: #fff; }
.breadcrumb-light .breadcrumb-item.active { color: rgba(255,255,255,.9); }
.breadcrumb-light .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.4); }

/* --- Stats Bar --------------------------------------------- */
.stats-bar { background-color: var(--primary-dark) !important; }
.stat-number { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-label  { font-size: .75rem; opacity: .75; margin-top: .25rem; text-transform: uppercase; letter-spacing: .5px; }

/* --- Cards -------------------------------------------------- */
.card { transition: transform .2s ease, box-shadow .2s ease; }
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,.12) !important;
}
.rounded-top-4    { border-top-left-radius: var(--radius-lg) !important; border-top-right-radius: var(--radius-lg) !important; }
.rounded-bottom-4 { border-bottom-left-radius: var(--radius-lg) !important; border-bottom-right-radius: var(--radius-lg) !important; }

/* --- Feature Cards ----------------------------------------- */
.feature-card {
  background: #fff;
  border: 1px solid #f0f4f0;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--card-shadow); border-color: #c8e6c9; }
.feature-locked { opacity: .75; }

.feature-icon {
  width: 64px; height: 64px;
  border-radius: 1rem;
  display: flex; align-items: center; justify-content: center;
}

/* --- Board Avatar ------------------------------------------ */
.board-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* --- Contact Links ----------------------------------------- */
.contact-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
}
.contact-link:hover { color: var(--primary); }

/* --- Icon Circle ------------------------------------------- */
.icon-circle {
  width: 60px; height: 60px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* --- Footer ------------------------------------------------- */
.footer { background-color: #1a1a2e !important; }
.footer-link {
  color: rgba(255,255,255,.5);
  text-decoration: none;
  font-size: .875rem;
  display: block;
  padding: .2rem 0;
  transition: color .15s;
}
.footer-link:hover { color: rgba(255,255,255,.9); }

/* --- Category icon (craftsmen & forum) --------------------- */
.category-icon {
  width: 44px; height: 44px;
  border-radius: .75rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.forum-cat-icon {
  width: 48px; height: 48px;
  border-radius: .75rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* --- Forum -------------------------------------------------- */
.thread-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.table { --bs-table-hover-bg: var(--primary-soft); }
.table thead th {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 2px solid #e9ecef;
}

/* --- Post content ------------------------------------------ */
.post-content { line-height: 1.8; word-wrap: break-word; }

/* --- Timeline (History) ------------------------------------ */
.timeline { position: relative; padding-left: 0; }
.timeline::before {
  content: '';
  position: absolute;
  left: 47px;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary) 0%, #c8e6c9 100%);
}
.timeline-item {
  position: relative;
  display: flex;
  gap: 1.25rem;
  padding-bottom: 2rem;
  align-items: flex-start;
}
.timeline-marker {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}
.timeline-year {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: .75rem;
  padding: .35rem .5rem;
  border-radius: .5rem;
  text-align: center;
  min-width: 52px;
  box-shadow: 0 2px 8px rgba(46,125,50,.3);
}
.timeline-content { flex: 1; min-width: 0; }

/* --- Newsletter -------------------------------------------- */
.newsletter-year-badge {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: .75rem;
  padding: .2rem .6rem;
  border-radius: .4rem;
}

/* --- Gallery placeholders ---------------------------------- */
.gallery-placeholder { aspect-ratio: 4/3; cursor: pointer; }
.gallery-photo { aspect-ratio: 4/3; object-fit: cover; display: block; }
.gallery-item { background: #fff; }
.gallery-caption { background: var(--bg-light); }
.gallery-color-1 { background: linear-gradient(135deg, #2E7D32, #4CAF50); height: 100%; }
.gallery-color-2 { background: linear-gradient(135deg, #1565C0, #42A5F5); height: 100%; }
.gallery-color-3 { background: linear-gradient(135deg, #6A1B9A, #AB47BC); height: 100%; }
.gallery-color-4 { background: linear-gradient(135deg, #E65100, #FFA726); height: 100%; }
.gallery-color-5 { background: linear-gradient(135deg, #00695C, #26A69A); height: 100%; }
.gallery-color-6 { background: linear-gradient(135deg, #AD1457, #EC407A); height: 100%; }
.gallery-color-7 { background: linear-gradient(135deg, #4E342E, #8D6E63); height: 100%; }
.gallery-color-8 { background: linear-gradient(135deg, #37474F, #78909C); height: 100%; }

/* --- Demo mode notice -------------------------------------- */
.demo-banner {
  background: var(--accent-soft);
  color: #6D4C00;
  border-bottom: 1px solid #FFE082;
}

/* --- Bylaws content --------------------------------------- */
.bylaws-content h5 { font-size: 1rem; }
.bylaws-content p  { color: #444; line-height: 1.7; }

/* --- Info box --------------------------------------------- */
.info-box { border: 1px solid #e8f5e9; }

/* --- Section header --------------------------------------- */
.section-header h2 { font-size: 1.6rem; }

/* --- Fade-in animation ------------------------------------ */
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.fade-in { animation: fadeIn .3s ease forwards; }

/* --- Responsive ------------------------------------------ */
@media (max-width: 767px) {
  .hero-section { min-height: 60vh; padding: 3rem 0; }
  .display-4    { font-size: 2rem; }
  .timeline::before { left: 43px; }
  .timeline-year { font-size: .7rem; min-width: 46px; }
}
