/* ============================================
   ShrimpDev Portal — Brand Design System
   Based on: brand-design/README.md v1.0
   ============================================ */

/* --- Design Tokens (from brand) --- */
:root {
  --font-display: 'Syne', sans-serif;
  --font-body:    'Crimson Pro', Georgia, serif;
  --font-mono:    'JetBrains Mono', monospace;

  --accent:       #ff6b35;
  --accent2:      #ff9f1c;
  --bg:           #0d0d0f;
  --bg2:          #141418;
  --bg3:          #1b1b21;
  --surface:      #1e1e26;
  --border:       #2a2a35;
  --text:         #e8e6f0;
  --muted:        #7a7890;
  --link:         #7eb8f7;

  --max:          1400px;
  --sidebar-w:    220px;
  --gap:          24px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* --- Tag Pill --- */
.tag-pill {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
  transition: all 0.15s;
  white-space: nowrap;
  display: inline-block;
}
.tag-pill:hover, .tag-pill--active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(255,107,53,0.08);
}

/* --- Main Layout --- */
.main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px var(--gap);
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--sidebar-w);
  gap: var(--gap);
}

/* --- Card Grid --- */
.card-grid {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  grid-column: 2;
}
.card-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

/* --- Post Card (Square, from brand) --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  aspect-ratio: 1 / 1;
  cursor: pointer;
}
.card:hover {
  border-color: rgba(255,107,53,0.4);
  transform: translateY(-2px);
}
.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.card__img-wrap {
  flex: 1 1 60%;
  overflow: hidden;
  display: block;
}
.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.card:hover .card__img { transform: scale(1.04); }
.card__body {
  flex: 0 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.card__title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__title a:hover { color: var(--accent); }
.card__description {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.card__tag {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}

/* --- Empty Card --- */
.card--empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  cursor: default;
  opacity: 0.4;
}
.card--empty:hover {
  transform: none;
  border-color: var(--border);
}

/* --- Ad Slots --- */
.ad-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ad-sidebar--left  { grid-column: 1; }
.ad-sidebar--right { grid-column: 3; }
.ad-slot {
  width: 100%;
  min-height: 250px;
  background: var(--bg3);
  border: 1px dashed var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  font-family: var(--font-display);
  position: relative;
  overflow: hidden;
}
.ad-slot::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.01) 10px, rgba(255,255,255,0.01) 20px);
}
.ad-slot__label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  background: var(--border);
  padding: 2px 6px;
  border-radius: 3px;
  position: relative;
}
.ad-slot__size { font-size: 0.85rem; font-weight: 600; position: relative; }
.ad-slot__hint { font-size: 0.72rem; color: rgba(122,120,144,0.6); position: relative; }

/* --- Horizontal Banner Ad --- */
.ad-banner {
  grid-column: 1 / -1;
  background: var(--bg3);
  border: 1px dashed var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 90px;
  padding: 12px 24px;
  color: var(--muted);
  font-family: var(--font-display);
  position: relative;
  overflow: hidden;
}
.ad-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.01) 10px, rgba(255,255,255,0.01) 20px);
}
.ad-banner__label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  background: var(--border);
  padding: 2px 6px;
  border-radius: 3px;
  position: relative;
  flex-shrink: 0;
}
.ad-banner__size { font-size: 0.85rem; font-weight: 600; position: relative; flex-shrink: 0; }
.ad-banner__hint { font-size: 0.72rem; color: rgba(122,120,144,0.6); position: relative; }

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg2);
  margin-top: auto;
}
.footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem var(--gap);
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
}
.footer__brand {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 0.75rem;
}
.footer__shrimp { font-size: 1.2rem; }
.footer__name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
}
.footer__name em { font-style: normal; color: var(--accent); }
.footer__desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}
.footer__heading {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.footer__link {
  display: block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--muted);
  padding: 4px 0;
  transition: color 0.15s;
}
.footer__link:hover { color: var(--accent); }
.footer__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.footer__bottom {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem var(--gap);
  text-align: center;
  border-top: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--muted);
}
.footer__bottom a { color: var(--accent); }
.footer__bottom a:hover { text-decoration: underline; }

/* --- Loading State --- */
.card-grid__loading {
  text-align: center;
  padding: 80px 0;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

/* ============================================
   Responsive Breakpoints
   ============================================ */

@media (max-width: 1024px) {
  .main {
    grid-template-columns: 1fr;
    max-width: 768px;
    padding: 24px 16px;
  }
  .ad-sidebar { display: none; }
  .card-grid { grid-column: 1; }
  .card-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .main { padding: 16px 12px; }
  .card-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .card-grid { gap: 16px; }
  .ad-banner { min-height: 60px; padding: 10px 16px; }
  .footer__inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem 12px;
  }
  .footer__bottom { padding: 1rem 12px; }
}

@media (max-width: 600px) {
  .main { padding: 12px 8px; }
  .card-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .card-grid { gap: 12px; }
}
