/* =========================================================
   0) Custom properties
   ========================================================= */
:root{
  --bg:#0b0b0b;
  --fg-dark:#ececec;   /* text on dark backgrounds (most of site) */
  --fg-light:#1d1d1d;  /* text on light backgrounds (carousel card) */
  --muted:#a3a3a3;
  --card:#161616;
  --accent:#1cf871;
  --br:18px;
  --max:clamp(320px,92vw,960px);
  --page-gutter: clamp(16px, 4vw, 24px);
}
/* keep a generic --fg if you want, but make it alias the dark one */
:root{ --fg: var(--fg-dark); }


/* =========================================================
   1) Reset & base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html, body {
  font-family: "Inter Tight", sans-serif;
  line-height: 1.5;
  background: #000;
  color: var(--fg);
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding: 0;
}

/* =========================================================
   2) Typography
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
  font-weight: 400;
  margin: 10px 0;
  text-wrap: balance;
}

p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
p { text-wrap: pretty; }

#itemTitle { color: #f7f7f7; }

.muted { color: var(--muted); }

/* =========================================================
   3) Media & form controls
   ========================================================= */
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }

/* =========================================================
   4) Layout containers
   ========================================================= */
.main-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: stretch;
  min-height: 100svh;
  width: 100%;
}

/* Main wrapper — handles width & horizontal padding */
#homeWrapper {
  width: 100%;
  max-width: min(100%, 720px);   /* full width on phones, capped on desktop */
  padding: 0 var(--page-gutter);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

@media (max-width: 640px) {
  #homeWrapper { --page-gutter: 16px; }
}


/* Background host for home + directory pages */
#imageContainer {
  background: #000 no-repeat center / cover; /* fallback + positioning */
  min-height: 100svh;
  transition: background-image 0.6s ease-in-out, opacity 0.4s ease;
}

/* Touch tweaks for the carousel area */
#carouselSlide { touch-action: pan-y; }

/* =========================================================
   5) Utilities
   ========================================================= */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* =========================================================
   6) Cards (directory cards)
   ========================================================= */
.card{
  background:var(--card);
  color:var(--fg-dark);   /* was var(--fg), now explicit */
}
.card a{ color:inherit; }


.card--clickable {
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  -webkit-tap-highlight-color: rgba(255,255,255,0.08);
}
.card--clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.30);
  border-color: #333;
}
.card--clickable:active {
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.card--clickable:focus { outline: none; }
.card--clickable:focus-visible {
  box-shadow: 0 0 0 3px rgba(124,156,255,.60), 0 8px 24px rgba(0,0,0,.30);
  border-color: var(--accent);
}

.card__image  { width: 100%; height: 160px; object-fit: cover; display: block; }
.card__title  { margin: 0 0 6px 0; font-size: 18px; }
.card__titleLink { text-decoration: none; color: inherit; }
.card__actions { display: flex; justify-content: flex-start; margin-top: 6px; }
.card__button { text-decoration: none; }
.card__button:hover,
.card__button:focus-visible {
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(124,156,255,.45) inset;
}

/* Directory grid layout */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  align-items: start;
}

/* =========================================================
   7) Motion preferences
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .card--clickable { transition: none; }
}

/* =========================================================
   8) Header (light, non-invasive)
   ========================================================= */
.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}
.site-title {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 18px;
}
.main-nav { display: flex; gap: 10px; flex-wrap: wrap; }
.nav__link {
  color: #aaa;
  text-decoration: none;
  border: 1px solid #222;
  border-radius: 12px;
  padding: 6px 10px;
  background: #0f0f0f;
}
.nav__link:hover { color: #fff; border-color: #333; }
.nav__link--active { color: #fff; border-color: #444; background: #1b1b1b; }

/* =========================================================
   9) Directory controls + pagination
   ========================================================= */
.controls {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 16px 0;
}
.controls label {
  font-size: 13px; color: #a8a8a8; display: flex; gap: 6px; align-items: center;
}
.controls select,
.controls input[type="search"] {
  background: #121212; color: #eee; border: 1px solid #2a2a2a;
  border-radius: 10px; padding: 6px 10px;
}

.pagination {
  display: flex; gap: 8px; align-items: center; justify-content: center; margin: 20px 0;
}
.pagination button {
  background: #121212; color: #eee; border: 1px solid #2a2a2a; border-radius: 8px;
  padding: 6px 10px; cursor: pointer;
}
.pagination button[disabled] { opacity: .45; cursor: not-allowed; }
.pagination .current { color: #fff; border-color: #444; }

/* =========================================================
   10) Footer (single centered row)
   ========================================================= */
.site-footer {
  display: flex; 
  justify-content: center; 
}
.footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;                  /* ⬅️ stretch */
  flex: 1 1 auto;               /* ⬅️ allow it to grow in the flex parent */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  flex-wrap: nowrap;
  min-width: 0;
}

.logo {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-weight: 700;
}

.site-footer .footer__copyright {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.footerText {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid #444;
  border-radius: 8px;
  color: #ddd;
  text-decoration: none;
  white-space: nowrap;
}
.footerText:hover,
.footerText:focus-visible {
  color: #fff;
  border-color: var(--accent);
}

/* tiny screens: tighten padding/size slightly */
@media (max-width: 380px) {
  .site-footer .footer__copyright { font-size: 13px; }
  .footerText { padding: 6px 10px; font-size: 13px; }
}

/* --- Contact page utilities --- */
.stack {                /* vertical stack with gap */
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-grow: 1;
}

.full-width {           /* fill the available width of #homeWrapper */
  width: 100%;
  max-width: none;
}

.panel {                /* card look */
  background: #111;
  border: 1px solid #222;
  border-radius: 14px;
  padding: 16px;
}

.panel h2 { margin: 0 0 8px 0; }
.panel p  { margin: 0 0 12px 0; }
