:root{
  --bg:#0b0b0b; /* dunkler Hintergrund für Krimi-Feeling */
  --card:#111111;
  --text:#ffffff;
  --accent:#ff7a00; /* Orange */
  --krimi-black:#000000;
  --krimi-orange:#ff7a00;
  --muted:#bfbfbf;
}
*{box-sizing:border-box}
.site-header{
  /* Entire header in a warm orange. Subtle gradient for depth. */
  background: linear-gradient(90deg, var(--krimi-orange), #ff9a4d);
  border-bottom:1px solid rgba(0,0,0,0.08);
  position:sticky;
  top:0;
  z-index:60;
}
.site-header .header-inner{max-width:1100px; margin:0 auto; display:flex; align-items:center; gap:1.5rem; padding:2.5rem 2.5rem}
.site-header .logo{display:flex; align-items:center; gap:0.75rem; color:var(--krimi-black); text-decoration:none}
.site-header .logo img{width:180px; height:auto; background:none; padding:0; border-radius:0; box-shadow:none; filter:none}
.site-header .logo strong{display:none}
/* Header text/links: use dark text for good contrast on orange and make larger for readability */
.site-header nav{margin-left:auto}
.site-header nav a{color:var(--krimi-black); text-decoration:none; margin-left:1.2rem; font-weight:700; font-size:1.35rem}
.site-header nav a:hover{color:#fff}

/* Improve touch targets and legibility for older users */
.site-header nav a{padding:0.6rem 0.9rem; border-radius:8px}

/* Make header scale down on narrow screens to avoid layout breakage */
@media (max-width:700px){
  /* larger header padding on small screens for easier tapping */
  .site-header .header-inner{padding:1.6rem 1rem; gap:0.75rem}
  .site-header .logo img{width:140px}
  .site-header nav a{font-size:1rem; padding:0.35rem 0.5rem}
}

body{font-family:Inter, Roboto, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial; margin:0; color:var(--text); background:var(--bg);}
.hero{background:linear-gradient(180deg, rgba(0,0,0,0.2), transparent); padding:2rem 1rem;}
.hero-inner{max-width:1100px; margin:0 auto; display:flex; gap:1.5rem; align-items:center}
.bookstore-img{width:320px; height:auto; border-radius:8px; flex-shrink:0; object-fit:cover; border:1px solid rgba(255,255,255,0.06)}
.intro h1{margin:.2rem 0 .5rem 0; font-size:2rem}
.lead{margin:0; color:var(--muted); line-height:1.5}

.buchhandlung-field{position:relative}
.upload-note{font-size:.85rem; color:#444; margin-top:.5rem}
.upload-control{margin-top:.3rem}
#buch-upload{display:block; margin-top:.25rem}
.container{max-width:1100px; margin:2rem auto; padding:0 1rem}
.lesungen-section h2{margin:0 0 1rem 0}
.lesungen-list{display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:1rem}
.card{background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.05)); border-radius:8px; box-shadow:0 6px 30px rgba(0,0,0,0.6); overflow:hidden; border:1px solid rgba(255,122,0,0.06);}
.card .cover{width:100%; height:220px; object-fit:cover; display:block}
.card-body{padding:1rem; flex:1}

/* Desktop: show card as horizontal row (cover left, content right) */
@media (min-width:821px){
  /* Keep books stacked (cover above info) on larger screens as well */
  .card{display:flex;flex-direction:column;align-items:stretch}
  .card .cover{width:100%;height:260px;border-radius:6px}
  .card-body{padding:1rem 1.25rem}
}
/* Mobile: keep stacked layout */
@media (max-width:820px){
  .card{display:flex;flex-direction:column}
  .card .cover{width:100%;height:220px;border-radius:6px}
}

/* Enforce mobile stacking for cards (strong rule to override inline or other selectors) */
@media (max-width:820px){
  .card{display:flex !important;flex-direction:column !important}
  .card .cover{order:0 !important}
  .card-body{order:1 !important}
}

/* visual cue that lesung cards are clickable */
.lesungen-list .card{cursor:pointer}

/* Modal responsive rules for lesung modal (inserted by JS) */
#lesung-modal{display:none;position:fixed;inset:0;align-items:center;justify-content:center;background:rgba(0,0,0,0.75);z-index:2000;padding:2rem}
#lesung-modal > div{max-width:900px;width:100%;background:var(--card);border-radius:10px;padding:1.25rem;color:inherit;box-shadow:0 12px 30px rgba(0,0,0,0.5);position:relative}
#lesung-modal img{width:220px;height:300px;object-fit:cover;border-radius:8px;border:1px solid rgba(255,255,255,0.03)}
#lesung-modal .modal-row{display:flex;gap:1rem;align-items:flex-start}

@media (max-width:820px){
  #lesung-modal > div{padding:0.85rem}
  #lesung-modal .modal-row{flex-direction:column}
  #lesung-modal img{width:100%;height:auto;border-radius:6px}
  #lesung-modal{padding:1rem}
}

/* Spinner for modal image loading */
.modal-spinner{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:48px;height:48px;border-radius:999px;border:4px solid rgba(255,255,255,0.08);border-top-color:var(--krimi-orange);animation:spin 1s linear infinite;z-index:2100}
@keyframes spin{from{transform:translate(-50%,-50%) rotate(0deg)}to{transform:translate(-50%,-50%) rotate(360deg)}}

/* ensure modal content scrolls independently on small screens */
#lesung-modal > div{max-height:92vh;overflow:auto}
.title{margin:.2rem 0 .5rem 0; font-size:1.1rem; color:#fff}
.meta{margin:0.25rem 0; color:var(--muted); font-size:.95rem}
.desc{margin-top:.6rem; color:var(--muted)}

/* Empfehlungen (Krimi) */
.empfehlungen-section{margin-top:2rem}
.empfehlungen-list{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:1rem}
.empfehlung{display:flex; gap:0.75rem; align-items:center; padding:0.6rem; border-radius:8px; background:linear-gradient(90deg, rgba(0,0,0,0.5), rgba(10,10,10,0.6)); color:#fff; border:1px solid rgba(255,122,0,0.06)}
.empfehlung img{width:72px; height:110px; object-fit:cover; border-radius:4px; flex-shrink:0}
.card-krimi{border-left:6px solid var(--krimi-orange)}
.e-body h3{margin:0; font-size:1rem; color:#fff}
.e-author{margin:0.25rem 0 0 0; color:var(--krimi-orange); font-size:.9rem}

/* Book link styles: remove default underline and visited purple color */
.book-link, .card .title a {
  color: var(--krimi-orange);
  text-decoration: none;
}

/* Make the inline lesung-open button look like plain title text (non-distracting)
   but remain keyboard-accessible. */
.lesung-open{
  background:none;
  border:0;
  padding:0.05rem 0.15rem;
  margin:0;
  font:inherit;
  color:inherit;
  text-decoration:none;
  cursor:pointer;
  display:inline;
  line-height:1;
  -webkit-appearance:none;
  appearance:none;
}
.lesung-open:hover{ text-decoration:none; color:var(--krimi-orange); text-shadow:0 0 8px rgba(255,122,0,0.12); }
.lesung-open:focus{ outline:3px solid rgba(255,122,0,0.12); outline-offset:3px; border-radius:4px; text-shadow:0 0 10px rgba(255,122,0,0.14); }
.book-link:visited, .card .title a:visited {
  color: var(--krimi-orange);
}
.book-link:hover, .card .title a:hover {
  text-decoration: none;
  color: #ff9a4d;
  text-shadow:0 0 8px rgba(255,122,0,0.10);
}
/* Ensure any links inside cards or recommendation lists don't show default purple visited color */
.empfehlung a,
.empfehlung a:visited,
.lesungen-list a,
.lesungen-list a:visited,
.lesungen-list a:hover,
.card a,
.card a:visited,
.card a:hover,
.title a,
.title a:visited {
  color: var(--krimi-orange);
  text-decoration: none;
}
.empfehlung a:hover,
.card a:hover,
.title a:hover {
  text-decoration: none;
  color: #ff9a4d;
  text-shadow:0 0 8px rgba(255,122,0,0.10);
}
/* Global link color: override browser defaults (no purple underlines). */
/* Visited links should remain readable (use the same orange), hover shows lighter orange glow. */
a, a:visited { color: var(--krimi-orange); text-decoration: none; }
/* ensure no underlines anywhere from UA styles or other rules */
a, a:visited, a * { text-decoration: none !important; }
a:hover, a:focus { color: #ff9a4d; text-shadow:0 0 8px rgba(255,122,0,0.10); }
a:focus { outline: none; box-shadow: 0 0 0 4px rgba(255,122,0,0.08); text-shadow:0 0 10px rgba(255,122,0,0.14); }
.site-footer{padding:1rem; text-align:center; color:#666; font-size:.9rem}
.error{color:#ff6b6b}

/* Footer layout */
.site-footer{padding:1.25rem 1rem; background:linear-gradient(180deg, #050505, #0b0b0b); border-top:1px solid rgba(255,122,0,0.06);}
.site-footer .footer-inner{max-width:1100px; margin:0 auto; display:flex; align-items:center; justify-content:space-between; gap:1rem; color:var(--muted)}
.site-footer .footer-brand{color:var(--muted)}
.site-footer .footer-nav a{color:var(--muted); text-decoration:none; margin-left:1rem; font-weight:600}
.site-footer .footer-nav a:hover{color:var(--krimi-orange)}
.site-footer .footer-note{margin:0; font-size:.9rem; color:var(--muted)}

@media(min-width:900px){
  .hero-inner{padding:1rem 0}
}

/* Ensure on small screens the hero stacks: image above text, avoid horizontal scrolling */
@media (max-width:820px){
  .hero-inner{flex-direction:column;align-items:stretch}
  .bookstore-img{width:100%;height:auto;max-width:100%;border-radius:8px}
  .intro{width:100%;padding-top:0.5rem}
  html,body{overflow-x:hidden}
}
