/*
 * Favoriten – Schubladen-Test
 * Reiner Grafik-Prototyp nach der zugeschnittenen Vorlage.
 */

/* Farbvariablen für Korpus, Schubladen, Lichtkante und Seitenhintergrund */
:root {
  --cabinet-bg: #263036;
  --drawer-top: #2d383e;
  --drawer-bottom: #222c31;
  --joint-dark: #10171b;
  --joint-light: rgba(255, 255, 255, .055);
  --edge-light: #f1eee5;
  --page-bg: #cfcac7;
}

/* Einheitliches Box-Modell für alle Elemente */
* {
  box-sizing: border-box;
}

/* Grundlayout der Testseite */
body {
  margin: 0;
  background: var(--page-bg);
  font-family: Arial, Helvetica, sans-serif;
}

/* Breite und Position des gesamten Prototyps */
.fav-page {
  width: min(100%, 1150px);
  margin: 15px auto 60px;
  padding-top: 0;
}

/* Gesamter Schubladen-Korpus */

.card.intro {
  margin-bottom: 0;
}

.drawer-cabinet {
  position: relative;
  padding: 12px 14px 16px;
  background: var(--cabinet-bg);
  border: 2px solid rgba(241, 238, 229, .88);
  border-radius: 2px;

  box-shadow:
    0 8px 18px rgba(0, 0, 0, .28),
    inset 0 1px 0 rgba(255, 255, 255, .05);
}

/* Einzelne Schublade */
.drawer {
  position: relative;
  height: 60px;

  background:
    linear-gradient(to bottom,
      var(--drawer-top) 0%,
      #29343a 38%,
      var(--drawer-bottom) 100%);

  border-top: 3px solid var(--joint-dark);

  box-shadow:
    inset 0 1px 0 var(--joint-light),
    inset 0 -2px 3px rgba(0, 0, 0, .22);
}

/* Oberkante der ersten Schublade */
.drawer:first-child {
  border-top: 4px solid #172025;
}

/* Weißer Lichtabschnitt auf der Oberkante einer Schublade */
.drawer-light {
  position: absolute;
  z-index: 2;

  top: -4px;
  left: var(--light-left);
  width: var(--light-width);
  height: 4px;

  background: var(--edge-light);
  border-radius: 3px;

  box-shadow:
    0 0 2px rgba(255, 255, 255, .40),
    0 1px 1px rgba(0, 0, 0, .30);
}

/* Lichtsegmente bewusst nach dem Rhythmus der Vorlage verteilt */
.drawer-1 {
  --light-left: 4%;
  --light-width: 11%;
}

.drawer-2 {
  --light-left: 55%;
  --light-width: 20%;
}

.drawer-3 {
  --light-left: 12%;
  --light-width: 38%;
}

.drawer-4 {
  --light-left: 58%;
  --light-width: 30%;
}

.drawer-5 {
  --light-left: 25%;
  --light-width: 15%;
}

.drawer-6 {
  --light-left: 40%;
  --light-width: 41%;
}

.drawer-7 {
  --light-left: 63%;
  --light-width: 14%;
}

.drawer-8 {
  --light-left: 28%;
  --light-width: 31%;
}

.drawer-9 {
  --light-left: 74%;
  --light-width: 12%;
}

/* Eingravierte Beschriftung der Schublade */
.drawer-label {
  position: absolute;
  left: 6%;
  top: 50%;
  transform: translateY(-50%);

  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.04em;

  color: #3a474e;

  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22),
    0 -1px 1px rgba(0, 0, 0, 0.75);

  transition:
    color 0.2s ease,
    text-shadow 0.2s ease;
}

/* Dezenter Mouseover-Effekt */
.drawer:hover .drawer-label {
  color: #182126;

  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06),
    0 -1px 1px rgba(0, 0, 0, 0.90);
}

.drawer-label {
  user-select: none;
  pointer-events: none;
}

/* Untere Abschlussfuge – bleibt immer am unteren Rand des gesamten Korpus */
.drawer-cabinet::before {
  content: "";
  position: absolute;

  left: 14px;
  right: 14px;

  bottom: 13px; /* exakt derselbe Wert wie beim Lauflicht */
  height: 3px;

  background: var(--joint-dark);
}

/* Dezentes Lauflicht auf der unteren Abschlussfuge des gesamten Korpus */
.drawer-cabinet::after {
  content: "";
  position: absolute;

  left: 26px;
  bottom: 13px;

  width: 80px;
  height: 3px;

  background: radial-gradient(ellipse at center,
      rgba(255, 255, 255, 0.95) 0%,
      rgba(241, 238, 229, 0.62) 25%,
      rgba(241, 238, 229, 0.26) 50%,
      rgba(241, 238, 229, 0.08) 72%,
      rgba(241, 238, 229, 0) 100%);

  animation: drawer-runlight 14s ease-in-out infinite alternate;
}

@keyframes drawer-runlight {
  from {
    left: 26px;
  }

  to {
    left: calc(100% - 106px);
  }
}


/* Test: erste Schublade anklickbar */
.drawer-toggle {
  cursor: pointer;
}

.drawer-toggle:focus-visible {
  outline: 1px solid rgba(241, 238, 229, 0.45);
  outline-offset: -3px;
}

/* Aufklappbereich unter der ersten Schublade */
.drawer-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
}

.drawer-panel.is-open {
  grid-template-rows: 1fr;
}

.drawer-panel-inner {
  overflow: hidden;
}

/* Aufklapp-Card: Optik exakt nach der bisherigen Favoriten-Seite */
.drawer-card {
  margin: 10px 12px 13px;
  padding: 18px 24px;

  background: linear-gradient(145deg, #dcd9d7, #d2cfcc);
  color: #2a1b18;
  font-family: system-ui, sans-serif;

  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

/* Rubriküberschrift wie bisher bei .favorite-card h3 */
.drawer-card h2 {
  margin: 0 0 14px;
  color: #6B140D;
  font-size: 17px;
  text-align: center;
}

/* Einzelne Favoriten-Einträge */
.drawer-card .favorite-item {
  padding: 12px 0;
  border-top: 1px solid rgba(42, 27, 24, 0.16);
}

.drawer-card .favorite-item:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.drawer-card .favorite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.drawer-card .favorite-name {
  min-width: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.drawer-card .favorite-item .excerpt {
  margin: 5px 0 0;
  font-size: 14px;
}

/* Buttons exakt nach der bisherigen Favoriten-Seite */
.drawer-card .favorite-button {
  display: inline-block;
  flex: 0 0 auto;
  padding: 5px 11px;
  border: 1px solid rgba(107, 20, 13, 0.45);
  border-radius: 7px;
  background: linear-gradient(to bottom, #ece9e7, #d8d3d0);
  color: #6B140D;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(42, 27, 24, 0.18);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.drawer-card .favorite-button:hover,
.drawer-card .favorite-button:focus-visible {
  background: linear-gradient(to bottom, #f4f1ef, #e0dbd8);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(42, 27, 24, 0.22);
  text-decoration: none;
}


/* Anpassung für kleinere Bildschirme */
@media (max-width: 600px) {
  .fav-page {
    width: calc(100% - 20px);
    margin: 20px auto;
  }

  .drawer {
    height: 48px;
  }
}