/* ============================================================
   GLOBAL & THEME (From former style.css)
   ============================================================ */
   :root {
    --bg: #ffffff;
    --fg: #131313;
    --border: #131313;
    --border-muted: #cccccc;
  }
  
  [data-theme="dark"] {
    --bg: #111111;
    --fg: #e0e0e0;
    --border: #555555;
    --border-muted: #444444;
  }
  
  * {
    font-family: monospace;
    box-sizing: border-box;
  }
  
  html, body {
    height: 100%;
    margin: 0;
  }
  
  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg);
    color: var(--fg);
  }
  
  a {
    color: var(--fg);
    text-decoration: none;
  }
  
  a:hover {
    text-decoration: underline;
  }
  
  /* ============================================================
   LAYOUT STRUCTURE
   ============================================================ */
   
  #main-content {
    padding: 20px;
  }
  
  /* ============================================================
     HOMEPAGE COMPONENTS
     ============================================================ */
  .main-header {
    border-bottom: 1px solid var(--border);
    width: 100%;
    padding: 0px 20px;
  }
  
  .title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content; /* Shrinks the flex container width to the exact text edge */
  }

  /* Strip default h2 margins that pad out the row's height */
  .title-row h2,
  #greeting {
      width: fit-content;
  }

  /* Tighten the signoff text right below it as well */
  #signoff {
      width: fit-content;
  }
  
  #theme-toggle {
    position: fixed;
    top: 10px;
    right: 10px;
    background: none;
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 2px 6px;
    color: var(--fg);
  }
  
  /* ============================================================
     EXISTING INDEX SPECIFIC STYLES
     ============================================================ */
     #ascii-header {
      font-size: clamp(5px, 1.55vw, 14px);
      color: var(--fg);
      padding: 0px;
      margin: 0;
      line-height: 1.1;
      white-space: pre;
      overflow-x: auto;
  }
  
  #header-title-fallback { display: none; }
  #ascii-header-mobile { display: none; }
  
  @media (max-width: 600px) {
    body.sidebar-open #ascii-header { display: none; }
    body.sidebar-open #ascii-header-mobile { display: block; }
    body.sidebar-open #ascii-alis {
        font-size: clamp(3px, 1.55vw, 13px);
        white-space: pre;
        line-height: 1.1;
        color: var(--fg);
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }
    body.sidebar-open #ascii-homepage {
        font-size: clamp(3px, 1.55vw, 7px);
        white-space: pre;
        line-height: 1.1;
        color: var(--fg);
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }
}


  
  #clock {
      margin-right: auto;
      border: 1px solid var(--border);
      padding: 2px;
  }
  
  /* SEARCH HELP DETAILS */
  .search-help {
      margin-top: 16px;
      width: fit-content;
  }
  
  .search-help-summary {
      cursor: pointer;
      user-select: none;
      list-style: none !important;
      width: fit-content;
  }
  
  .search-help-table {
      margin-top: 8px;
      border-collapse: collapse;
      font-size: 0.9em;
      width: fit-content;
  }
  
  .search-help-table th {
      text-align: left;
      padding: 2px 12px 2px 0;
      border-bottom: 1px solid var(--border);
      width: fit-content;
    }
  
  .search-help-table td {
      padding: 2px 12px 2px 0;
      width: fit-content;
  }
  
  .search-help-usage {
      font-size: 0.85em;
      opacity: 0.6;
      margin-top: 10px;
      width: fit-content;
  }
  
  #ascii-footer {
      display: block;
      width: fit-content;
      min-height: 50px;
      white-space: pre;
      overflow-x: auto;
      color: inherit; 
  }

  #ascii-footer::-webkit-scrollbar {
      display: none;
  }

.main-footer {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  margin-top: auto;
  word-break: break-word;
}

.main-footer p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0 0 8px 0;
}

/* GITHUB UPDATE COMPONENT */
#github-update.update-component,
.update-component {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 0px;
  width: auto;
  padding: 4px 8px;
  margin: 0;
  line-height: 1.15;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-left: 4px solid var(--fg);
  font-size: 0.85rem;
}

#github-update .label,
.update-component .label {
  font-weight: bold;
  text-transform: uppercase;
  flex-shrink: 0;
  line-height: 1.15;
}

#github-update #commit-message,
#github-update #commit-date {
  line-height: 1.15;
}

  .home-button {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100;
  }
  
  .home-button img {
    width: 18px;
    height: 18px;
    vertical-align: -2px;
    image-rendering: pixelated;
  }
  
  @media (max-width: 600px) {
    #github-update.update-component,
    .update-component {
      display: inline-flex;
      flex-direction: row;
      flex-wrap: wrap;
      align-items: center;
      gap: 2px 6px;
      margin: 4px 0 0 0;
      padding: 3px 6px;
      width: auto;
      line-height: 1.1;
      font-size: 0.8rem;
  }

    #github-update.update-component *,
    .update-component * {
      line-height: 1.1;
  }
}

  .search-help,
  #favorites-bar details,
  #profile-section,
  #main-content h1,
  #main-content h2,
  #main-content p {
    width: fit-content;
}

.dancer {
    display: inline-block;
    white-space: pre;
    font-family: monospace;
}

/* ============================================================
   WEATHER WIDGET & 24H DROPDOWN
   ============================================================ */
#weather-widget {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  padding: 2px 6px;
  font-size: 0.95em;
  width: fit-content;
  background: var(--bg);
  color: var(--fg);
  position: relative;
}

#weather-display {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

#weather-display:hover,
#weather-toggle-arrow:hover {
  text-decoration: underline;
}

#weather-toggle-arrow {
  cursor: pointer;
  user-select: none;
  font-weight: bold;
}

/* Das Dropdown im festen Spalten-Raster */
.weather-dropdown {
  position: absolute;
  top: 100%;
  left: -1px;
  right: -1px;
  margin-top: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 6px 8px;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.forecast-title {
  font-size: 0.8em;
  text-transform: uppercase;
  margin-bottom: 6px;
  border-bottom: 1px dashed var(--border-muted);
  padding-bottom: 2px;
  opacity: 0.8;
}

.forecast-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Exakte Spalten-Ausrichtung: Uhrzeit | Temperatur | Zustand */
.forecast-item {
  display: grid;
  grid-template-columns: 75px 55px 75px;
  align-items: center;
  font-size: 0.85em;
}

.forecast-time {
  opacity: 0.7;
  white-space: nowrap;
}

.forecast-temp {
  font-weight: bold;
  text-align: right;
  padding-right: 6px;
}

.forecast-cond {
  opacity: 0.8;
  text-align: left;
  white-space: nowrap;
}

.weather-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#weather-city-input {
  background: var(--bg);
  color: var(--fg);
  border: none;
  border-bottom: 1px solid var(--border);
  font-family: monospace;
  font-size: 0.95em;
  width: 120px;
  padding: 0 2px;
  outline: none;
}

.weather-btn {
  background: none;
  color: var(--fg);
  border: 1px solid var(--border);
  font-family: monospace;
  font-size: 0.85em;
  padding: 1px 5px;
  cursor: pointer;
}

.weather-btn:hover {
  background: var(--fg);
  color: var(--bg);
}

.weather-status {
  white-space: nowrap;
  opacity: 0.7;
}

/* Mobile Optimierung */
@media (max-width: 600px) {
  .title-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  #weather-widget {
    margin-top: 2px;
  }
}

/* ============================================================
   WEATHER AUTOCOMPLETE SUGGESTIONS
   ============================================================ */
.weather-form-wrapper {
  position: relative;
  display: inline-block;
}

.weather-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  z-index: 300;
  max-height: 150px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.suggestion-item {
  padding: 4px 6px;
  font-size: 0.85em;
  cursor: pointer;
  white-space: nowrap;
  color: var(--fg);
}

.suggestion-item:hover {
  background: var(--fg);
  color: var(--bg);
}