/* ============================================================
   DIGITÁLIS HANGARCHÍVUM – Stíluslap
   Navy & Arany, serif tipográfia, GitHub Pages kompatibilis
   ============================================================ */

/* --- Változók --- */
:root {
  --navy:         #1B2E5C;
  --navy-dark:    #0F1D3A;
  --navy-light:   #2A4080;
  --navy-pale:    #EEF1F8;

  --gold:         #C9A44A;
  --gold-light:   #E0BC72;
  --gold-pale:    #F8F1E0;
  --gold-border:  rgba(201, 164, 74, 0.35);

  --cream:        #F5F0E8;
  --cream-dark:   #EDE5D5;
  --white:        #FFFFFF;

  --text:         #1A1A2E;
  --text-muted:   #4A5A7A;
  --text-light:   #7A8FAF;
  --border:       #C8BFA8;
  --border-light: #DDD7CA;

  --font-serif:   'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:    'Crimson Text', Georgia, 'Times New Roman', serif;
  --font-ui:      system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius:       4px;
  --radius-lg:    8px;
  --shadow-sm:    0 1px 4px rgba(15, 29, 58, 0.10);
  --shadow:       0 3px 12px rgba(15, 29, 58, 0.14);
  --shadow-lg:    0 8px 28px rgba(15, 29, 58, 0.18);

  --player-h:     90px;
  --header-h:     72px;
  --filters-h:    52px;

  --transition:   0.2s ease;
}

/* --- Sötét mód változók --- */
[data-theme="dark"] {
  --cream:        #111827;
  --cream-dark:   #0E1A2E;
  --white:        #192840;

  --text:         #DDD4C2;
  --text-muted:   #7A96BB;
  --text-light:   #4E6585;

  --border:       rgba(255, 255, 255, 0.10);
  --border-light: rgba(255, 255, 255, 0.06);

  --navy-pale:    #192840;

  --shadow-sm: 0 1px 6px rgba(0, 0, 0, 0.45);
  --shadow:    0 3px 14px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.65);
}

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

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

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--cream);
  min-height: 100vh;
  padding-bottom: calc(var(--player-h) + 16px);
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--gold); }

button { font-family: inherit; cursor: pointer; border: none; background: none; }

input, select {
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  padding: 0.45rem 0.75rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 164, 74, 0.18);
}

/* --- Fejléc --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy-dark);
  border-bottom: 3px solid var(--gold);
  height: var(--header-h);
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

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

.header-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.header-titles h1 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.2;
  white-space: nowrap;
}

.header-subtitle {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--gold-light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.header-search {
  flex: 1;
  display: flex;
  gap: 0.5rem;
  max-width: 480px;
  margin-left: auto;
}

.header-search input[type="search"] {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 0.45rem 1rem;
}
.header-search input::placeholder { color: rgba(255,255,255,0.45); }
.header-search input:focus {
  background: rgba(255,255,255,0.12);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 164, 74, 0.22);
}

.search-btn {
  background: var(--gold);
  color: var(--navy-dark);
  border-radius: var(--radius);
  padding: 0.45rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background var(--transition);
  white-space: nowrap;
}
.search-btn:hover { background: var(--gold-light); }

/* --- Témaváltó gomb (fejlécben, jobbra) --- */
.theme-toggle {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.80);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--gold-light);
  border-color: var(--gold);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Ikon láthatóság CSS-ből – JS nem nyúl az innerHTML-hez */
.theme-icon { display: none; }

/* Világos mód (alapértelmezett + data-theme="light"): hold ikon */
html:not([data-theme="dark"]) .icon-moon { display: block; }

/* Sötét mód: nap ikon */
[data-theme="dark"] .icon-sun  { display: block; }
[data-theme="dark"] .icon-moon { display: none;  }

/* --- Szűrősáv --- */
.filters-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  background: var(--cream-dark);
  border-bottom: 1px solid var(--border);
  height: var(--filters-h);
}

.filters-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filters-inner::-webkit-scrollbar { display: none; }

.filters-label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-right: 0.25rem;
}

.filters-inner select {
  padding: 0.3rem 0.65rem;
  font-size: 0.875rem;
  background: var(--white);
  min-width: 120px;
  max-width: 160px;
  flex-shrink: 0;
}

.filter-reset {
  margin-left: auto;
  flex-shrink: 0;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  transition: all var(--transition);
  white-space: nowrap;
}
.filter-reset:hover {
  color: var(--navy);
  border-color: var(--navy);
  background: var(--white);
}

.results-count {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--text-light);
  white-space: nowrap;
  flex-shrink: 0;
}
.results-count strong {
  color: var(--text);
  font-weight: 600;
}

/* --- Statisztikasáv --- */
.stats-bar {
  max-width: 1200px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem;
}

.stats-inner {
  display: flex;
  gap: 2rem;
  padding: 1rem 1.5rem;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--gold);
  box-shadow: var(--shadow-sm);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.stat-label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat-divider {
  width: 1px;
  background: var(--border-light);
  align-self: stretch;
}

/* --- Főtartalom --- */
.main-content {
  max-width: 1200px;
  margin: 1.25rem auto 0;
  padding: 0 1.5rem 2rem;
}

/* --- Kártyarács --- */
.lecture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

/* --- Kártya --- */
.lecture-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.375rem 1.5rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
}

.lecture-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: var(--gold-border);
}

.lecture-card.is-active {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201, 164, 74, 0.25), var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-category {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.22rem 0.6rem;
  border-radius: 2px;
}

.category-eloadas    { background: #EEF1F8; color: #1B2E5C; }
.category-lelkigyakorlat { background: #D1F0E3; color: #1A5C3A; }
.category-predikacio { background: #EDD9FF; color: #5B2D8A; }
.category-konferencia { background: #FFE9D9; color: #7B3A1A; }
.category-interju    { background: #D0F0EE; color: #1A5550; }
.category-szentmise  { background: #FFD9D9; color: #8B1A1A; }

.card-duration {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--navy-dark);
}

.card-speaker {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.01em;
}

.card-description {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.625rem 0.75rem;
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.card-date {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--text-light);
}

.card-format {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-light);
  font-style: italic;
}

.card-play-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.1rem;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
}
.card-play-btn:hover { background: var(--navy-light); }
.card-play-btn.playing {
  background: var(--gold);
  color: var(--navy-dark);
}
.card-play-btn.playing:hover { background: var(--gold-light); }

.play-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* --- Üres állapot --- */
.empty-state,
.loading-state,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-state svg,
.loading-state svg,
.error-state svg {
  opacity: 0.35;
  width: 64px;
  height: 64px;
  color: var(--navy);
}

.empty-state p,
.loading-state p,
.error-state p {
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--text-muted);
}

.error-state p { color: #8B1A1A; }

.hidden { display: none !important; }

/* --- Pörgő ikon --- */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-light);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Audio lejátszó (alul rögzített) --- */
.audio-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--navy-dark);
  border-top: 2px solid var(--gold);
  box-shadow: 0 -4px 20px rgba(15, 29, 58, 0.35);
  height: var(--player-h);
}

.player-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.player-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.player-title {
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.player-speaker {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--gold-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.ctrl-btn {
  color: rgba(255,255,255,0.75);
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  min-width: 36px;
  text-align: center;
}
.ctrl-btn:hover { color: var(--white); background: rgba(255,255,255,0.1); }

.play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy-dark);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
  padding: 0;
  min-width: 44px;
}
.play-btn:hover { background: var(--gold-light); transform: scale(1.06); }

.player-timeline {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex: 2;
  min-width: 0;
  max-width: 480px;
}

.time-current,
.time-total {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.65);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  width: 40px;
  flex-shrink: 0;
}
.time-total { text-align: right; }

.progress-bar {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.18);
  border-radius: 3px;
  cursor: pointer;
  border: none;
  padding: 0;
  outline: none;
  min-width: 0;
}

.progress-bar::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 3px;
}

.progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  background: var(--gold);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.progress-bar:hover::-webkit-slider-thumb { opacity: 1; }

.progress-bar::-moz-range-track {
  height: 5px;
  background: rgba(255,255,255,0.18);
  border-radius: 3px;
}

.progress-bar::-moz-range-progress {
  background: var(--gold);
  border-radius: 3px;
  height: 5px;
}

.progress-bar::-moz-range-thumb {
  width: 13px;
  height: 13px;
  background: var(--gold);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.progress-bar:hover::-moz-range-thumb { opacity: 1; }

.player-volume {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.volume-icon {
  font-size: 0.9rem;
  opacity: 0.7;
  cursor: pointer;
  user-select: none;
}

input[type="range"]#volumeSlider {
  -webkit-appearance: none;
  width: 80px;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  outline: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
input[type="range"]#volumeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--gold);
  border-radius: 50%;
  cursor: pointer;
}
input[type="range"]#volumeSlider:focus {
  box-shadow: none;
}

.close-btn {
  color: rgba(255,255,255,0.5);
  font-size: 1rem;
  flex-shrink: 0;
  padding: 0.25rem 0.5rem;
}
.close-btn:hover { color: var(--white); }

/* --- Hiba banner (lejátszó területén belül) --- */
.player-error {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: #FFB3B3;
  text-align: center;
  padding: 0.25rem 0.75rem;
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
}

/* --- Lábléc --- */
.site-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--border-light);
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  color: var(--navy);
  font-weight: 600;
}

.footer-note {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--text-light);
  text-align: right;
}

/* === Sötét mód – elem-szintű felülírások === */
[data-theme="dark"] a:not(.card-play-btn) { color: var(--gold-light); }
[data-theme="dark"] a:not(.card-play-btn):hover { color: var(--gold); }

[data-theme="dark"] .card-title  { color: #CEC4B0; }
[data-theme="dark"] .stat-value  { color: var(--gold-light); }
[data-theme="dark"] .footer-brand { color: var(--gold); }

[data-theme="dark"] .card-play-btn          { background: var(--navy-light); }
[data-theme="dark"] .card-play-btn:hover    { background: #3A5498; }

[data-theme="dark"] .filter-reset { color: var(--text-muted); border-color: rgba(255,255,255,0.12); }
[data-theme="dark"] .filter-reset:hover {
  color: var(--gold-light);
  border-color: var(--gold);
  background: rgba(201, 164, 74, 0.10);
}

[data-theme="dark"] .results-count strong { color: var(--text); }

[data-theme="dark"] input[type="search"],
[data-theme="dark"] select {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
  color: var(--text);
}
[data-theme="dark"] .header-search input[type="search"] {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.16);
}

[data-theme="dark"] .lecture-card:hover { border-color: rgba(201,164,74,0.3); }
[data-theme="dark"] .card-footer { border-top-color: rgba(255,255,255,0.07); }

[data-theme="dark"] .spinner { border-color: rgba(255,255,255,0.12); border-top-color: var(--gold); }

/* Kategória badge-ek sötét módban */
[data-theme="dark"] .category-eloadas     { background: rgba(27,46,92,0.6);   color: #90B0E0; }
[data-theme="dark"] .category-lelkigyakorlat { background: rgba(13,45,28,0.6); color: #70C0A0; }
[data-theme="dark"] .category-predikacio  { background: rgba(30,13,53,0.6);   color: #B888E8; }
[data-theme="dark"] .category-konferencia { background: rgba(45,21,6,0.6);    color: #D49060; }
[data-theme="dark"] .category-interju     { background: rgba(13,37,32,0.6);   color: #50C0B8; }
[data-theme="dark"] .category-szentmise   { background: rgba(42,8,8,0.6);     color: #D08080; }

/* === Reszponzív === */
@media (max-width: 768px) {
  :root {
    --header-h: 108px;   /* két sor: brand+toggle, majd keresés */
    --player-h: 112px;
  }

  .site-header { height: auto; }

  .header-inner {
    padding: 0.625rem 1rem;
    flex-wrap: wrap;
    height: auto;
    gap: 0.625rem;
  }

  /* Első sor: brand (flex-1) + toggle */
  .header-brand { flex: 1; min-width: 0; order: 1; }
  .theme-toggle { order: 2; flex-shrink: 0; }

  /* Második sor: keresés teljes szélességben */
  .header-search {
    order: 3;
    width: 100%;
    max-width: none;
    margin-left: 0;
    flex: 1 1 100%;
  }

  .header-titles h1 { font-size: 1rem; white-space: normal; }
  .header-subtitle  { display: none; }

  /* Szűrő sor vízszintesen görgethető, nem tördel */
  .filters-bar { position: sticky; top: var(--header-h); }
  .filters-inner {
    padding: 0 1rem;
    height: 48px;
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filters-inner::-webkit-scrollbar { display: none; }
  .filters-inner select { min-width: 120px; flex-shrink: 0; }
  .filters-label { display: none; }
  .filter-reset { flex-shrink: 0; }
  .results-count { flex-shrink: 0; margin-left: auto; padding-right: 0.5rem; }

  .stats-bar { padding: 0 1rem; }
  .stats-inner { gap: 1.25rem; }

  .main-content { padding: 0 1rem 2rem; }

  .lecture-grid { grid-template-columns: 1fr; }

  /* Lejátszó mobilon */
  .player-inner {
    flex-wrap: wrap;
    padding: 0.625rem 1rem;
    gap: 0.5rem;
    align-content: center;
    height: var(--player-h);
  }
  .player-info     { order: 1; flex: 1; min-width: 0; }
  .close-btn       { order: 2; }
  .player-controls { order: 3; }
  .player-timeline { order: 4; flex: 1 1 100%; max-width: none; }
  .player-volume   { display: none; }

  .site-footer { flex-direction: column; text-align: center; }
  .footer-note { text-align: center; }
}

@media (max-width: 480px) {
  :root { --header-h: 112px; }

  .lecture-card { padding: 1rem; }
  .card-title   { font-size: 1rem; }
  .stats-inner  { gap: 0.875rem; }
  .stat-value   { font-size: 1.25rem; }
  .stat-divider { display: none; }

  .header-icon  { width: 32px; height: 32px; }
}

/* --- Nyomtatás --- */
@media print {
  .site-header, .filters-bar, .audio-player { display: none; }
  body { padding-bottom: 0; background: white; }
  .lecture-card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
}

/* ============================================================
   ÚJ ELEMEK – háttérkép, szezonális, random, letöltés, igehely
   ============================================================ */

/* --- Háttérkép réteg --- */
#bgCanvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

#bgImage {
  position: absolute;
  inset: -12px; /* eltakarja a blur éleket */
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: none; /* JS mutatja meg, ha a kép betölt */
}

#bgOverlay {
  position: absolute;
  inset: 0;
  background: rgba(245, 240, 232, 0.88);
  transition: background 0.3s;
}

[data-theme="dark"] #bgOverlay {
  background: rgba(14, 26, 46, 0.90);
}

/* --- Véletlen igehirdetés gomb (fejlécben) --- */
.random-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.875rem;
  background: rgba(201, 164, 74, 0.18);
  color: var(--gold-light);
  border: 1.5px solid rgba(201, 164, 74, 0.4);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.random-btn:hover {
  background: rgba(201, 164, 74, 0.3);
  border-color: var(--gold);
  color: var(--white);
}
.random-btn-text { display: inline; }

/* --- Igehely-kereső mező a szűrősávban --- */
.igehely-input {
  min-width: 155px;
  max-width: 175px;
  padding: 0.3rem 0.65rem;
  font-size: 0.875rem;
  background: var(--white);
  flex-shrink: 0;
}

/* --- Kedvencek toggle gomb --- */
.fav-toggle {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition);
}
.fav-toggle:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: var(--gold-pale);
}
.fav-toggle.is-active {
  color: var(--gold);
  border-color: var(--gold);
  background: var(--gold-pale);
}
[data-theme="dark"] .fav-toggle:hover,
[data-theme="dark"] .fav-toggle.is-active {
  background: rgba(201, 164, 74, 0.12);
}

/* --- Szezonális ajánlás szekció --- */
.seasonal-section {
  max-width: 1200px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem;
}

.seasonal-inner {
  background: var(--white);
  border: 1px solid var(--gold-border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.seasonal-title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

[data-theme="dark"] .seasonal-title { color: var(--gold-light); }

.seasonal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

/* --- Kártya – új elemek --- */

/* Igehely sor (lectió / textus) */
.card-igehely {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.igehely-label {
  font-weight: 600;
  color: var(--navy);
  margin-right: 0.25rem;
}
[data-theme="dark"] .igehely-label { color: var(--gold-light); }

/* Megjegyzés sor */
.card-megjegyzes {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Évkör badge a kártya alján */
.card-evkor {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-light);
  font-style: italic;
}

/* "Különleges alkalom" extra badge */
.card-badge-special {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.18rem 0.5rem;
  border-radius: 2px;
  background: #FFF3CD;
  color: #856404;
}
[data-theme="dark"] .card-badge-special {
  background: rgba(133, 100, 4, 0.25);
  color: #E0B840;
}

/* Különleges kártya jelzése */
.lecture-card.is-special {
  border-color: rgba(201, 164, 74, 0.4);
}
.lecture-card.is-special::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--gold);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

/* --- Kategória stílusok (új nevekkel) --- */
.kat-istentisztelet  { background: #EEF1F8; color: #1B2E5C; }
.kat-evangelizacio   { background: #D1F0E3; color: #1A5C3A; }
.kat-kulonleges      { background: #FFF3CD; color: #856404; }
.kat-konfirmacio     { background: #EDD9FF; color: #5B2D8A; }
.kat-bibliakor       { background: #D0F0EE; color: #1A5550; }
.kat-imaheti         { background: #FFE9D9; color: #7B3A1A; }
.kat-alap            { background: #EEF1F8; color: #1B2E5C; }

[data-theme="dark"] .kat-istentisztelet  { background: rgba(27,46,92,0.6);   color: #90B0E0; }
[data-theme="dark"] .kat-evangelizacio   { background: rgba(13,45,28,0.6);   color: #70C0A0; }
[data-theme="dark"] .kat-kulonleges      { background: rgba(100,75,0,0.4);   color: #E0B840; }
[data-theme="dark"] .kat-konfirmacio     { background: rgba(30,13,53,0.6);   color: #B888E8; }
[data-theme="dark"] .kat-bibliakor       { background: rgba(13,37,32,0.6);   color: #50C0B8; }
[data-theme="dark"] .kat-imaheti         { background: rgba(45,21,6,0.6);    color: #D49060; }
[data-theme="dark"] .kat-alap            { background: rgba(27,46,92,0.6);   color: #90B0E0; }

/* --- Kártya akciók (lejátszás + letöltés + megosztás + kedvenc) --- */
.card-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Letöltés gomb */
.card-download-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.card-download-btn:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.card-download-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
[data-theme="dark"] .card-download-btn {
  color: var(--text);
  border-color: rgba(255,255,255,0.2);
}
[data-theme="dark"] .card-download-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--gold-light);
  border-color: var(--gold);
}

/* Megosztás gomb */
.card-share-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.card-share-btn:hover {
  background: var(--gold-pale);
  color: var(--navy-dark);
  border-color: var(--gold);
}
[data-theme="dark"] .card-share-btn {
  color: var(--text);
  border-color: rgba(255,255,255,0.2);
}
[data-theme="dark"] .card-share-btn:hover {
  background: rgba(201,164,74,0.1);
  color: var(--gold-light);
  border-color: var(--gold);
}

/* Player megosztás gomb */
.player-share-btn {
  color: rgba(255,255,255,0.65);
}
.player-share-btn:hover {
  color: var(--gold-light);
  background: rgba(255,255,255,0.1);
}

/* Kedvenc (csillag) gomb */
.card-star-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background: transparent;
  color: var(--text-light);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  flex-shrink: 0;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.card-star-btn:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: var(--gold-pale);
}
.card-star-btn.is-favorite {
  color: var(--gold);
  border-color: var(--gold);
  background: var(--gold-pale);
}
[data-theme="dark"] .card-star-btn.is-favorite,
[data-theme="dark"] .card-star-btn:hover {
  background: rgba(201,164,74,0.12);
}

/* --- Sebesség szelektor a lejátszóban --- */
.speed-select {
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  color: rgba(255,255,255,0.8);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.45rem;
  cursor: pointer;
  flex-shrink: 0;
  width: 52px;
  text-align: center;
}
.speed-select:focus {
  outline: none;
  border-color: var(--gold);
}
.speed-select option { background: var(--navy-dark); color: var(--white); }

/* --- Továbbiak gomb --- */
.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 2rem 0 0.5rem;
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.load-more-btn:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
  box-shadow: var(--shadow);
}
[data-theme="dark"] .load-more-btn {
  background: var(--navy-pale);
  color: var(--text);
  border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .load-more-btn:hover {
  background: var(--navy-light);
  color: var(--white);
  border-color: var(--navy-light);
}

/* --- Reszponzív: új elemek --- */
@media (max-width: 1200px) {
  .filters-label { display: none; }
}

@media (max-width: 1100px) {
  .fav-toggle .fav-text { display: none; }
}

@media (max-width: 900px) {
  .random-btn-text { display: none; }
  .random-btn { padding: 0.4rem 0.6rem; font-size: 1rem; }
}

@media (max-width: 768px) {
  .seasonal-section { padding: 0 1rem; }
  .seasonal-grid { grid-template-columns: 1fr; }
  .igehely-input { min-width: 130px; }
  .speed-select { display: none; } /* mobilon elrejtjük */
}

@media (max-width: 480px) {
  .seasonal-inner { padding: 1rem; }
  .seasonal-title { font-size: 1rem; }
  .card-actions { gap: 0.3rem; }
}
