/**
 * Theme CSS Variables and Base Styles
 * Based on Figma design system
 */

:root {
  --font-size: 16px;
  --background: #ffffff;
  --foreground: oklch(0.145 0 0);
  --card: #ffffff;
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: #030213;
  --primary-foreground: oklch(1 0 0);
  --secondary: oklch(0.95 0.0058 264.53);
  --secondary-foreground: #030213;
  --muted: #ececf0;
  --muted-foreground: #717182;
  --accent: #e9ebef;
  --accent-foreground: #030213;
  --destructive: #d4183d;
  --destructive-foreground: #ffffff;
  --border: rgba(0, 0, 0, 0.1);
  --input: transparent;
  --input-background: #f3f3f5;
  --switch-background: #cbced4;
  --font-weight-medium: 500;
  --font-weight-normal: 400;
  --ring: oklch(0.708 0 0);
  --chart-1: oklch(0.646 0.222 41.116);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0.07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);
  --chart-5: oklch(0.769 0.188 70.08);
  --radius: 0.625rem;
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.145 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.145 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.985 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.396 0.141 25.723);
  --destructive-foreground: oklch(0.637 0.237 25.331);
  --border: oklch(0.269 0 0);
  --input: oklch(0.269 0 0);
  --ring: oklch(0.439 0 0);
}

/* Base Typography */
html {
  font-size: var(--font-size);
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--font-size);
  font-weight: var(--font-weight-normal);
  line-height: 1.5;
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-medium);
  line-height: 1.5;
  margin: 0;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  font-size: var(--font-size);
  font-weight: var(--font-weight-normal);
  line-height: 1.5;
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Box Sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ===========================
   SITE STRUCTURE - STICKY FOOTER
   =========================== */
html,
body {
  height: 100%;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

#page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#content {
  flex: 1;
  padding: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Main content area - ensures spacing on all pages */
.site-main,
#main {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  padding: 12px;
  box-sizing: border-box;
}

/* Entry content - nested inside site-main, so no padding */
.site-main .entry-content,
#main .entry-content {
  padding: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Standalone entry-content (if not in site-main) */
.entry-content:not(.site-main .entry-content):not(#main .entry-content),
.page-content {
  max-width: 100%;
  margin: 0 auto;
  padding: 12px;
  box-sizing: border-box;
}

/* Page Container */
.site-content {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  padding: 12px;
  box-sizing: border-box;
}

/* Grids inside page containers should not have double padding */
.site-content .casino-grid,
.site-content .slot-grid,
.site-content .casino-row-list,
.entry-content .casino-grid,
.entry-content .slot-grid,
.entry-content .casino-row-list,
.page-content .casino-grid,
.page-content .slot-grid,
.page-content .casino-row-list,
.site-main .casino-grid,
.site-main .slot-grid,
.site-main .casino-row-list,
#main .casino-grid,
#main .slot-grid,
#main .casino-row-list {
  padding-left: 0;
  padding-right: 0;
}

/* Mobile: Reduce padding on small screens */
@media (max-width: 767px) {
  .site-content,
  .entry-content:not(.site-main .entry-content):not(#main .entry-content),
  .page-content,
  .site-main,
  #main {
    padding: 12px;
  }

  .site-main .entry-content,
  #main .entry-content {
    padding: 0;
  }

  .site-content .casino-grid,
  .site-content .slot-grid,
  .site-content .casino-row-list,
  .entry-content .casino-grid,
  .entry-content .slot-grid,
  .entry-content .casino-row-list,
  .page-content .casino-grid,
  .page-content .slot-grid,
  .page-content .casino-row-list,
  .site-main .casino-grid,
  .site-main .slot-grid,
  .site-main .casino-row-list,
  #main .casino-grid,
  #main .slot-grid,
  #main .casino-row-list {
    padding-left: 0;
    padding-right: 0;
  }
}

/* ===========================
   HEADER - THIN DESIGN
   =========================== */
.site-header {
  background: var(--background);
  border-bottom: 1px solid var(--border);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.site-header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

/* Logo Area */
.site-branding {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-logo {
  display: flex;
  align-items: center;
  height: 50px;
}

.site-logo a {
  display: flex;
  align-items: center;
  height: 100%;
}

.site-logo img {
  max-height: 50px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.site-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
}

.site-title a {
  color: var(--foreground);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.site-title a:hover {
  opacity: 0.8;
}

/* Navigation */
.main-navigation {
  display: flex;
  align-items: center;
  position: relative;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.menu-toggle-icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 24px;
}

.menu-toggle-icon span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--foreground);
  transition: all 0.3s ease;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.primary-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
  align-items: center;
}

.primary-menu li {
  margin: 0;
  padding: 0;
  position: relative;
}

.primary-menu a {
  display: block;
  padding: 12px 20px;
  color: var(--foreground);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.primary-menu a:hover {
  color: var(--primary);
}

.primary-menu .current-menu-item > a,
.primary-menu .current_page_item > a {
  color: var(--primary);
  font-weight: 600;
}

/* Submenu Support */
.primary-menu .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  list-style: none;
  margin: 0;
  padding: 8px 0;
  min-width: 200px;
}

.primary-menu li:hover > .sub-menu {
  display: block;
}

.primary-menu .sub-menu li {
  margin: 0;
}

.primary-menu .sub-menu a {
  padding: 10px 20px;
  font-size: 0.875rem;
}

/* Mobile Menu */
@media (max-width: 767px) {
  .menu-toggle {
    display: flex;
  }

  .primary-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--background);
    border-top: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }

  .primary-menu.active {
    display: flex;
  }

  .primary-menu li {
    border-bottom: 1px solid var(--border);
  }

  .primary-menu a {
    padding: 16px 20px;
  }

  .primary-menu .sub-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
    margin-left: 20px;
  }
}

/* ===========================
   FOOTER - STICKY TO BOTTOM
   =========================== */
.site-footer {
  background: var(--background);
  border-top: 1px solid var(--border);
  padding: 30px 0;
  margin-top: auto;
}

.site-footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-info {
  text-align: center;
}

.footer-menu {
  display: flex;
  justify-content: center;
  list-style: none;
  margin: 0 0 20px 0;
  padding: 0;
  gap: 0;
  flex-wrap: wrap;
}

.footer-menu li {
  margin: 0;
  padding: 0;
}

.footer-menu a {
  display: block;
  padding: 8px 16px;
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.footer-menu a:hover {
  color: var(--foreground);
}

.copyright {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

@media (max-width: 767px) {
  .footer-menu {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .footer-menu a {
    padding: 8px;
  }
}
