:root {
    --sa-navy: #0A1E5C;
    --sa-green: #8FE03D;
    --sa-ink: #17233f;
    --sa-muted: #65708a;
    --sa-border: rgba(10, 30, 92, .14);
    --sa-soft: #f6f8fc;
}

.sa-theme-game,
.sa-theme-games-archive {
    max-width: 1180px;
    margin: 0 auto;
    padding: clamp(24px, 4vw, 56px) 20px;
}

.sa-theme-hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: end;
    margin-bottom: 28px;
    padding: clamp(22px, 4vw, 42px);
    border-radius: 28px;
    background: linear-gradient(135deg, var(--sa-navy), #132f7e);
    color: #fff;
}

.sa-theme-hero h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(34px, 5vw, 64px);
    line-height: 1;
}

.sa-theme-eyebrow {
    margin: 0 0 8px;
    color: var(--sa-green);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .78rem;
}

.sa-theme-section {
    margin: 30px 0;
}

.sa-theme-section > h2 {
    color: var(--sa-navy);
    font-size: clamp(24px, 3vw, 36px);
    margin-bottom: 14px;
}

.sa-theme-hero .sa-language-switcher a {
    background: rgba(255,255,255,.14);
    color: #fff;
}

.sa-theme-hero .sa-language-switcher a[aria-current="true"] {
    background: var(--sa-green);
    color: var(--sa-navy);
}

.sa-game-panel,
.sa-game-card,
.sa-gallery-card,
.sa-track-item,
.sa-trailer-card {
    box-shadow: 0 14px 40px rgba(10, 30, 92, .08);
}


/* Sims Archives Core alpha.9 integration for Dream Theme */
.sad-core-module-section .sa-game-card-grid,
.sad-core-module-section .sa-gallery-grid,
.sad-core-module-section .sa-media-grid,
.sad-core-module-section .sa-trailer-grid,
.sad-core-module-section .sa-track-list {
  margin-top: 18px;
}

.sad-core-module-section .sa-gallery-card,
.sad-core-module-section .sa-game-panel,
.sad-core-module-section .sa-track-item,
.sad-core-module-section .sa-trailer-card,
.sad-core-module-section .sa-media-grid figure {
  border-radius: var(--sad-radius-lg, 24px);
}

.sad-core-module-section .sa-button,
.sad-core-module-section .sa-language-switcher a {
  background: var(--sad-blue, #0A1E5C);
  color: #fff;
}

.sad-core-module-section .sa-button:hover,
.sad-core-module-section .sa-language-switcher a:hover {
  color: #fff;
  transform: translateY(-1px);
}

.sad-site-header .sa-language-switcher ul {
  display: flex;
  gap: 6px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.sad-site-header .sa-language-switcher a {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  border: 1px solid var(--sad-border, rgba(10, 30, 92, .14));
  box-shadow: 0 8px 22px rgba(10,30,92,.08);
}

.sad-site-header .sa-language-switcher a[aria-current="true"] {
  background: #8FE03D;
  color: #0A1E5C;
}

.sad-core-mini-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.sad-core-home-module .sa-gallery-grid,
.sad-core-home-module .sa-trailer-grid {
  margin-top: 18px;
}


/* Alpha.11 unified Core media/gallery cards */
.sad-core-module-section .sa-unified-gallery-item figcaption {
    display: grid;
    gap: .38rem;
}

.sad-core-module-section .sa-unified-gallery-item figcaption strong {
    color: var(--sad-navy, #0A1E5C);
}

.sad-core-module-section .sa-media-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.sad-core-module-section .sa-unified-gallery-item time,
.sad-core-module-section .sa-media-caption {
    color: var(--sad-muted, #64708c);
    font-size: .92rem;
}


/* Core alpha.13: five-column image gallery + load more */
.sad-core-module-section .sa-unified-media {
    --sa-media-columns: 5;
}

.sad-core-module-section .sa-media-grid.sa-unified-gallery-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .85rem;
}

.sad-core-module-section .sa-media-load-more-wrap {
    margin-top: 1rem;
}

.sa-public-gallery-archive-page {
    background: var(--sad-bg, #f5f8ff);
}

@media (max-width: 1100px) {
    .sad-core-module-section .sa-media-grid.sa-unified-gallery-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .sad-core-module-section .sa-media-grid.sa-unified-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .sad-core-module-section .sa-media-grid.sa-unified-gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* v1.0.10 / Core alpha.14: cleaner media gallery + hero gallery archive */
.sad-core-module-section .sa-unified-gallery-item {
    background: transparent;
    border-color: rgba(255,255,255,.14);
    box-shadow: 0 18px 42px rgba(2, 8, 28, .28);
}

.sad-core-module-section .sa-unified-gallery-item figcaption strong,
.sad-core-module-section .sa-unified-gallery-item figcaption time,
.sad-core-module-section .sa-unified-gallery-item .sa-media-caption,
.sad-core-module-section .sa-unified-gallery-item .sa-media-source {
    color: #fff;
}

.sad-core-module-section .sa-media-filterbar {
    background: linear-gradient(135deg, rgba(10, 30, 92, .86), rgba(10, 30, 92, .58));
    border-color: rgba(143,224,61,.22);
    box-shadow: 0 18px 45px rgba(2,8,28,.24);
}

.sad-core-module-section .sa-media-filterbar label,
.sad-core-module-section .sa-media-filter-count {
    color: rgba(255,255,255,.84);
}

.sad-core-module-section .sa-media-filter-count strong {
    color: var(--sad-green, #8FE03D);
}

.sa-public-gallery-archive-page {
    background: radial-gradient(circle at top left, rgba(143,224,61,.12), transparent 28%), #061446;
    min-height: 100vh;
}

.sa-public-gallery-archive-page .sa-image-gallery-archive-head h2,
.sa-public-gallery-archive-page .sa-image-gallery-archive-body h3 {
    color: #fff;
}

.sa-public-gallery-archive-page .sa-muted {
    color: rgba(235,241,255,.72);
}

.sa-public-gallery-archive-page .sa-image-gallery-archive-card {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.14);
    backdrop-filter: blur(14px);
}

.sa-public-gallery-archive-page .sa-gallery-card-kicker {
    background: rgba(143,224,61,.18);
    color: #8FE03D;
}

/* v1.0.11 — Core buttons inside the Dream theme use the same navy/green diamond system. */
.sad-core-module-section .sa-button,
.sad-core-module-section button.sa-button,
.sa-theme-game .sa-button,
.sa-theme-games-archive .sa-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .58rem;
  min-height: 42px;
  padding: .66rem 1.08rem;
  border-radius: 999px;
  border: 1px solid rgba(143, 224, 61, .60) !important;
  background: linear-gradient(135deg, #8FE03D 0%, #b9ff7c 100%) !important;
  color: #0A1E5C !important;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 16px 34px rgba(143, 224, 61, .22), inset 0 1px 0 rgba(255,255,255,.50) !important;
}

.sad-core-module-section .sa-button::before,
.sad-core-module-section button.sa-button::before,
.sa-theme-game .sa-button::before,
.sa-theme-games-archive .sa-button::before {
  content: '';
  width: .78rem;
  height: 1.08rem;
  flex: 0 0 .78rem;
  background: #0A1E5C !important;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  box-shadow: 0 0 0 2px rgba(255,255,255,.20), 0 0 12px rgba(10,30,92,.22);
}

.sad-core-module-section .sa-button:hover,
.sad-core-module-section button.sa-button:hover,
.sa-theme-game .sa-button:hover,
.sa-theme-games-archive .sa-button:hover {
  transform: translateY(-2px);
  color: #0A1E5C !important;
  border-color: rgba(255,255,255,.75) !important;
  box-shadow: 0 22px 46px rgba(143, 224, 61, .30), inset 0 1px 0 rgba(255,255,255,.58) !important;
}


/* v1.0.12 — Core alpha.15 per-game gallery pages */
.sa-public-game-gallery-page .sa-game-gallery-hero,
.sa-public-game-gallery-page .sa-game-gallery-shell {
    font-family: inherit;
}

.sa-public-game-gallery-page .sa-game-gallery-hero .sa-button,
.sa-public-game-gallery-page .sa-gallery-tab {
    text-decoration: none;
}

.sad-core-visual-section .sad-section-head .sad-button {
    flex: 0 0 auto;
}

@media (max-width: 760px) {
    .sad-core-visual-section .sad-section-head {
        gap: .9rem;
    }
}

/* v1.0.13 — Core alpha.16: per-game galleries reuse the game presentation template. */
.sad-core-gallery-template {
  background:
    radial-gradient(circle at top left, rgba(143,224,61,.14), transparent 32rem),
    radial-gradient(circle at top right, rgba(52,212,255,.13), transparent 30rem),
    var(--sad-bg, #f5f8ff);
  color: var(--sad-text, #102035);
}

.sad-gallery-orbit-hero .sad-orbit-kicker::before,
.sad-core-gallery-template .sad-orbit-section-head p::before {
  content: '';
  display: inline-block;
  width: .58rem;
  height: .85rem;
  margin-right: .44rem;
  vertical-align: -.08rem;
  background: var(--sad-green, #8FE03D);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  box-shadow: 0 0 14px rgba(143, 224, 61, .42);
}

.sad-core-gallery-tabs-section {
  margin-top: clamp(1rem, 3vw, 2.5rem);
}

.sad-core-gallery-card {
  overflow: visible;
}

.sad-core-gallery-template .sa-unified-media {
  margin-top: 1.2rem;
}

.sad-core-gallery-template .sa-gallery-tabs {
  margin-bottom: 1rem;
}

.sad-core-gallery-template .sa-media-grid.sa-unified-gallery-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .85rem;
}

.sad-core-gallery-template .sa-unified-gallery-item {
  background: transparent;
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 18px 42px rgba(2, 8, 28, .18);
}

.sad-core-gallery-template .sa-unified-gallery-item figcaption strong,
.sad-core-gallery-template .sa-unified-gallery-item figcaption time,
.sad-core-gallery-template .sa-unified-gallery-item .sa-media-caption,
.sad-core-gallery-template .sa-unified-gallery-item .sa-media-source {
  color: #fff;
}

.sad-core-gallery-template .sa-media-load-more-wrap {
  margin-top: 1.2rem;
}

@media (max-width: 1100px) {
  .sad-core-gallery-template .sa-media-grid.sa-unified-gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .sad-core-gallery-template .sa-media-grid.sa-unified-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .sad-core-gallery-template .sa-media-grid.sa-unified-gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* v1.0.17 — Mobile audit for Core shortcode output. */
@media (min-width: 1024px) {
  .sad-core-module-section .sa-media-grid.sa-unified-gallery-grid,
  .sad-core-gallery-template .sa-media-grid.sa-unified-gallery-grid,
  .sad-core-gallery-tabs-section .sa-media-grid.sa-unified-gallery-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .sad-core-module-section .sa-media-grid.sa-unified-gallery-grid,
  .sad-core-gallery-template .sa-media-grid.sa-unified-gallery-grid,
  .sad-core-gallery-tabs-section .sa-media-grid.sa-unified-gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  .sad-core-module-section .sa-media-grid.sa-unified-gallery-grid,
  .sad-core-gallery-template .sa-media-grid.sa-unified-gallery-grid,
  .sad-core-gallery-tabs-section .sa-media-grid.sa-unified-gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 480px) {
  .sad-core-module-section .sa-media-grid.sa-unified-gallery-grid,
  .sad-core-gallery-template .sa-media-grid.sa-unified-gallery-grid,
  .sad-core-gallery-tabs-section .sa-media-grid.sa-unified-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .sad-core-module-section .sa-track-item,
  .sa-track-item {
    display: grid !important;
    grid-template-columns: 36px minmax(0, 1fr) !important;
    gap: 8px !important;
    align-items: center !important;
  }

  .sa-track-duration,
  .sa-track-links {
    grid-column: 2 !important;
  }
}
