/* ====================================================
   Quicksand – self-hosted (place font files in assets/font/)
   Download: https://fonts.google.com/specimen/Quicksand
   ==================================================== */

/* Variable font – single file, recommended */
@font-face {
  font-family: 'Quicksand';
  src: url('../font/Quicksand-VariableFont_wght.ttf') format('truetype');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* Individual weight files (used only if variable font is absent) */
@font-face { font-family:'Quicksand'; src:url('../font/Quicksand-Light.ttf')    format('truetype'); font-weight:300; font-style:normal; font-display:swap; }
@font-face { font-family:'Quicksand'; src:url('../font/Quicksand-Regular.ttf')  format('truetype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Quicksand'; src:url('../font/Quicksand-Medium.ttf')   format('truetype'); font-weight:500; font-style:normal; font-display:swap; }
@font-face { font-family:'Quicksand'; src:url('../font/Quicksand-SemiBold.ttf') format('truetype'); font-weight:600; font-style:normal; font-display:swap; }
@font-face { font-family:'Quicksand'; src:url('../font/Quicksand-Bold.ttf')     format('truetype'); font-weight:700; font-style:normal; font-display:swap; }

/* ====================================================
   Community Kalender – Stylesheet
   ==================================================== */

:root {
  --bg:           #faf9f6;
  --surface:      #ffffff;
  --surface-2:    #f4efe8;
  --border:       #e8dfd4;
  --text:         #292524;
  --text-muted:   #78716c;
  --accent:       #d97706;
  --accent-light: #fef3c7;
  --accent-dark:  #b45309;
  --danger:       #dc2626;
  --success:      #15803d;
  --internal:     #c2410c;
  --font:         'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --radius:       8px;
  --radius-lg:    14px;
  --shadow-sm:    0 1px 3px rgba(15,23,42,.07);
  --shadow:       0 4px 12px rgba(15,23,42,.10);
  --shadow-lg:    0 12px 30px rgba(15,23,42,.16);
  --header-h:     58px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ──────────────────────────────────────── */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
}
.header-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 1.25rem; height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
}
.header-logo {
  display: flex; align-items: center; gap: .45rem;
  font-weight: 800; font-size: 1.05rem; letter-spacing: -.3px;
  white-space: nowrap;
}
.logo-mark { color: var(--accent); }

.header-nav { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }

.view-switcher {
  display: flex; background: var(--surface-2);
  border-radius: 7px; padding: 3px;
}
.view-btn {
  background: transparent; border: none;
  padding: .28rem .8rem; border-radius: 5px;
  font-size: .82rem; font-weight: 500; color: var(--text-muted);
  cursor: pointer; transition: all .15s;
}
.view-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.header-actions { display: flex; align-items: center; gap: .4rem; }

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  padding: .45rem .95rem; border: none; border-radius: var(--radius);
  font-size: .875rem; font-weight: 500; cursor: pointer;
  transition: all .15s; white-space: nowrap; font-family: var(--font);
  text-decoration: none;
}
.btn-primary   { background: var(--accent);    color: white; }
.btn-primary:hover   { background: var(--accent-dark); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger    { background: var(--danger);    color: white; }
.btn-danger:hover    { background: #b91c1c; }
.btn-sm        { padding: .28rem .65rem; font-size: .78rem; }
.btn-icon      { padding: .35rem; width: 34px; height: 34px; }

.icon-btn {
  font-size: .7rem; font-weight: 700; letter-spacing: .04em;
  color: var(--text-muted); text-decoration: none;
  padding: .28rem .5rem; border-radius: 5px;
  border: 1px solid var(--border); transition: all .15s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Welcome section ─────────────────────────────── */
.welcome-section {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.75rem 1.25rem;
}
.welcome-inner {
  max-width: 1280px; margin: 0 auto;
}
.welcome-title { font-size: 1.5rem; font-weight: 800; margin-bottom: .5rem; }
.welcome-body  {
  font-size: .925rem; color: var(--text-muted); line-height: 1.7;
  max-width: 680px;
}
.welcome-body p  { margin-bottom: .5rem; }
.welcome-body ul, .welcome-body ol { padding-left: 1.25rem; margin-bottom: .5rem; }
.welcome-body a  { color: var(--accent); }
.welcome-body h2, .welcome-body h3 { margin: .75rem 0 .35rem; color: var(--text); }

/* ── Main ────────────────────────────────────────── */
.main { max-width: 1280px; margin: 0 auto; padding: 1.25rem; flex: 1; width: 100%; }

/* ── Club filter pills ───────────────────────────── */
.filters { margin-bottom: 1.1rem; }
.club-filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.club-filter-btn {
  padding: .28rem .8rem; border-radius: 999px;
  border: 2px solid transparent; font-size: .77rem; font-weight: 600;
  cursor: pointer; transition: all .15s; opacity: .65;
}
.club-filter-btn.active { opacity: 1; border-color: rgba(0,0,0,.2); }

/* ── Views ───────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }

/* ── Calendar ────────────────────────────────────── */
.calendar-nav {
  display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem;
  flex-wrap: wrap;
}
.month-title { font-size: 1.15rem; font-weight: 800; min-width: 190px; text-align: center; }

.nav-arrow {
  background: var(--surface); border: 1px solid var(--border);
  width: 34px; height: 34px; border-radius: var(--radius);
  font-size: 1.2rem; cursor: pointer; display: flex;
  align-items: center; justify-content: center; color: var(--text); transition: all .15s;
}
.nav-arrow:hover { border-color: var(--accent); color: var(--accent); }

.calendar-grid {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
}
.calendar-week-headers {
  display: grid; grid-template-columns: repeat(7,1fr);
  background: var(--surface-2); border-bottom: 2px solid var(--border);
}
.calendar-day-header {
  padding: .55rem .4rem; font-size: .7rem; font-weight: 700;
  text-align: center; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .07em;
}
.calendar-days { display: grid; grid-template-columns: repeat(7,1fr); }

.calendar-cell {
  min-height: 100px; padding: .35rem;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  cursor: default; transition: background .1s;
}
.calendar-cell:nth-child(7n) { border-right: none; }
.calendar-cell:not(.other-month):hover { background: #f8faff; }
.calendar-cell.other-month { background: #fafafa; }
.calendar-cell.other-month .cell-day { color: #c8cdd8; }
.calendar-cell.today .cell-day {
  background: var(--accent); color: white;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.cell-day {
  font-size: .78rem; font-weight: 700; margin-bottom: .25rem;
  width: 26px; height: 26px; display: flex; align-items: center;
  justify-content: center; border-radius: 50%;
}
.cell-events { display: flex; flex-direction: column; gap: 2px; }
.cell-event {
  font-size: .67rem; padding: 2px 5px; border-radius: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; transition: opacity .15s; line-height: 1.4; font-weight: 500;
}
.cell-event:hover { opacity: .75; }

.cell-more { font-size: .63rem; color: var(--text-muted); padding: 1px 4px; cursor: pointer; }

/* ── List View ───────────────────────────────────── */
.list-group   { margin-bottom: 2.25rem; }
.list-month-header {
  font-size: .7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-muted);
  margin-bottom: .7rem; padding-bottom: .45rem;
  border-bottom: 2px solid var(--border);
}
.list-event {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.25rem;
  margin-bottom: .65rem; display: flex; gap: 1rem;
  cursor: pointer; transition: all .15s;
}
.list-event:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }

.list-event-date   { text-align: center; min-width: 46px; padding-top: .1rem; flex-shrink: 0; }
.list-event-day    { font-size: 1.55rem; font-weight: 900; line-height: 1; color: var(--accent); }
.list-event-month  { font-size: .67rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }

.list-event-thumb {
  width: 64px; height: 64px; border-radius: var(--radius); object-fit: cover;
  flex-shrink: 0; align-self: center;
}

.list-event-body   { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .45rem; }
.list-event-title  { font-weight: 700; font-size: .95rem; }
.list-event-meta   { font-size: .8rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: .5rem; line-height: 1.5; }
.list-event-footer { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }

.club-badge {
  font-size: .68rem; font-weight: 700; padding: 2px 8px;
  border-radius: 999px; color: white; display: inline-block;
}
.internal-badge, .cat-badge {
  font-size: .65rem; font-weight: 700; padding: 2px 7px;
  border-radius: 999px; background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border); display: inline-block;
}

.list-event-categories { display: flex; flex-wrap: wrap; gap: .25rem; margin: .3rem 0 .15rem; }

.categories-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem .5rem; margin-top: .25rem;
}
@media (max-width: 480px) { .categories-grid { grid-template-columns: 1fr 1fr; } }

/* ── Event Image (Detail) ────────────────────────── */
.event-image {
  width: 100%; max-height: 240px; object-fit: cover;
  border-radius: var(--radius); margin-bottom: 1rem;
}

/* ── FAB ─────────────────────────────────────────── */
.fab {
  position: fixed; bottom: 5.5rem; right: 1.5rem;
  width: 52px; height: 52px;
  background: var(--accent); color: white;
  border: none; border-radius: 50%;
  font-size: 1.5rem; cursor: pointer;
  box-shadow: 0 4px 16px rgba(37,99,235,.45);
  transition: all .15s; z-index: 50;
  display: flex; align-items: center; justify-content: center;
}
.fab:hover { transform: scale(1.08); }
.fab.hidden { display: none; }

/* ── Modal ───────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  /* On mobile, align to bottom */
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--surface); border-radius: var(--radius-lg);
  width: 100%; max-width: 540px; max-height: 92vh;
  overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: modalIn .18s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.modal-header {
  padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-title  { font-weight: 800; font-size: 1rem; }
.modal-close  {
  background: none; border: none; font-size: 1.4rem;
  cursor: pointer; color: var(--text-muted); line-height: 1;
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius); transition: background .1s;
}
.modal-close:hover { background: var(--surface-2); }
.modal-body   { padding: 1.4rem; }
.modal-footer {
  padding: .9rem 1.4rem; border-top: 1px solid var(--border);
  display: flex; gap: .4rem; justify-content: flex-end; flex-wrap: wrap;
}

/* ── Forms ───────────────────────────────────────── */
.form-group   { margin-bottom: .9rem; }
.form-label   { display: block; font-size: .83rem; font-weight: 600; margin-bottom: .28rem; }
.form-control {
  width: 100%; padding: .48rem .7rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .875rem; font-family: var(--font);
  background: var(--surface); color: var(--text); transition: border-color .15s;
  -webkit-appearance: none; appearance: none;
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row     { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.form-check   { display: flex; align-items: center; gap: .5rem; font-size: .875rem; cursor: pointer; }
.form-check input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
.form-hint    { font-size: .72rem; color: var(--text-muted); margin-top: .22rem; }
.form-error   { background: #fef2f2; border: 1px solid #fecaca; color: var(--danger); padding: .7rem; border-radius: var(--radius); font-size: .83rem; margin-bottom: .9rem; }
.form-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: var(--success); padding: .7rem; border-radius: var(--radius); font-size: .83rem; margin-bottom: .9rem; }

/* Image preview in form */
.img-preview-wrap { position: relative; display: inline-block; }
.img-preview { max-width: 100%; max-height: 180px; border-radius: var(--radius); border: 1px solid var(--border); display: block; }
.img-remove  { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.6); color: white; border: none; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; font-size: .75rem; display: flex; align-items: center; justify-content: center; }

/* ── Event detail ────────────────────────────────── */
.event-detail-title  { font-size: 1.15rem; font-weight: 800; margin-bottom: .5rem; }
.event-detail-info   { display: flex; flex-direction: column; gap: .45rem; margin-bottom: .9rem; }
.event-detail-row    { display: flex; gap: .5rem; font-size: .875rem; }
.event-detail-row strong { color: var(--text); min-width: 95px; font-weight: 600; flex-shrink: 0; }
.event-detail-row span   { color: var(--text-muted); word-break: break-word; }
.event-detail-row a      { color: var(--accent); }
.event-detail-desc   {
  font-size: .875rem; line-height: 1.7; white-space: pre-wrap;
  border-top: 1px solid var(--border); padding-top: .9rem;
  color: var(--text-muted); word-break: break-word;
}

/* ── User menu ───────────────────────────────────── */
.user-menu { position: relative; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-light); border: none;
  font-size: .78rem; font-weight: 800; color: var(--accent);
  cursor: pointer; transition: all .15s;
}
.user-avatar:hover { background: var(--accent); color: white; }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 185px; z-index: 300; animation: modalIn .12s ease;
}
.user-dropdown.hidden { display: none; }
.user-dropdown-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem 1rem; font-size: .85rem;
  color: var(--text); text-decoration: none; cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
  transition: background .1s; font-family: var(--font);
}
.user-dropdown-item:hover { background: var(--surface-2); }
.user-dropdown-item.danger { color: var(--danger); }
.user-dropdown-divider { height: 1px; background: var(--border); margin: .2rem 0; }

/* ── Toast ───────────────────────────────────────── */
.toast {
  position: fixed; bottom: 5rem; left: 50%; transform: translateX(-50%);
  background: #1e293b; color: white;
  padding: .6rem 1.4rem; border-radius: var(--radius);
  font-size: .875rem; z-index: 500; box-shadow: var(--shadow-lg);
  animation: toastIn .2s, toastOut .3s 2.7s forwards;
  pointer-events: none; white-space: nowrap; max-width: calc(100vw - 2rem);
  overflow: hidden; text-overflow: ellipsis;
}
@keyframes toastIn  { from { opacity: 0; transform: translateX(-50%) translateY(8px); } }
@keyframes toastOut { to   { opacity: 0; } }

/* ── Empty state ─────────────────────────────────── */
.empty-state { text-align: center; padding: 3.5rem 1rem; color: var(--text-muted); }
.empty-state-icon { font-size: 2.25rem; margin-bottom: .65rem; }
.empty-state p    { font-size: .875rem; }

/* ── Footer ──────────────────────────────────────── */
.site-footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 1rem 1.25rem; margin-top: auto;
}
.footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; justify-content: center; align-items: center;
  flex-wrap: wrap; gap: .35rem 1.5rem;
}
.footer-link {
  font-size: .8rem; color: var(--text-muted); text-decoration: none;
  transition: color .15s; white-space: nowrap;
}
.footer-link:hover { color: var(--accent); }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
  /* Header: logo top row, nav wraps to second row */
  .header            { height: auto; }
  .header-inner      { padding: .55rem .9rem; flex-wrap: wrap; row-gap: .3rem; }
  .header-logo       { flex: 1 1 auto; }
  .header-nav        { flex: 0 0 100%; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .3rem; }
  .icon-btn { display: none; } /* hide RSS/iCal on mobile */
  .main { padding: .9rem; }
  .welcome-section { padding: 1.25rem .9rem; }
  .welcome-title { font-size: 1.2rem; }

  /* Calendar: smaller cells */
  .calendar-cell { min-height: 68px; padding: .25rem; }
  .cell-day      { font-size: .72rem; width: 22px; height: 22px; }
  .cell-event    { font-size: .62rem; padding: 1px 3px; }
  .month-title   { min-width: 0; font-size: 1rem; flex: 1; }
  .calendar-nav  { gap: .4rem; }
  .calendar-day-header { font-size: .62rem; padding: .4rem .2rem; }

  /* List: stack date above content on very small screens */
  .list-event      { gap: .7rem; padding: .75rem .85rem; }
  .list-event-thumb { width: 54px; height: 54px; }

  /* Forms */
  .form-row { grid-template-columns: 1fr; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 95vh;
  }

  /* FAB */
  .fab { bottom: 4.5rem; right: 1rem; }
}

@media (max-width: 400px) {
  .calendar-cell { min-height: 54px; }
  .cell-event    { font-size: .58rem; padding: 1px 3px; border-radius: 2px; }
}

/* ── Filter dropdowns ──────────────────────────────── */
.filters { margin-bottom: 1.1rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.filter-select {
  padding: .35rem .7rem; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .82rem; font-family: var(--font);
  background: var(--surface); color: var(--text); cursor: pointer;
  min-width: 160px; height: 34px; transition: border-color .15s;
}
.filter-select:focus { outline: none; border-color: var(--accent); }
