/* Giga Mag — magazine + Giga Reel */

:root {
  --bg: #f4f0e8;
  --bg-card: #fffef9;
  --ink: #1a1a1a;
  --ink-muted: #5c5c5c;
  --accent: #8b2942;
  --accent-hover: #6d1f33;
  --border: #d4cfc4;
  --shadow: 0 4px 24px rgba(26, 26, 26, 0.08);
  --font-display: "Libre Baskerville", "Georgia", serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --max: 1120px;
  --radius: 4px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--accent-hover);
}

/* Masthead */
.site-header {
  border-bottom: 3px double var(--ink);
  background: var(--bg-card);
  padding: 1.25rem 1.5rem 1rem;
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.site-logo:hover {
  color: var(--accent);
}

.site-tagline {
  font-size: 0.85rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
}

.site-nav a[aria-current="page"],
.site-nav a:hover {
  color: var(--accent);
}

/* Layout */
.main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.issue-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  line-height: 1.15;
}

.page-lede {
  max-width: 42rem;
  color: var(--ink-muted);
  margin: 0 0 2rem;
}

/* Cover page (index) */
.cover-hero {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .cover-hero {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
}

.cover-hero__visual {
  aspect-ratio: 16 / 10;
  background: var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.cover-hero__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
}

.cover-hero__kicker {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.75rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--accent);
  color: #fff !important;
  border: none;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--accent-hover);
  color: #fff !important;
}

.coming-soon {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.coming-soon h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
}

.coming-soon p {
  color: var(--ink-muted);
  margin: 0;
}

/* Featured (tube) */
.featured {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
  .featured {
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
  }
}

.featured__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--ink);
  width: 100%;
}

.featured__thumb.featured__thumb--tiktok {
  aspect-ratio: 9 / 16;
  max-height: 420px;
  max-width: 280px;
  margin: 0 auto;
  background-color: #1a1a1a;
}

.featured__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s;
}

.featured__thumb:hover img {
  transform: scale(1.03);
}

.featured__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 3rem;
}

.featured__meta h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

.featured__note {
  font-style: italic;
  color: var(--ink-muted);
  margin: 0.75rem 0 0;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.filter-btn {
  padding: 0.45rem 0.9rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--ink);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.filter-btn:hover {
  border-color: var(--accent);
}

.filter-btn.is-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.section-heading {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 2rem 0 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.section-heading:first-of-type {
  margin-top: 0;
}

/* Video grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(26, 26, 26, 0.12);
}

.video-card__thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  padding: 0;
  cursor: pointer;
  background: var(--ink);
  position: relative;
}

.video-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-card__body {
  padding: 0.85rem 1rem 1rem;
}

.video-card__game {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 700;
}

.video-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0.35rem 0 0.25rem;
  line-height: 1.35;
}

.video-card__channel {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin: 0;
}

.video-card__lang {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  background: var(--bg);
  border-radius: 2px;
  color: var(--ink-muted);
}

.video-card.is-hidden {
  display: none;
}

.load-error {
  padding: 1rem;
  background: #fff3f3;
  border: 1px solid #e8a0a0;
  border-radius: var(--radius);
}

.feed-notice {
  padding: 1rem;
  background: #f0f4ff;
  border: 1px solid #b8c8e8;
  border-radius: var(--radius);
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.75);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal__dialog {
  width: min(960px, 100%);
  background: var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* TikTok: vertical video — narrow dialog, tall player (not a small strip in a wide box) */
.modal__dialog--tiktok {
  width: min(420px, 100%);
  max-height: calc(100dvh - 2rem);
  display: flex;
  flex-direction: column;
}

@media (max-width: 480px) {
  .modal:has(.modal__dialog--tiktok) {
    padding: 0;
    align-items: stretch;
  }

  .modal__dialog--tiktok {
    width: 100%;
    max-height: 100dvh;
    border-radius: 0;
  }

  .modal__dialog--tiktok .modal__player--tiktok {
    max-height: calc(100dvh - 7.5rem);
  }
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #111;
  color: #fff;
}

.modal__title {
  font-size: 0.95rem;
  margin: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal__close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius);
}

.modal__close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.modal__player {
  aspect-ratio: 16 / 9;
  background: #000;
}

.modal__player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.modal__player--tiktok {
  flex: 1 1 auto;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: min(calc(100dvh - 11rem), 720px);
  margin: 0 auto;
  min-height: 0;
}

.modal__player--tiktok iframe {
  min-height: 0;
  height: 100%;
}

.fadalgia-block {
  margin-bottom: 3rem;
}

.video-card__thumb--tiktok {
  display: block;
  aspect-ratio: 9 / 16;
  max-height: 360px;
  margin: 0 auto;
  background-color: #1a1a1a;
}

.video-card__thumb--tiktok .video-card__thumb-art {
  display: block;
  width: 100%;
  min-height: 100%;
  aspect-ratio: 9 / 16;
}

.video-card__thumb--tiktok img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.featured__thumb--tiktok {
  max-height: 420px;
  max-width: 280px;
  margin: 0 auto;
}

.featured__thumb--tiktok .featured__play {
  background: rgba(0, 0, 0, 0.35);
}

.video-card__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 100%;
  padding: 1rem;
  text-align: center;
  box-sizing: border-box;
}

.video-card__placeholder-brand {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
}

.video-card__placeholder-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card__placeholder-author {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
}

.profile-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.profile-links a {
  font-weight: 600;
}

.modal__footer {
  padding: 0.75rem 1rem;
  background: #111;
  text-align: right;
}

.modal__footer a {
  color: #ccc;
  font-size: 0.85rem;
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-align: center;
}
