/* ==========================================================================
   CSS Variables (Tokens) & Design System - LottoItallia
   ========================================================================== */
:root {
  /* Colors */
  --ink-petrol: #0E3B3C;
  --brass: #B8902F;
  --coral: #D9694B;
  --parchment: #F6EFE2;
  --wine: #5B2333;
  --ink-100: #1B2426;

  /* Typography */
  --font-display: 'Bodoni Moda', serif;
  --font-body: 'Sora', sans-serif;
  --font-mono: 'Space Mono', monospace;

  /* Other Tokens */
  --radius: 4px;
  --transition: all 0.2s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --transition: none;
  }
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--ink-100);
  background-color: var(--parchment);
  line-height: 1.6;
  overflow-x: hidden;
  min-width: 320px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

ul {
  list-style: none;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.text-mono {
  font-family: var(--font-mono);
}

.text-wine {
  color: var(--wine);
}

.text-brass {
  color: var(--brass);
}

.caps-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.875rem;
}

/* ==========================================================================
   Components
   ========================================================================== */
/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-align: center;
}

.btn--primary {
  background-color: var(--brass);
  color: #000000;
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(184, 144, 47, 0.3);
}

.btn--dark {
  background-color: var(--ink-petrol);
  color: var(--parchment);
}

.btn--dark:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 59, 60, 0.3);
}

/* Container */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 2rem;
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
}

/* Badge */
.badge {
  display: inline-block;
  background-color: var(--coral);
  color: white;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  border-radius: var(--radius);
  text-transform: uppercase;
}

/* Game Card */
.game-card {
  background-color: var(--parchment);
  border: 1px solid var(--brass);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.game-card__badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
}

.game-card__image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-bottom: 1px solid var(--brass);
}

.game-card__content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.game-card__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.game-card__desc {
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.game-card__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  font-family: var(--font-mono);
}

.game-card__stats div {
  display: flex;
  flex-direction: column;
}

.game-card__stats span {
  font-size: 0.75rem;
  font-family: var(--font-body);
  color: var(--ink-petrol);
  opacity: 0.7;
}

.game-card__footer {
  padding-top: 1rem;
  border-top: 1px dashed var(--brass);
  font-size: 0.75rem;
  text-align: center;
  color: var(--ink-petrol);
  opacity: 0.8;
  margin-top: auto;
}

/* Section styling */
.section {
  padding: 5rem 0;
}

.section--dark {
  background-color: var(--ink-petrol);
  color: var(--parchment);
}

/* Divider Signature Motif */
.divider {
  width: 100%;
  height: 60px;
  background-image: url('../assets/images/editorial_12.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.1;
}

/* ==========================================================================
   Header
   ========================================================================== */
.header {
  background-color: var(--ink-petrol);
  color: var(--parchment);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(184, 144, 47, 0.2);
}

.header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header__logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--brass);
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header__menu {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.header__menu-link {
  font-size: 0.875rem;
  font-family: var(--font-mono);
}

.header__menu-link:hover {
  color: var(--brass);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header__lang {
  background: none;
  border: none;
  color: var(--parchment);
  font-family: var(--font-mono);
  cursor: pointer;
  font-size: 0.875rem;
}

.header__lang:hover {
  color: var(--brass);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--parchment);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 10px;
  margin-right: -10px;
  z-index: 10;
}

@media (max-width: 1024px) {
  .header__menu {
    display: none;
  }
  
  .hamburger {
    display: block;
  }

  .header__nav.is-open .header__menu {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--ink-petrol);
    padding: 2rem;
    border-bottom: 1px solid rgba(184, 144, 47, 0.2);
  }
}

.btn--mobile-only {
  display: none;
}

@media (max-width: 440px) {
  .header__actions .btn {
    display: none;
  }
  
  .btn--mobile-only {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 1rem;
  }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  position: relative;
  background-color: var(--ink-petrol);
  color: var(--parchment);
  padding: 8rem 0;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 100vw;
  max-width: 800px;
  max-height: 800px;
  transform: translate(-50%, -50%);
  background-image: url('../assets/images/editorial_1.webp');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.1;
  animation: rotateWheel 60s linear infinite;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .hero::before {
    animation: none;
    transform: translate(-50%, -50%) rotate(10deg);
  }
}

@keyframes rotateWheel {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.hero__subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background-color: var(--ink-petrol);
  color: var(--parchment);
  padding: 4rem 0 2rem;
  border-top: 1px solid rgba(184, 144, 47, 0.2);
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.footer__title {
  font-family: var(--font-display);
  color: var(--brass);
  margin-bottom: 1rem;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.footer__links a:hover {
  color: var(--brass);
}

.footer__disclaimer {
  font-size: 0.75rem;
  opacity: 0.6;
  border-top: 1px solid rgba(246, 239, 226, 0.1);
  padding-top: 2rem;
  text-align: center;
}

/* ==========================================================================
   Grid Layouts
   ========================================================================== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.grid-contact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}

@media (min-width: 1000px) {
  .grid-contact {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--brass);
  border-radius: var(--radius);
  background-color: var(--parchment);
  font-family: var(--font-body);
}

.form-control:focus {
  outline: none;
  border-color: var(--ink-petrol);
  box-shadow: 0 0 0 2px rgba(14, 59, 60, 0.1);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-message {
  display: none;
  padding: 1rem;
  border-radius: var(--radius);
  margin-top: 1rem;
}

.form-message.success {
  display: block;
  background-color: rgba(184, 144, 47, 0.1);
  border: 1px solid var(--brass);
  color: var(--ink-petrol);
}

.form-message.error {
  display: block;
  background-color: rgba(217, 105, 75, 0.1);
  border: 1px solid var(--coral);
  color: var(--wine);
}

/* ==========================================================================
   Iframe / Game container
   ========================================================================== */
.qeq {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--brass);
}

.qeq iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   Legal / Info Pages Content
   ========================================================================== */
.legal-content {
  max-width: 800px;
  margin: 0 auto;
}

.legal-content h2 {
  margin-top: 3rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.legal-content p, .legal-content ul {
  margin-bottom: 1rem;
}

.legal-content ul {
  padding-left: 1.5rem;
  list-style: disc;
}

/* Table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .comparison-table {
    display: table;
    white-space: normal;
  }
}

.comparison-table th,
.comparison-table td {
  padding: 1rem;
  border: 1px solid var(--brass);
  text-align: left;
}

.comparison-table th {
  background-color: var(--ink-petrol);
  color: var(--parchment);
  font-family: var(--font-mono);
}

/* FAQ */
.faq-item {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(184, 144, 47, 0.2);
  padding-bottom: 1.5rem;
}

.faq-question {
  font-weight: bold;
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
