/* MS Cloud Feed — mobile-first styles */

:root {
  --bg: #0b0f16;
  --bg-raised: #131926;
  --bg-card: #161d2c;
  --border: #1c2333;
  --border-quiet: #171d2b;
  --text: #e7ecf5;
  --text-dim: #9aa7bd;
  --accent: #4fa3ff;
  --accent-dim: #2c6cb8;
  --red: #ff5c6c;
  --amber: #f5a623;
  --green: #38c172;
  --radius: 10px;
  --max-width: 1360px;
  --header-height: 140px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: var(--accent);
}

/* ---------------------------------------------------------------- */
/* Header */
/* ---------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 16px;
}

.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-header__brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.site-header__name {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  white-space: nowrap;
}

.site-header__unofficial {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.site-header__subtitle {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.site-header__meta {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px 3px 8px;
}

.status-pill:hover {
  border-color: var(--accent-dim);
  color: var(--text);
}

.status-pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.status-pill--advisory .status-pill__dot {
  background: var(--amber);
}

.status-pill--incident .status-pill__dot {
  background: var(--red);
}

.filters-toggle {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 16px;
  background: var(--accent-dim);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.filters-toggle:hover {
  background: var(--accent);
}

/* ---------------------------------------------------------------- */
/* Layout */
/* ---------------------------------------------------------------- */

.layout {
  display: block;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Filters panel: bottom sheet on mobile, sticky sidebar on desktop */

.filters-panel {
  position: fixed;
  inset: auto 0 0 0;
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  background: var(--bg-raised);
  border-top: 1px solid var(--border-quiet);
  border-radius: 16px 16px 0 0;
  z-index: 30;
  transform: translateY(100%);
  transition: transform 0.2s ease;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
}

.filters-panel::-webkit-scrollbar {
  display: none;
}

.filters-panel--open {
  transform: translateY(0);
}

.filters-panel__inner {
  padding: 16px;
}

.filter-group {
  margin-bottom: 20px;
}

.filter-group__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

#search-input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
}

#search-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.more-filters {
  margin-bottom: 20px;
  border-top: 1px solid var(--border-quiet);
  padding-top: 14px;
}

.more-filters__summary {
  list-style: none;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-dim);
}

.more-filters__summary::-webkit-details-marker {
  display: none;
}

.more-filters__summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.15s ease;
  color: var(--accent);
}

.more-filters[open] > .more-filters__summary::before {
  transform: rotate(90deg);
}

.more-filters__summary:hover {
  color: var(--text);
}

.more-filters__content {
  padding-top: 14px;
}

.more-filters__content .filter-group:last-child {
  margin-bottom: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  color: var(--text-dim);
  flex-shrink: 0;
}

.chip:hover {
  border-color: var(--accent-dim);
}

.chip--active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: #fff;
}

.chip__input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.chip--static {
  min-height: auto;
  padding: 2px 10px;
  font-size: 0.72rem;
  cursor: default;
  color: var(--text-dim);
}

.chip--product {
  border-style: dashed;
}

.show-hidden-toggle {
  display: block;
  width: 100%;
  min-height: 40px;
  margin-bottom: 20px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 0.82rem;
  cursor: pointer;
}

.show-hidden-toggle:hover {
  color: var(--text);
  border-color: var(--accent-dim);
}

.show-hidden-toggle--active {
  color: var(--text);
  border-color: var(--accent);
  border-style: solid;
}

.filter-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.btn {
  flex: 1;
  min-height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.btn--primary {
  background: var(--accent-dim);
  color: #fff;
  border-color: var(--accent);
}

.btn--primary:hover {
  background: var(--accent);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--accent);
}

.save-confirm {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--green);
  min-height: 1.2em;
}

/* ---------------------------------------------------------------- */
/* Feed / cards */
/* ---------------------------------------------------------------- */

.feed {
  padding: 16px;
  padding-bottom: 96px; /* keep last card clear of the fixed filters button */
}

.empty-state {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-dim);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-quiet);
  border-left: 3px solid var(--border-quiet);
  border-radius: var(--radius);
  padding: 18px;
  width: 100%;
}

.card--retirement {
  border-left-color: var(--red);
}

.card--incident {
  border-left-color: var(--red);
  background: linear-gradient(180deg, rgba(255, 92, 108, 0.08), var(--bg-card) 40px);
}

.card--advisory {
  border-left-color: var(--amber);
}

.card--healthy {
  border-left-color: var(--green);
}

.card__meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid currentColor;
}

.badge--retirement {
  color: var(--red);
}

.badge--preview {
  color: var(--amber);
}

.badge--ga {
  color: var(--green);
}

.badge--severity-action {
  color: var(--red);
}

.badge--severity-important {
  color: var(--accent);
}

.card__title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  line-height: 1.35;
}

.card__title a {
  color: var(--text);
  text-decoration: none;
}

.card__title a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.card__summary {
  margin: 0 0 12px;
  font-size: 0.92rem;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 4.4em;
}

.card__quiet-line {
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.card__quiet-line strong {
  color: var(--text);
  font-weight: 600;
}

.card__quiet-line--retire {
  color: var(--amber);
}

.card__topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.card__actions {
  display: flex;
  gap: 16px;
  margin-top: 4px;
}

.card__action-btn {
  background: none;
  border: none;
  padding: 4px 0;
  min-height: 32px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.card__action-btn:hover {
  color: var(--accent);
}

.card__action-btn--active {
  color: var(--accent);
}

.card--hidden {
  opacity: 0.55;
}

/* ---------------------------------------------------------------- */
/* Footer */
/* ---------------------------------------------------------------- */

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px 40px;
  font-size: 0.78rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}

.site-footer p {
  margin: 0 0 6px;
}

/* ---------------------------------------------------------------- */
/* Desktop layout (>= 900px): sticky sidebar instead of bottom sheet */
/* ---------------------------------------------------------------- */

@media (min-width: 900px) {
  .filters-toggle {
    display: none;
  }

  .site-header__inner {
    padding: 12px 24px;
  }

  .layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    align-items: start;
    gap: 28px;
    padding: 0 24px;
  }

  .filters-panel {
    position: sticky;
    inset: auto;
    top: var(--header-height);
    transform: none;
    max-height: calc(100vh - var(--header-height) - 16px);
    overflow-x: hidden;
    background: var(--bg-raised);
    border: 1px solid var(--border-quiet);
    border-radius: var(--radius);
    box-shadow: none;
    z-index: 10;
  }

  .feed {
    padding: 16px 0;
  }

  .card {
    padding: 20px 22px;
  }
}
