/* AmsalFC — whole-app visibility / responsiveness / admin-theme fixes.
   Loads LAST on homepage, /admin and /blog/[slug], after amsal-design.css.
   Base tokens are the amsal-design tokens (--fcb-*). This file fixes
   contrast and layout only; it does not change any feature behaviour.
   It deliberately does NOT touch the bracket board document (.board-* / .box
   inside .board-world): the board keeps its classic cream/gold theme exactly
   as the admin preview, in both themes. Theme toggle: no hover tilt, ever. */

:root {
  --fix-ink-dark: #ffffff;
  --fix-mute-dark: #ffffffbf;
  --fix-ink-light: #181733;
  --fix-mute-light: #444444;
}

/* ---------- Footer: readable in both modes ---------- */
body footer, body .footer {
  background: #12122b !important;
  background-color: #12122b !important;
  color: #ffffffbf !important;
  border-top: 3px solid #fdc52c !important;
}
/* style.css has a dark rule `html[data-theme="dark"] .footer { background-color: black !important; }`
   (specificity 0,2,1) that beats the rule above (0,1,1) — so the dark footer
   needs this higher-specificity (0,2,2) rule to stay navy like light mode. */
html[data-theme="dark"] body footer, html[data-theme="dark"] body .footer {
  background: #12122b !important;
  background-color: #12122b !important;
  color: #ffffffbf !important;
  border-top: 3px solid #fdc52c !important;
}
body footer h3, body .footer h3, body .footer-content h3 {
  color: #ffffff !important;
}
body footer p, body .footer-tagline, body .footer-copyright,
body footer .footer-content p {
  color: #ffffffbf !important;
}
body footer a, body .footer a, body .footer-admin-link a, body .footer-admin-login {
  color: #ffffff !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}
body footer a:hover, body .footer a:hover { color: #fdc52c !important; }
body footer .footer-social a {
  color: #ffffff !important;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 9999px;
}
html[data-theme="light"] body footer, html[data-theme="light"] body .footer {
  background: #12122b !important;
  color: #ffffffbf !important;
}
html[data-theme="light"] body footer a, html[data-theme="light"] body .footer a { color: #ffffff !important; }

/* ---------- Generic muted text: never invisible ---------- */
body .tp-subtitle, body .tp-empty, body .card-desc, body .form-message,
body .admin-item-sub, body .tp-info-item p, body .section-subtitle {
  color: #ffffffbf !important;
}
html[data-theme="light"] body .tp-subtitle, html[data-theme="light"] body .tp-empty,
html[data-theme="light"] body .card-desc, html[data-theme="light"] body .form-message,
html[data-theme="light"] body .admin-item-sub, html[data-theme="light"] body .tp-info-item p,
html[data-theme="light"] body .section-subtitle {
  color: #444444 !important;
}
body .tp-empty, body .admin-empty-state { text-align: center; padding: 24px; }

/* ---------- Theme switcher: no hover tilt, ever ---------- */
body .theme-toggle-btn, body .theme-toggle-btn:hover, body .theme-toggle-btn:focus-visible,
body #theme-toggle, body #theme-toggle:hover, body #theme-toggle:focus-visible {
  transform: none !important;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease !important;
}

/* ---------- Match Center: Amsal FC cup fixtures ---------- */
.amsal-cup-block { margin-top: 28px; }
.amsal-cup-block h3 { margin: 0 0 6px; }
.amsal-cup-block .amsal-cup-note { color: #ffffffbf; margin: 0 0 16px; max-width: 70ch; }
html[data-theme="light"] .amsal-cup-block .amsal-cup-note { color: #444444; }
.amsal-cup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.amsal-cup-card {
  background: #154284 !important; color: #ffffff !important;
  border: 2px solid #fdc52c !important; border-radius: 10px !important;
  padding: 16px; box-shadow: rgba(0,0,0,0.5) 0px 2px 4px 0px;
}
html[data-theme="light"] .amsal-cup-card { background: #ffffff !important; color: #181733 !important; border-color: #154284 !important; }
.amsal-cup-card .amsal-cup-meta { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.amsal-cup-card .amsal-cup-teams { font-size: 20px; font-weight: 700; margin: 10px 0 6px; line-height: 1.25; }
.amsal-cup-card .amsal-cup-teams .amsal-tag {
  display: inline-block; background: #fdc52c; color: #181733; font-size: 11px;
  border-radius: 9999px; padding: 2px 8px; margin-left: 6px; vertical-align: middle;
}
.amsal-cup-card .amsal-cup-info { font-size: 14px; color: #ffffffbf; }
html[data-theme="light"] .amsal-cup-card .amsal-cup-info { color: #444444; }
.amsal-cup-card a { color: #fdc52c !important; }
html[data-theme="light"] .amsal-cup-card a { color: #154284 !important; }

/* ---------- Gallery & Training grids (responsive) ---------- */
.gallery-grid, .training-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px;
}
.gallery-card { border-radius: 10px; overflow: hidden; background: #154284; border: 1px solid rgba(239,239,239,0.22); }
html[data-theme="light"] .gallery-card { background: #ffffff; border-color: #ddd; }
.gallery-card img { width: 100%; height: 220px; object-fit: cover; display: block; }
.gallery-card .gallery-cap { padding: 12px 14px; }
.gallery-card .gallery-cap h3 { font-size: 18px; margin: 0 0 4px; }
.gallery-card .gallery-cap p { font-size: 14px; color: #ffffffbf; margin: 0; }
html[data-theme="light"] .gallery-card .gallery-cap p { color: #444444; }
.gallery-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.gallery-filters button {
  border-radius: 9999px; padding: 8px 16px; border: 1px solid rgba(239,239,239,0.35);
  background: transparent; color: inherit; cursor: pointer; font-size: 14px;
}
.gallery-filters button[aria-pressed="true"] { background: #fdc52c; color: #181733; border-color: #fdc52c; font-weight: 700; }

/* ---------- Admin panel: full amsal-design theme ---------- */
body .admin-container, body .admin-layout, body .admin-main, body .admin-sidebar,
body .dashboard-header, body .login-box-card {
  background: #181733 !important; color: #ffffff !important;
}
html[data-theme="light"] body .admin-container, html[data-theme="light"] body .admin-layout,
html[data-theme="light"] body .admin-main, html[data-theme="light"] body .admin-sidebar,
html[data-theme="light"] body .dashboard-header, html[data-theme="light"] body .login-box-card {
  background: #f5f5f6 !important; color: #181733 !important;
}
body .admin-layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
body .admin-sidebar { border: 1px solid rgba(239,239,239,0.22); border-radius: 10px; padding: 14px; }
html[data-theme="light"] body .admin-sidebar { border-color: #ddd; }
body .admin-tab-btn { border-radius: 9999px !important; color: #ffffff !important; text-align: left; }
html[data-theme="light"] body .admin-tab-btn { color: #181733 !important; }
body .admin-tab-btn.active { background: #fdc52c !important; color: #181733 !important; }
body .admin-stat-card, body .dashboard-card, body .admin-item-card, body .login-notice-box {
  background: #154284 !important; color: #ffffff !important;
  border: 1px solid rgba(239,239,239,0.22) !important; border-radius: 10px !important;
}
html[data-theme="light"] body .admin-stat-card, html[data-theme="light"] body .dashboard-card,
html[data-theme="light"] body .admin-item-card, html[data-theme="light"] body .login-notice-box {
  background: #ffffff !important; color: #181733 !important; border-color: #ddd !important;
}
body .admin-stat-info strong, body .admin-item-title, body .card-title { color: #ffffff !important; }
html[data-theme="light"] body .admin-stat-info strong, html[data-theme="light"] body .admin-item-title,
html[data-theme="light"] body .card-title { color: #181733 !important; }
body .admin-item-sub, body .card-desc, body .login-sub { color: #ffffffbf !important; }
html[data-theme="light"] body .admin-item-sub, html[data-theme="light"] body .card-desc,
html[data-theme="light"] body .login-sub { color: #444444 !important; }
body .perm-checkbox-item, body .admin-shortcut-btn {
  border: 1px solid rgba(239,239,239,0.22); border-radius: 10px; color: inherit;
}
body .upload-preview img { max-width: 100%; max-height: 160px; object-fit: cover; border-radius: 8px; margin-top: 8px; }
body .upload-hint { font-size: 13px; color: #ffffffbf; }
html[data-theme="light"] body .upload-hint { color: #444444; }

/* ---------- Responsiveness: every screen size ---------- */
body .tp-container, body .container, body .wrap { padding-left: 16px !important; padding-right: 16px !important; }
body .board-container, body .board-stage { overflow-x: auto; }
body table { display: block; overflow-x: auto; }
@media (max-width: 900px) {
  body .admin-layout { grid-template-columns: 1fr !important; }
  body .admin-sidebar { display: flex; flex-wrap: wrap; gap: 8px; }
  body .admin-nav-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
  body .form-grid { grid-template-columns: 1fr !important; }
  .gallery-grid, .training-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 600px) {
  .gallery-grid, .training-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .gallery-card img { height: 150px; }
  body .tp-container, body .container { padding-left: 12px !important; padding-right: 12px !important; }
}
@media (max-width: 360px) {
  .gallery-grid, .training-grid { grid-template-columns: 1fr 1fr !important; }
  .amsal-cup-grid { grid-template-columns: 1fr !important; }
}

/* Team logos in fixture lists and Amsal cup cards (only when a team has a
   logo of its own; no logo -> name only, never a fake crest). */
.fixture-logo { width: 26px; height: 26px; object-fit: contain; vertical-align: middle; margin-right: 6px; border-radius: 6px; }
