:root {
  --blue-900: #172554;
  --blue-800: #1e40af;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-100: #dbeafe;
  --blue-50:  #eff6ff;
  --bg: #f0f4fa;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(23, 37, 84, .06), 0 1px 3px rgba(23, 37, 84, .08);
  --shadow-md: 0 4px 14px rgba(23, 37, 84, .10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* garante que o atributo hidden vence qualquer display declarado abaixo
   (.source-link e .meal-switch button têm display próprio) */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1200px 400px at 50% -100px, var(--blue-100) 0%, transparent 70%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ---------- Topbar ---------- */
.topbar {
  background: linear-gradient(135deg, var(--blue-800) 0%, var(--blue-600) 60%, #3b82f6 100%);
  color: #fff;
  padding: 18px 20px 46px;
}
.topbar-inner {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-icon {
  font-size: 30px;
  background: rgba(255,255,255,.16);
  width: 54px; height: 54px;
  display: grid; place-items: center;
  border-radius: 16px;
  backdrop-filter: blur(4px);
}
.brand h1 { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }

/* seletor de campus (no lugar do subtítulo) */
.campus-wrap { display: block; margin-top: 3px; }
#campus-select {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: #fff;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23ffffff' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 11px center,
    rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  padding: 5px 30px 5px 13px;
  cursor: pointer;
  transition: background-color .15s ease;
}
#campus-select:hover { background-color: rgba(255,255,255,.24); }
#campus-select option { color: var(--text); background: var(--card); }
#campus-select:focus-visible { outline: 2px solid rgba(255,255,255,.7); outline-offset: 2px; }

.source-link {
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  background: rgba(255,255,255,.14);
  padding: 9px 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background .15s ease;
  backdrop-filter: blur(4px);
}
.source-link:hover { background: rgba(255,255,255,.26); }
.source-link .arrow { font-size: 12px; }

.status-banner {
  max-width: 780px;
  margin: 12px auto 0;
  font-size: 13px;
  background: rgba(255,255,255,.16);
  border-radius: 10px;
  padding: 8px 14px;
  backdrop-filter: blur(4px);
}

/* ---------- Abas de dias ---------- */
.day-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 20px;
  margin-top: -32px;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.day-tab {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  border-radius: 14px;
  padding: 9px 18px;
  min-width: 86px;
  cursor: pointer;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  white-space: nowrap;
  font-family: inherit;
}
.day-tab:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.day-tab.active {
  background: linear-gradient(160deg, var(--blue-700), var(--blue-600));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .35);
}
.day-tab .dow { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
.day-tab .dom { display: block; font-size: 19px; font-weight: 700; }

/* ---------- Container / refeições ---------- */
.container { max-width: 820px; margin: 0 auto; padding: 0 20px; }

.meal-switch {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 22px 0 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
/* se as abas transbordarem, centraliza de forma "segura": o corte fica na
   direita (rolável), nunca na esquerda — centro fixo corta dos dois lados
   e o lado esquerdo fica inacessível */
@supports (justify-content: safe center) {
  .meal-switch { justify-content: safe center; }
}
.meal-switch button {
  flex: 1 1 0;
  min-width: 120px;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 13px 10px;
  font-size: 14.5px;
  font-family: inherit;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: color .12s ease, background .12s ease;
  white-space: nowrap;
}
.meal-switch button:hover { color: var(--text); background: var(--blue-50); }
.meal-switch button.active {
  color: var(--blue-700);
  border-bottom-color: var(--blue-600);
  font-weight: 600;
}
.meal-switch .meal-ico { font-size: 17px; }
.meal-switch .short { display: none; }

/* ---------- Cardápio ---------- */
.menu-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 16px 16px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: rise .25s ease;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.menu-item {
  display: grid;
  grid-template-columns: minmax(150px, 230px) 1fr;
  gap: 14px;
  padding: 15px 24px;
  border-bottom: 1px solid var(--border);
  transition: background .1s ease;
}
.menu-item:hover { background: var(--blue-50); }
.menu-item:last-child { border-bottom: none; }
.menu-item dt {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding-top: 3px;
}
.menu-item dd { font-size: 15px; line-height: 1.5; }

/* destaque para o prato principal */
.menu-item.highlight {
  background: linear-gradient(90deg, var(--blue-50), transparent 70%);
  border-left: 3px solid var(--blue-600);
}
.menu-item.highlight dd { font-weight: 600; color: var(--blue-900); }

.unavailable {
  padding: 52px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}
.unavailable .big { font-size: 42px; display: block; margin-bottom: 12px; }

/* ---------- Rodapé ---------- */
.page-footer {
  padding: 18px 4px 30px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
  text-align: center;
}
.page-footer a { color: var(--blue-700); font-weight: 500; text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .menu-item { grid-template-columns: 1fr; gap: 2px; padding: 13px 18px; }
  .menu-item dt { margin-top: 10px; }
  .topbar { padding-bottom: 40px; }
  /* abas de refeição: nomes curtos, sem corte em telas estreitas */
  .meal-switch { gap: 0; }
  .meal-switch button { min-width: 0; flex: 1 1 0; padding: 12px 4px; font-size: 13.5px; }
  .meal-switch .long { display: none; }
  .meal-switch .short { display: inline; }
}
