/* ============================================================
   eMaktaba portal — TUC Library off-campus access
   Redesigned 2026-07-22 (v2): clean logo-wall card grid.
   ============================================================ */

:root {
  --brand:      #2e4f08;   /* TUC green */
  --brand-2:    #3f6b12;
  --brand-ink:  #24400a;
  --accent:     #13aff2;
  --ink:        #223018;
  --muted:      #6a785f;
  --bg:         #ecefe7;   /* single neutral ground, slight green bias */
  --card:       #ffffff;
  --line:       #e2e7d9;
  --radius:     12px;
  --shadow:     0 1px 2px rgba(30,50,15,.05), 0 4px 14px rgba(30,50,15,.05);
  --shadow-h:   0 8px 18px rgba(30,50,15,.12), 0 20px 40px rgba(30,50,15,.14);
}

* { box-sizing: border-box; }

html {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.5;
}

/* ---------- Masthead: single logo, no redundant text ---------- */
#masthead {
  background: linear-gradient(100deg, var(--brand) 0%, var(--brand-2) 100%);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  box-shadow: 0 2px 10px rgba(30,50,15,.18);
}
#masthead .masthead-wordmark {
  color: #fff;
  font-weight: 800;
  font-size: 1.9rem;
  letter-spacing: .3px;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
#masthead img {
  height: 64px;
  width: auto;
  max-width: 100%;
  display: block;
  /* white chip so the logo's own white ground reads cleanly on the green bar */
  padding: 10px 22px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 5px rgba(0,0,0,.14);
}
@media (max-width: 600px) {
  #masthead { flex-direction: column; gap: 12px; }
  #masthead img { height: 40px; padding: 8px 12px; }
  #masthead .masthead-wordmark { font-size: 1.45rem; }
}

/* ---------- Layout ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 22px; }

.alert {
  max-width: 1200px;
  margin: 18px auto 4px;
  padding: 11px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
  font-size: .88rem;
  box-shadow: var(--shadow);
}
.alert b, .alert strong { color: var(--brand-ink); }

/* ---------- Section headings ---------- */
.section-head { display: flex; align-items: center; gap: 12px; margin: 30px 0 14px; }
.section-head h2 {
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--brand-ink);
  margin: 0;
  white-space: nowrap;
}
.section-head::before { content: ""; width: 5px; height: 20px; border-radius: 3px; background: var(--brand); }
.section-head::after  { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

/* ---------- Card grid (logo-only tiles) ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 16px;
  margin-bottom: 6px;
}

.card {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 104px;
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-h);
  border-color: #cdddb9;
}
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; transform: translateY(-3px); }

.card img {
  max-width: 100%;
  max-height: 66px;
  width: auto;
  object-fit: contain;
}
/* Wordmark fallback for publishers without a logo image */
.card--text {
  font-weight: 800;
  font-size: 1.06rem;
  color: var(--brand);
  text-align: center;
  line-height: 1.18;
  letter-spacing: .01em;
  text-wrap: balance;
}
/* longer labels shrink a step so they never overflow the tile */
.card--text.long { font-size: .82rem; font-weight: 700; }

/* ---------- Campus resource buttons ---------- */
.btnrow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin: 6px 0 10px;
}
.btn_1, .btn_2 {
  display: block;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 15px 20px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(100deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.btn_1:hover, .btn_2:hover { transform: translateY(-2px); box-shadow: var(--shadow-h); filter: brightness(1.07); }
.btn_2 { background: linear-gradient(100deg, #b3300c 0%, #d8461a 100%); }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 34px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: .82rem;
  border-top: 1px solid var(--line);
}

@media (prefers-reduced-motion: reduce) {
  .card, .btn_1, .btn_2 { transition: none; }
  .card:hover, .btn_1:hover, .btn_2:hover { transform: none; }
}

@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .card { height: 92px; padding: 14px; }
}
