/* =========================================
   CHRONIK PAGE
   ========================================= */

.chronik-hero {
  padding: 52px 20px 24px;
  text-align: center;
  background: radial-gradient(circle at 50% -20%, rgba(48,159,106,0.16) 0%, transparent 60%), #0a0a0f;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.chronik-hero h2 {
  margin: 0;
  color: #fff;
  font-size: 2.45rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 1000;
  text-shadow: 0 0 20px rgba(48,159,106,0.35);
}
.chronik-hero p {
  margin: 10px 0 0;
  color: #aaa;
  font-size: 1.05rem;
}

.chronik-wrap{
  max-width: 1100px;
  margin: 28px auto 40px;
  padding: 0 18px;
}

.chronik-msg{ margin-bottom: 18px; }
.chronik-msg-delete{
  background: rgba(227,41,46,0.1);
  border-color: var(--dart-red);
}

.chronik-top-actions{
  text-align: right;
  margin-bottom: 16px;
}
.chronik-add-btn{
  padding: 10px 24px;
  background: rgba(48,159,106,0.12);
  color: var(--dart-green);
  border-color: var(--dart-green);
}

.chronik-empty{
  text-align:center;
  padding: 48px;
  border: 1px dashed #333;
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
}
.chronik-empty .icon{
  font-size: 2.8rem;
  opacity: .55;
  margin-bottom: 8px;
}
.chronik-empty p{ color:#888; margin:0; font-size:1.06rem; }

/* ===== Timeline ===== */
.timeline{
  position: relative;
  padding: 8px 0 8px;
}
.timeline::before{
  content:'';
  position:absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, rgba(48,159,106,.35), rgba(48,159,106,.12));
  border-radius: 999px;
}

.timeline-item{
  position: relative;
  width: 50%;
  padding: 10px 24px 22px;
  box-sizing: border-box;
}
.timeline-item.left{ left: 0; }
.timeline-item.right{ left: 50%; }

.timeline-item .dot{
  position: absolute;
  top: 26px;
  width: 14px; height:14px;
  border-radius: 50%;
  background: #0a0a0f;
  border: 3px solid var(--dart-green);
  box-shadow: 0 0 0 5px rgba(48,159,106,0.18);
}
.timeline-item.left .dot{ right: -8px; }
.timeline-item.right .dot{ left: -8px; }

.timeline-item .card{
  position: relative;
  background: linear-gradient(145deg, rgba(20,20,25,0.85), rgba(15,15,20,0.95));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 16px 16px 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
  transition: transform .2s ease, border-color .2s ease;
}
.timeline-item .card:hover{
  transform: translateY(-2px);
  border-color: rgba(48,159,106,.35);
}

.timeline-item .date{
  display:inline-block;
  font-size: .78rem;
  color: var(--dart-green);
  background: rgba(48,159,106,.12);
  border: 1px solid rgba(48,159,106,.28);
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 800;
  letter-spacing: .6px;
  margin-bottom: 8px;
}
.timeline-item h3{
  margin: 0 0 8px;
  color:#fff;
  font-size: 1.24rem;
  font-weight: 1000;
  line-height: 1.25;
}
.timeline-item p{
  margin: 0 0 10px;
  color:#aaa;
  line-height: 1.5;
  font-size: .95rem;
}

.chip-gallery{
  margin-top: 10px;
  display:inline-block;
  font-size:.75rem;
  font-weight:900;
  border-radius: 999px;
  padding: 5px 10px;
  color: #fbbf24;
  border:1px solid rgba(251,191,36,.35);
  background: rgba(251,191,36,.10);
}

/* ===== Card Admin ===== */
.admin-actions{
  position: absolute;
  top: 10px; right: 10px;
  display: flex;
  gap: 6px;
  background: rgba(0,0,0,.45);
  border:1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: 4px;
  z-index: 5;
}
.admin-btn{
  width: 28px; height: 28px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color:#fff;
  text-decoration:none;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  font-size: .95rem;
  opacity:.8;
}
.admin-btn:hover{ opacity:1; background: rgba(255,255,255,.08); }
.admin-btn.del:hover{ color: var(--dart-red); }

.inline-form{ margin:0; }

/* ===== Image grid (same vibe as galerie) ===== */
.post-images-grid {
  display: grid;
  gap: 2px;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  margin-top: 6px;
}
.post-images-grid[data-count="1"] { grid-template-columns: 1fr; }
.post-images-grid[data-count="2"],
.post-images-grid[data-count="4"],
.post-images-grid[data-count="more"] { grid-template-columns: 1fr 1fr; }
.post-images-grid[data-count="3"] { grid-template-columns: 1fr 1fr; }
.post-images-grid[data-count="3"] .img-wrap:first-child {
  grid-column: span 2;
  aspect-ratio: 21/9;
}
.img-wrap{
  position: relative;
  overflow:hidden;
  aspect-ratio: 4/3;
  cursor:pointer;
}
.img-wrap img{
  width:100%; height:100%; object-fit:cover;
  transition: transform .4s ease, filter .25s ease;
}
.img-wrap:hover img{
  transform: scale(1.06);
  filter: brightness(1.08);
}
.more-overlay{
  position:absolute; inset:0;
  background: rgba(0,0,0,.55);
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-size:1.8rem; font-weight:1000;
}

/* ===== Modals / Forms ===== */
.modal-overlay{
  display:none;
  position: fixed;
  inset:0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(5px);
  z-index: 10000;
  justify-content:center;
  align-items:center;
  padding: 12px;
}
.modal-box{
  width:100%;
  max-width: 560px;
  background:#111;
  border:1px solid rgba(255,255,255,.12);
  border-top: 3px solid var(--dart-green);
  border-radius: 14px;
  padding: 22px;
  max-height: 86vh;
  overflow-y:auto;
}
.modal-box h3{
  color:#fff;
  margin:0 0 10px;
  font-size:1.35rem;
}
.modal-box label{
  display:block;
  margin: 13px 0 5px;
  color:#aaa;
  font-size:.82rem;
  text-transform:uppercase;
  letter-spacing:1px;
  font-weight:900;
}
.modal-box input[type="text"],
.modal-box input[type="datetime-local"],
.modal-box input[type="file"],
.modal-box textarea{
  width:100%;
  box-sizing:border-box;
  border-radius: 10px;
  border:1px solid #333;
  background:#0b0b10;
  color:#fff;
  padding: 11px 12px;
}
.modal-box textarea{ resize: vertical; min-height: 94px; }

.modal-actions{
  display:flex;
  gap:10px;
  margin-top: 16px;
}
.modal-actions .btn.main{ flex:2; }
.modal-actions .btn.alt{
  flex:1;
  background:#333;
  border-color:#444;
  text-align:center;
  text-decoration:none;
}

.chronik-switch{
  margin-top: 12px !important;
  display:flex !important;
  align-items:center;
  gap:10px;
  text-transform:none !important;
  letter-spacing:0 !important;
  font-size:.95rem !important;
  color:#ddd !important;
  font-weight:700 !important;
}
.chronik-switch input[type="checkbox"]{
  width:18px; height:18px;
}

/* Edit panel */
.chronik-edit-panel{
  background: linear-gradient(145deg, rgba(227,41,46,0.10), rgba(17,17,17,1));
  border:1px solid rgba(227,41,46,.35);
  border-radius: 16px;
  padding: 16px;
  margin: 6px 0 18px;
  box-shadow: 0 12px 28px rgba(0,0,0,.4);
}
.chronik-edit-panel h3{
  margin:0 0 10px;
  color:#fff;
}
.chronik-form .grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}

/* Edit existing images box */
.edit-current-box{
  margin-top: 10px;
  background:#0a0a0f;
  border:1px solid #333;
  border-radius: 12px;
  padding: 12px;
}
.edit-current-box label.no-top{ margin-top:0; }

.edit-current-grid{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:8px;
}
.edit-thumb{
  width:72px; height:72px;
  border-radius: 8px;
  overflow:hidden;
  position:relative;
}
.edit-thumb img{
  width:100%; height:100%; object-fit:cover; opacity:.75;
}
.edit-thumb-delete{
  position:absolute !important;
  inset:0;
  margin:0 !important;
  background: rgba(227,41,46,.82);
  color:#fff !important;
  display:flex !important;
  align-items:center;
  justify-content:center;
  gap:5px;
  text-transform:none !important;
  letter-spacing:0 !important;
  font-size:.75rem !important;
  opacity:0;
  cursor:pointer;
}
.edit-thumb:hover .edit-thumb-delete{ opacity:1; }

/* ===== Lightbox ===== */
#lightbox{
  display:none;
  position: fixed;
  inset:0;
  z-index: 11000;
  background: rgba(0,0,0,.94);
  backdrop-filter: blur(8px);
}
#lightbox-img{
  max-width: 90vw;
  max-height: 84vh;
  position:absolute;
  top:50%; left:50%;
  transform: translate(-50%,-50%);
  border-radius:10px;
  box-shadow: 0 0 42px rgba(0,0,0,.75);
}
.lb-close{
  position:absolute;
  right:28px; top:16px;
  font-size:40px;
  color:#fff;
  cursor:pointer;
}
.lb-prev, .lb-next{
  position:absolute;
  top:50%;
  transform: translateY(-50%);
  font-size: 34px;
  color:#fff;
  cursor:pointer;
  padding: 14px;
  user-select:none;
}
.lb-prev{ left:18px; }
.lb-next{ right:18px; }
#lb-counter{
  position:absolute;
  bottom: 20px;
  left:50%;
  transform: translateX(-50%);
  color:#bbb;
  letter-spacing:2px;
  font-weight:900;
}

/* ========= LIGHT MODE ========= */
html[data-theme="light"] .chronik-hero{
  background: radial-gradient(circle at 50% -20%, rgba(48,159,106,.10) 0%, transparent 60%), #f6f9ff;
  border-bottom:1px solid #d8e3f2;
}
html[data-theme="light"] .chronik-hero h2{
  color:#0f172a;
  text-shadow:none;
}
html[data-theme="light"] .chronik-hero p{ color:#64748b; }

html[data-theme="light"] .chronik-empty{
  background:#f8fbff;
  border-color:#d6e1ef;
}
html[data-theme="light"] .chronik-empty p{ color:#64748b; }

html[data-theme="light"] .timeline::before{
  background: linear-gradient(to bottom, rgba(22,163,74,.35), rgba(22,163,74,.12));
}
html[data-theme="light"] .timeline-item .dot{
  background:#fff;
  border-color:#16a34a;
  box-shadow: 0 0 0 5px rgba(22,163,74,.15);
}
html[data-theme="light"] .timeline-item .card{
  background: linear-gradient(145deg, #ffffff, #f8fbff);
  border-color:#d6e1ef;
  box-shadow: 0 10px 24px rgba(15,23,42,.09);
}
html[data-theme="light"] .timeline-item .card:hover{ border-color:#9bc8ae; }
html[data-theme="light"] .timeline-item .date{
  background:#e8f7ef;
  border-color:#8ac6a6;
  color:#14532d;
}
html[data-theme="light"] .timeline-item h3{ color:#0f172a; }
html[data-theme="light"] .timeline-item p{ color:#475569; }

html[data-theme="light"] .chip-gallery{
  color:#92400e;
  border-color: rgba(245,158,11,.4);
  background: rgba(245,158,11,.14);
}

html[data-theme="light"] .admin-actions{
  background: rgba(255,255,255,.85);
  border-color:#d6e1ef;
}
html[data-theme="light"] .admin-btn{
  color:#0f172a;
}
html[data-theme="light"] .admin-btn:hover{
  background:#eef3fb;
}

html[data-theme="light"] .post-images-grid{
  background:#dbe5f2;
  border-color:#d6e1ef;
}
html[data-theme="light"] .more-overlay{
  background: rgba(15,23,42,.45);
}

html[data-theme="light"] .modal-overlay{
  background: rgba(15,23,42,.55);
}
html[data-theme="light"] .modal-box{
  background:#fff;
  border-color:#d6e1ef;
}
html[data-theme="light"] .modal-box h3{ color:#0f172a; }
html[data-theme="light"] .modal-box label{ color:#475569; }
html[data-theme="light"] .modal-box input[type="text"],
html[data-theme="light"] .modal-box input[type="datetime-local"],
html[data-theme="light"] .modal-box input[type="file"],
html[data-theme="light"] .modal-box textarea{
  background:#f8fbff;
  border-color:#cfdced;
  color:#0f172a;
}
html[data-theme="light"] .chronik-switch{ color:#0f172a !important; }
html[data-theme="light"] .modal-actions .btn.alt{
  background:#eef3fb;
  border-color:#bfd0e6;
  color:#0f172a;
}

html[data-theme="light"] .chronik-edit-panel{
  background: linear-gradient(145deg, #fff1f2, #ffffff);
  border-color:#fca5a5;
}
html[data-theme="light"] .chronik-edit-panel h3{ color:#0f172a; }

html[data-theme="light"] .edit-current-box{
  background:#f8fbff;
  border-color:#d6e1ef;
}

/* ========= Responsive ========= */
@media (max-width: 900px){
  .timeline::before{
    left: 18px;
    transform:none;
  }
  .timeline-item,
  .timeline-item.left,
  .timeline-item.right{
    left:0;
    width:100%;
    padding-left: 44px;
    padding-right: 4px;
  }
  .timeline-item .dot{
    left: 11px !important;
    right:auto !important;
  }
}

@media (max-width: 640px){
  .chronik-hero h2{ font-size:2rem; }
  .chronik-wrap{ padding: 0 12px; }
  .chronik-form .grid2{ grid-template-columns: 1fr; }
  .modal-actions{ flex-direction:column; }
}