/* RV Wanderer – Kalender & Ruderbuch (interner Bereich). Früher Inline-<style> von rudern/rudern.html der Website. */

/* ── SCHRIFTEN (lokal, statt Google Fonts; Lizenz: assets/fonts/OFL-*.txt) ── */
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(assets/fonts/playfair-display-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(assets/fonts/playfair-display-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 300 600; font-display: swap;
  src: url(assets/fonts/source-sans-3-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 300 600; font-display: swap;
  src: url(assets/fonts/source-sans-3-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --navy:   #1B3F7A;
  --blue:   #2D5FA3;
  --gold:   #C9A227;
  --gold-l: #F0DFA0;
  --cream:  #F5F0E8;
  --white:  #FFFFFF;
  --dark:   #0F2547;
  --text:   #1a2a3a;
  --muted:  #5a6a7a;
  --border: rgba(43,95,163,0.15);
  --ff-d: 'Playfair Display', Georgia, serif;
  --ff-b: 'Source Sans 3', system-ui, sans-serif;
  --r: 8px; --rl: 14px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--ff-b); color: var(--text); background: var(--cream); font-size: 16px; line-height: 1.7; }
h2,h3,h4 { font-family: var(--ff-d); line-height: 1.2; }
h2 { font-size: clamp(1.6rem,3.5vw,2.4rem); font-weight: 600; color: var(--navy); }
h3 { font-size: 1.15rem; font-weight: 600; color: var(--navy); }
p  { color: var(--muted); }
.eyebrow { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.4rem; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.gold-bar { width: 40px; height: 3px; background: var(--gold); border-radius: 2px; margin: 0.6rem 0 1rem; }

/* ── TOP-LEISTE (zurück zum internen Bereich, Abmelden) ── */
.topbar { background: var(--dark); border-bottom: 1px solid rgba(201,162,39,0.35); font-size: 0.78rem; line-height: 1.4; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 0.4rem; padding-bottom: 0.4rem; }
.topbar a { color: var(--gold-l); text-decoration: none; font-weight: 600; letter-spacing: 0.03em; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.topbar a:hover, .topbar a:focus-visible { color: var(--white); border-bottom-color: var(--gold); }

/* ── HEADER ── */
header {
  background: linear-gradient(135deg, var(--dark) 0%, var(--navy) 100%);
  border-bottom: 2px solid var(--gold);
  padding: 1rem 0;
  position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-text { font-family: var(--ff-d); color: var(--white); font-size: 1rem; font-weight: 600; line-height: 1.1; }
.logo-text span { display: block; font-family: var(--ff-b); font-size: 0.62rem; font-weight: 400; color: var(--gold-l); letter-spacing: 0.08em; text-transform: uppercase; }
.header-tabs { display: flex; gap: 0.5rem; }
.tab-btn { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-radius: var(--r); padding: 0.4rem 1rem; color: rgba(255,255,255,0.75); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all .2s; font-family: var(--ff-b); text-decoration: none; }
.tab-btn:hover { background: rgba(255,255,255,0.18); color: white; }

/* ── LOADING / ERROR ── */
.api-status { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; padding: 0.6rem 1rem; border-radius: var(--r); margin-bottom: 1.25rem; }
.api-status.loading { background: #EBF2FB; color: var(--blue); }
.api-status.error   { background: #FDECEA; color: #8B2320; }
.api-status.info    { background: rgba(45,95,163,0.06); color: var(--muted); }
.api-status.hidden  { display: none; }

/* Schreib-UI erst einblenden, wenn die Daten geladen sind */
.kal-schreibsperre .kal-schreiben, .rb-schreibsperre .rb-schreiben { display: none !important; }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(45,95,163,0.3); border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SECTIONS ── */
.page-section { padding: 2.5rem 0 4rem; }
#sec-ruderbuch { background: var(--white); }

/* ── KALENDER ── */
.kal-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.75rem; }
.kal-nav { display: flex; align-items: center; gap: 0.6rem; }
.kal-nav button { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); padding: 0.35rem 0.75rem; cursor: pointer; font-size: 0.85rem; color: var(--navy); font-weight: 700; transition: all .2s; }
.kal-nav button:hover { background: var(--navy); color: var(--white); }
.kal-month-title { font-family: var(--ff-d); font-size: 1.25rem; font-weight: 600; color: var(--navy); min-width: 175px; text-align: center; }
.kal-controls { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.kal-view-btn { background: none; border: 1px solid var(--border); border-radius: var(--r); padding: 0.3rem 0.75rem; cursor: pointer; font-size: 0.78rem; color: var(--muted); transition: all .2s; font-family: var(--ff-b); }
.kal-view-btn.active { background: var(--navy); color: white; border-color: var(--navy); }
.add-btn { background: var(--gold); color: var(--dark); border: none; border-radius: var(--r); padding: 0.4rem 1rem; cursor: pointer; font-size: 0.85rem; font-weight: 700; transition: background .2s; font-family: var(--ff-b); }
.add-btn:hover { background: #d4ac30; }
.add-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.kal-grid-wrap { background: var(--white); border-radius: var(--rl); overflow: hidden; box-shadow: 0 2px 24px rgba(27,63,122,0.09); }
.kal-day-names { display: grid; grid-template-columns: repeat(7,1fr); background: var(--navy); }
.kal-day-name { text-align: center; padding: 0.55rem; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.7); }
.kal-grid { display: grid; grid-template-columns: repeat(7,1fr); border-top: 1px solid var(--border); }
.kal-cell { min-height: 88px; padding: 0.4rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.kal-cell:nth-child(7n) { border-right: none; }
.kal-cell.other-month .kal-date { color: #c0c8d0; }
.kal-cell.today { background: #f5f9ff; }
.kal-cell.today .kal-date { background: var(--gold); color: var(--dark); }
.kal-date { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; font-size: 0.77rem; font-weight: 700; color: var(--navy); margin-bottom: 3px; }
.kal-event { border-radius: 4px; padding: 1px 5px; font-size: 0.67rem; font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; transition: opacity .15s; line-height: 1.5; }
.kal-event:hover { opacity: 0.75; }
.ev-ausfahrt      { background: #D6E4F7; color: #1B3F7A; }        /* Dunkelblau */
.ev-training      { background: #D6EDD9; color: #1A5C2A; }        /* Grün */
.ev-mitglieder    { background: #FEF9C3; color: #7A6000; }        /* Gelb */
.ev-extern        { background: #FDECEA; color: #8B2320; }        /* Rot */
.ev-privat        { background: #FDEEDE; color: #8B4000; }        /* Orange */
.kal-list { display: none; flex-direction: column; gap: 0.65rem; }
.kal-list.visible { display: flex; }
.kal-grid-wrap.hidden { display: none; }
.list-event { background: var(--white); border-radius: var(--r); padding: 0.9rem 1.2rem; display: flex; gap: 1.1rem; align-items: flex-start; box-shadow: 0 1px 8px rgba(27,63,122,0.07); border-left: 4px solid var(--blue); cursor: pointer; transition: box-shadow .15s; }
.list-event:hover { box-shadow: 0 3px 14px rgba(27,63,122,0.13); }
.list-event.ev-ausfahrt-l    { border-left-color: #1B3F7A; }
.list-event.ev-training-l    { border-left-color: #27ae60; }
.list-event.ev-mitglieder-l  { border-left-color: #D4AC00; }
.list-event.ev-extern-l      { border-left-color: #C0392B; }
.list-event.ev-privat-l      { border-left-color: #D4650A; }
.list-date-block { text-align: center; min-width: 44px; }
.list-date-block .d { font-family: var(--ff-d); font-size: 1.5rem; font-weight: 700; color: var(--navy); line-height: 1; }
.list-date-block .m { font-size: 0.67rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.list-event-info .ev-badge { display: inline-block; font-size: 0.67rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; margin-bottom: 3px; }
.list-event-info h4 { font-size: 0.95rem; font-weight: 600; color: var(--navy); margin-bottom: 1px; }
.list-event-info p { font-size: 0.82rem; color: var(--muted); }
.kal-legend { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.1rem; }
.kal-legend span { padding: 3px 10px; border-radius: 12px; font-size: 0.72rem; font-weight: 700; }

/* ── RUDERBUCH ── */
.rb-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin-bottom: 1.75rem; }
.rb-stat { background: var(--white); border-radius: var(--r); padding: 1rem 1.25rem; box-shadow: 0 1px 8px rgba(27,63,122,0.06); }
.rb-stat .n { font-family: var(--ff-d); font-size: 2rem; font-weight: 700; color: var(--navy); line-height: 1.1; }
.rb-stat .l { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.rb-toolbar { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.rb-toolbar input, .rb-toolbar select { border: 1px solid var(--border); border-radius: var(--r); padding: 0.45rem 0.85rem; font-family: var(--ff-b); font-size: 0.88rem; color: var(--text); background: var(--white); box-shadow: 0 1px 4px rgba(27,63,122,0.04); }
.rb-toolbar input { flex: 1; min-width: 150px; }
.rb-toolbar input:focus, .rb-toolbar select:focus { outline: none; border-color: var(--blue); }
.rb-table-wrap { overflow-x: auto; border-radius: var(--rl); box-shadow: 0 2px 20px rgba(27,63,122,0.08); }
table.rb-table { width: 100%; border-collapse: collapse; background: var(--white); }
.rb-table thead { background: var(--navy); }
.rb-table thead th { padding: 0.65rem 1rem; text-align: left; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.8); white-space: nowrap; }
.rb-table tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; }
.rb-table tbody tr:hover { background: #f0f6ff; }
.rb-table td { padding: 0.7rem 1rem; font-size: 0.875rem; color: var(--text); vertical-align: middle; }
.rb-table td.muted { color: var(--muted); }
.boat-badge { display: inline-block; background: #EBF2FB; color: var(--blue); font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 12px; }
.rb-table .km { font-weight: 700; color: var(--navy); }
.rb-del-btn { background: none; border: none; cursor: pointer; color: #c0392b; font-size: 1rem; opacity: 0.35; transition: opacity .2s; padding: 2px 6px; border-radius: 4px; }
.rb-del-btn:hover { opacity: 1; background: #fdecea; }
.rb-empty { text-align: center; padding: 3rem 1rem; color: var(--muted); font-size: 0.95rem; }
.rb-show-more { display: block; width: 100%; text-align: center; padding: 0.75rem; background: var(--white); border: none; border-top: 1px solid var(--border); font-family: var(--ff-b); font-size: 0.88rem; font-weight: 600; color: var(--blue); cursor: pointer; transition: background .15s; border-radius: 0 0 var(--rl) var(--rl); }
.rb-show-more:hover { background: #f0f6ff; }

/* ── MODALS ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15,37,71,0.55); z-index: 200; align-items: center; justify-content: center; padding: 1rem; backdrop-filter: blur(3px); }
.modal-overlay.open { display: flex; }
.modal { background: var(--white); border-radius: var(--rl); padding: 2rem; max-width: 460px; width: 100%; position: relative; max-height: 90vh; overflow-y: auto; box-shadow: 0 8px 40px rgba(15,37,71,0.2); }
.modal-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--muted); line-height: 1; padding: 2px 6px; border-radius: 4px; }
.modal-close:hover { background: var(--cream); }
.modal h3 { margin-bottom: 1.25rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--navy); margin-bottom: 0.3rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--r); padding: 0.5rem 0.8rem; font-family: var(--ff-b); font-size: 0.88rem; color: var(--text); background: var(--white); transition: border .2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(45,95,163,0.1); }
.form-group textarea { resize: vertical; min-height: 72px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; }
.modal-actions { display: flex; gap: 0.65rem; justify-content: flex-end; margin-top: 1.35rem; }
.btn-sm { padding: 0.48rem 1.15rem; font-size: 0.86rem; border-radius: var(--r); font-weight: 600; cursor: pointer; border: none; transition: all .18s; font-family: var(--ff-b); }
.btn-sm:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary   { background: var(--navy); color: var(--white); }
.btn-primary:hover:not(:disabled)  { background: var(--blue); }
.btn-secondary { background: var(--cream); color: var(--navy); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e8e2d6; }
.btn-danger    { background: #fdecea; color: #8B2320; border: 1px solid #f5c0bc; }
.btn-danger:hover:not(:disabled) { background: #f8d0cc; }
.error-msg   { color: #c0392b; font-size: 0.78rem; margin-top: 0.35rem; }
.success-msg { background: #eafaf1; border: 1px solid #a9dfbf; border-radius: var(--r); padding: 0.7rem 1rem; color: #1e8449; font-size: 0.86rem; margin-top: 0.9rem; }
.del-section { margin-top: 1.1rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.del-section summary { font-size: 0.8rem; font-weight: 600; color: var(--muted); cursor: pointer; user-select: none; }
.del-section summary:hover { color: #c0392b; }
.del-row { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.6rem; }
.del-frage { flex: 1; font-size: 0.84rem; color: var(--muted); }
.eingetragen-von { font-size: 0.75rem; color: var(--muted); font-style: italic; margin-top: 0.75rem; }


/* ── DOWNLOAD BUTTONS (rund) ── */
.dl-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); background: var(--white); color: var(--navy); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all .2s; flex-shrink: 0; }
.dl-btn:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }
.dl-btn svg { width: 15px; height: 15px; }

/* ── DOWNLOAD FORMAT CARDS ── */
.dl-format-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; margin-top: 1rem; }
.dl-format-card { border: 2px solid var(--border); border-radius: var(--rl); padding: 1.25rem 1rem; text-align: center; cursor: pointer; transition: all .2s; background: var(--white); }
.dl-format-card:hover { border-color: var(--navy); background: #f5f9ff; }
.dl-format-card .dl-icon { display: block; font-size: 2rem; margin-bottom: 0.4rem; }
.dl-format-card strong { display: block; font-size: 0.95rem; font-weight: 700; color: var(--navy); }
.dl-format-card span { font-size: 0.78rem; color: var(--muted); }


@media(max-width:680px) {
  .rb-stats { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media(max-width:480px) {
  .header-tabs .tab-btn { padding: 0.35rem 0.65rem; font-size: 0.78rem; }
  .rb-stats { grid-template-columns: 1fr; }
}
