/* ============================================================
   BIENNOISERIE.CH — Global Stylesheet
   ============================================================ */

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Spartan', system-ui, sans-serif;
  font-weight: 300;
  color: #3a2e2a;
  background-image: url('media/hintergrund300.png');
  background-repeat: repeat;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #3a2e2a;
  text-decoration: none;
}

a:hover {
  opacity: 0.7;
}

/* ── HEADER ───────────────────────────────────────────────── */
.site-header {
  text-align: center;
  padding: 40px 20px 20px;
}

.site-header img.header-banner {
  max-width: 900px;
  width: 90%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* ── HEADER LINK ──────────────────────────────────────────── */
.site-header h2 {
  margin: 10px auto 0;
  max-width: 900px;
  width: 90%;
  font-size: clamp(0.6rem, 2.2vw, 1.05rem);
  font-weight: 300;
  line-height: 1.4;
  text-align: center;
}

.site-header h2 a {
  color: #3a2e2a;
}

/* ── FOOTER ───────────────────────────────────────────────── */
.footer-logo-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 10px;
}

.footer-logo-btn {
  display: block;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

.footer-logo-btn img {
  width: 120px;
  height: auto;
  display: block;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.footer-logo-btn:hover img {
  opacity: 1;
}

.footer-copyright {
  display: block;
  font-size: 13px;
  color: #888;
  letter-spacing: 0.5px;
}

/* ── MAIN ─────────────────────────────────────────────────── */
main {
  flex: 1;
}

/* ── GALERIE ──────────────────────────────────────────────── */
.gallery {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 50px;
  padding: 20px 20px 60px;
}

.gallery img {
  display: block;
  max-width: 900px;
  width: 90%;
  height: auto;
}

.site-footer {
  color: #888;
  text-align: center;
  padding: 18px 20px;
  font-size: 13px;
  letter-spacing: 0.5px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── ADMIN — CONTAINER ────────────────────────────────────── */
.admin-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

.admin-wrap h1 {
  font-weight: 300;
  letter-spacing: 2px;
  font-size: 22px;
  margin-bottom: 6px;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  font-size: 14px;
}

.admin-nav a {
  color: #888;
}

.admin-nav a:hover {
  color: #3a2e2a;
}

/* ── ADMIN — LOGIN ────────────────────────────────────────── */
.login-box {
  max-width: 340px;
  margin: 80px auto;
  background: rgba(255,255,255,0.85);
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 40px 30px;
  text-align: center;
}

.login-box h2 {
  font-weight: 300;
  letter-spacing: 2px;
  margin-bottom: 24px;
  font-size: 20px;
}

.login-box input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
  font-size: 15px;
  margin-bottom: 14px;
  outline: none;
}

.login-box input[type="password"]:focus {
  border-color: #3a2e2a;
}

/* ── ADMIN — UPLOAD FORM ──────────────────────────────────── */
.upload-form {
  background: rgba(255,255,255,0.75);
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.upload-form label {
  font-size: 14px;
  color: #555;
}

/* ── ADMIN — GRID ─────────────────────────────────────────── */
.admin-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: flex-start;
  align-items: flex-start;
}

/* ── ADMIN — ITEM ─────────────────────────────────────────── */
.admin-item {
  width: 160px;
  background: rgba(255,255,255,0.88);
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px;
  cursor: grab;
  touch-action: none;
  transition: transform 0.15s, box-shadow 0.15s;
  user-select: none;
}

.admin-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 3px;
  margin-bottom: 8px;
}

.admin-item:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

.admin-item.dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.admin-item.marked-delete {
  opacity: 0.3;
  border: 2px solid #c0392b;
  background: #fff0ee;
}

.item-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-top: 6px;
}

.item-controls label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.delete-label {
  color: #c0392b;
  font-size: 16px;
  cursor: pointer;
}

/* ── ADMIN — ACTIONS ──────────────────────────────────────── */
.admin-actions {
  margin-top: 28px;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 10px 22px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 1px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-dark {
  background: #3a2e2a;
  color: #fff;
}

.btn-dark:hover {
  opacity: 0.8;
}

.btn-outline {
  background: transparent;
  border: 1px solid #3a2e2a;
  color: #3a2e2a;
}

.btn-outline:hover {
  background: #3a2e2a;
  color: #fff;
}

/* ── TOPLINK (hidden admin link on gallery) ───────────────── */
.toplink {
  position: fixed;
  bottom: 18px;
  right: 20px;
  z-index: 100;
}

.toplink a {
  color: rgba(58,46,42,0.25);
  font-size: 12px;
  letter-spacing: 1px;
}

.toplink a:hover {
  color: rgba(58,46,42,0.7);
}

/* ── MOBILE ───────────────────────────────────────────────── */
@media (max-width: 600px) {

  .site-header {
    padding: 28px 16px 14px;
  }

  .site-header img.header-banner {
    width: 90%;
  }

  .gallery {
    gap: 30px;
    padding-bottom: 40px;
  }

  .gallery img {
    width: 95%;
  }

  .admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .admin-item {
    width: 100%;
  }

  .admin-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
    text-align: center;
    padding: 13px;
    font-size: 15px;
  }

  .upload-form {
    flex-direction: column;
    align-items: stretch;
  }

  input[type="file"] {
    width: 100%;
  }
}
