/* ============================================================
   STYLE.CSS — Migliori Casinò Online Italia 2026
   Design: Dark Gambling + Italian Flag Colors
   Author: Senior Web Developer & SEO Specialist
   ============================================================ */

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: #0a0a18;
  color: #e4e4f0;
  font-family: system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: #ffd700;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #ffe566;
  text-decoration: underline;
}

ul, ol {
  list-style: none;
}

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  --bg-base:        #0a0a18;
  --bg-card:        #12122a;
  --bg-card-hover:  #18183a;
  --bg-deep:        #060612;
  --gold:           #ffd700;
  --gold-light:     #ffe566;
  --gold-dark:      #cc9900;
  --orange:         #ff8c00;
  --green-it:       #009246;
  --white-it:       #ffffff;
  --red-it:         #ce2b37;
  --red-dark:       #9a1e28;
  --text-primary:   #e4e4f0;
  --text-secondary: #b0b0cc;
  --text-muted:     #707090;
  --border:         #1e1e3a;
  --border-light:   #252548;
  --header-h:       62px;
  --radius:         10px;
  --radius-sm:      6px;
  --shadow-gold:    0 0 0 1px rgba(255,215,0,.25), 0 4px 24px rgba(255,215,0,.08);
  --shadow-card:    0 2px 16px rgba(0,0,0,.4);
  --transition:     0.2s ease;
}

/* ===== SCROLL MARGIN FOR ALL ANCHOR TARGETS ===== */
[id] {
  scroll-margin-top: calc(var(--header-h) + 12px);
}

/* ===== CONTAINER ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .container { padding: 0 24px; }
}

/* ============================================================
   ITALIAN FLAG STRIPE (inside header)
   ============================================================ */
.it-stripe {
  display: flex;
  height: 3px;
  width: 100%;
}

.it-stripe .it-g { flex: 1; background: var(--green-it); }
.it-stripe .it-w { flex: 1; background: var(--white-it); }
.it-stripe .it-r { flex: 1; background: var(--red-it); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(10, 10, 24, 0.97);
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: box-shadow var(--transition);
}

.site-header.scrolled {
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.6);
  border-bottom-color: rgba(255, 215, 0, 0.35);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--header-h);
}

/* Logo */
.header-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-logo img {
  height: 42px;
  width: auto;
}

/* Desktop nav (hidden on mobile) */
.header-nav {
  display: none;
}

.header-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-nav a {
  color: #c0c0de;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
}

.header-nav a:hover {
  color: var(--gold);
  background: rgba(255, 215, 0, 0.06);
  text-decoration: none;
}

@media (min-width: 1024px) {
  .header-nav {
    display: flex;
    margin-left: auto;
  }
  .header-cta {
    margin-left: 0 !important;
  }
}

/* CTA Button in header */
.header-cta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--orange) 100%);
  color: #0a0a18 !important;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 9px 16px;
  border-radius: 8px;
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none !important;
  flex-shrink: 0;
}

.header-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.35);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  position: relative;
  background: linear-gradient(160deg, #0a0a18 0%, #0e1830 42%, #091609 100%);
  padding: 34px 0 30px;
  text-align: center;
  overflow: hidden;
}

/* Radial gold glow behind h1 */
.hero::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 350px;
  background: radial-gradient(ellipse at center, rgba(255,215,0,.055) 0%, transparent 70%);
  pointer-events: none;
}

/* Floating casino symbols (decorative) */
.hero-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.ds {
  position: absolute;
  font-size: 2.8rem;
  opacity: 0.035;
  animation: floatSym 10s ease-in-out infinite;
  user-select: none;
}

.ds1 { top: 8%;  left: 4%;  animation-delay: 0s; }
.ds2 { top: 55%; left: 9%;  animation-delay: 2s;  font-size: 2.2rem; }
.ds3 { top: 15%; right: 6%; animation-delay: 1s;  font-size: 3rem; }
.ds4 { bottom: 12%; right: 4%; animation-delay: 3.5s; }
.ds5 { top: 45%; right: 18%; animation-delay: 5s;  font-size: 2rem; }
.ds6 { bottom: 20%; left: 22%; animation-delay: 4s; font-size: 1.8rem; }

@keyframes floatSym {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-14px) rotate(8deg); }
}

.hero .container {
  position: relative;
  z-index: 1;
}

/* TOP BADGE */
.hero-top-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: #0a0a18;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 14px;
  text-transform: uppercase;
}

/* H1 */
.hero h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.75rem);
  font-weight: 800;
  color: var(--gold);
  text-shadow: 0 2px 24px rgba(255,215,0,.2);
  margin-bottom: 14px;
  line-height: 1.2;
}

/* Intro paragraph */
.hero-intro {
  max-width: 760px;
  margin: 0 auto 20px;
  color: #a8a8c8;
  font-size: 0.97rem;
  line-height: 1.75;
}

/* Badge chips row */
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.hero-chips span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,215,0,.06);
  border: 1px solid rgba(255,215,0,.18);
  color: #c8c8e8;
  font-size: 0.82rem;
  padding: 5px 14px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ============================================================
   LISTING SECTION
   ============================================================ */
.listing-section {
  padding: 44px 0 48px;
  background: linear-gradient(180deg, #0c0c20 0%, var(--bg-base) 100%);
}

.listing-title {
  font-size: clamp(1.2rem, 2.8vw, 1.8rem);
  font-weight: 800;
  color: var(--gold);
  text-align: center;
  line-height: 1.3;
  margin-bottom: 8px;
}

.listing-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 28px;
}

/* ===== CASINO LIST ===== */
.casino-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ===== CASINO CARD ===== */
.casino-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-card);
}

.casino-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 40px rgba(0,0,0,.45);
}

/* Featured card (#1) */
.card-featured {
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
}

.card-featured:hover {
  box-shadow: 0 0 0 1px rgba(255,215,0,.4), 0 12px 40px rgba(255,215,0,.1);
}

/* ---- RANK BLOCK ---- */
.card-rank {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #16162e;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.card-featured .card-rank {
  background: linear-gradient(135deg, var(--gold) 0%, var(--orange) 100%);
  border-bottom-color: transparent;
}

.rank-num {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}

.card-featured .rank-num {
  color: #0a0a18;
}

.rank-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange);
}

.card-featured .rank-label {
  color: rgba(10,10,24,.75);
}

/* ---- MAIN BLOCK ---- */
.card-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  flex: 1;
}

/* ---- BRAND ---- */
.card-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.card-logo-box {
  width: 96px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a32;
  border-radius: 8px;
  padding: 6px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border);
}

.card-logo-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.card-brand-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.card-stars {
  display: flex;
  align-items: center;
  gap: 5px;
}

.stars-ico {
  color: var(--gold);
  font-size: 0.88rem;
  letter-spacing: 1px;
  line-height: 1;
}

.stars-num {
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ---- BONUS BLOCK ---- */
.card-bonus {
  background: rgba(255,215,0,.04);
  border: 1px solid rgba(255,215,0,.1);
  border-radius: 8px;
  padding: 12px 14px;
}

.bonus-lbl {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 6px;
}

.bonus-txt {
  color: #d0d0ec;
  font-size: 0.92rem;
  line-height: 1.4;
  margin: 0 0 6px;
}

.bonus-txt strong {
  color: var(--gold);
}

.bonus-dep {
  display: block;
  font-size: 0.75rem;
  color: #5a5a80;
  line-height: 1.4;
}

/* ---- FEATURES ---- */
.card-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.card-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a8a8cc;
  font-size: 0.86rem;
  line-height: 1.3;
}

.chk {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

/* ---- CTA BLOCK ---- */
.card-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.btn-play {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, var(--red-it) 0%, var(--red-dark) 100%);
  color: #fff !important;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  padding: 13px 20px;
  border-radius: 8px;
  letter-spacing: 0.02em;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
  text-decoration: none !important;
  line-height: 1.2;
}

.btn-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(206,43,55,.4);
  filter: brightness(1.08);
}

.cta-note {
  font-size: 0.7rem;
  color: #484870;
  text-align: center;
}

/* ===== DESKTOP CARD LAYOUT (horizontal) ===== */
@media (min-width: 768px) {
  .casino-card {
    flex-direction: row;
    align-items: stretch;
  }

  .card-rank {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 74px;
    padding: 16px 10px;
    border-bottom: none;
    border-right: 1px solid var(--border);
    gap: 4px;
  }

  .card-featured .card-rank {
    border-right-color: rgba(255,215,0,.3);
  }

  .card-main {
    flex: 1;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 16px;
    padding: 18px 20px;
  }

  .card-brand {
    flex: 0 0 160px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .card-logo-box {
    width: 108px;
    height: 54px;
  }

  .card-bonus {
    flex: 1;
    min-width: 0;
  }

  .card-features {
    flex: 0 0 196px;
    gap: 9px;
  }

  .card-cta {
    flex: 0 0 148px;
    border-top: none;
    border-left: 1px solid var(--border);
    padding: 18px 14px;
    justify-content: center;
  }
}

@media (min-width: 1024px) {
  .card-brand      { flex: 0 0 170px; }
  .card-features   { flex: 0 0 210px; }
  .card-cta        { flex: 0 0 160px; }
}

/* ============================================================
   CONTENT SECTION
   ============================================================ */
.content-section {
  padding: 56px 0 64px;
  background: var(--bg-base);
}

.content-article {
  max-width: 880px;
  margin: 0 auto;
}

/* ===== TYPOGRAPHY IN CONTENT ===== */

.content-article h2 {
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  font-weight: 700;
  color: var(--gold);
  margin: 52px 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,215,0,.15);
  line-height: 1.3;
  position: relative;
}

/* Subtle left accent line on h2 */
.content-article h2::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 2px;
  bottom: 14px;
  width: 3px;
  background: linear-gradient(180deg, var(--green-it), var(--red-it));
  border-radius: 2px;
}

@media (max-width: 767px) {
  .content-article h2::before { display: none; }
}

.content-article h2:first-child {
  margin-top: 0;
}

.content-article h3 {
  font-size: clamp(0.98rem, 1.8vw, 1.15rem);
  font-weight: 600;
  color: #d8d8f8;
  margin: 30px 0 10px;
  line-height: 1.35;
}

/* H3 not inside FAQ (default style) */
.content-article h3:not(.faq-q) {
  padding-left: 12px;
  border-left: 3px solid var(--green-it);
}

.content-article p {
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.8;
  margin-bottom: 16px;
}

.content-article p:last-child {
  margin-bottom: 0;
}

.content-article strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Lists */
.content-article ul {
  list-style: disc;
  padding-left: 20px;
  margin: 14px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.content-article ol {
  list-style: decimal;
  padding-left: 22px;
  margin: 14px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.content-article li {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  padding-left: 4px;
}

.content-article li::marker {
  color: var(--gold);
}

.content-article li strong {
  color: var(--text-primary);
}

/* ===== TABLES ===== */
.content-article table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.87rem;
  border-radius: var(--radius);
}

.content-article thead tr th,
.content-article tbody tr:first-child td {
  background: #16162e;
  color: #e4e4ff;
  font-weight: 600;
}

.content-article td,
.content-article th {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  color: var(--text-secondary);
  vertical-align: top;
  min-width: 100px;
  line-height: 1.5;
}

.content-article tbody tr:first-child td strong {
  color: var(--gold);
}

.content-article tbody tr:nth-child(even) td {
  background: rgba(255,255,255,.015);
}

.content-article tbody tr:hover td {
  background: rgba(255,215,0,.025);
}

.content-article td p {
  margin: 0;
  font-size: inherit;
}

.content-article td strong {
  color: #d8d8f8;
}

/* ============================================================
   FAQ ACCORDION STYLES
   (classes added by JS to h3/p elements inside FAQ section)
   ============================================================ */

/* FAQ Question (h3 converted to accordion trigger) */
.faq-q {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  cursor: pointer;
  padding: 14px 16px !important;
  margin: 0 0 4px !important;
  border-left: none !important;   /* override default h3 border-left */
  background: #14142c;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: #d8d8f8 !important;
  font-size: 0.98rem !important;
  font-weight: 600 !important;
  line-height: 1.35;
  user-select: none;
  transition: background var(--transition), border-color var(--transition);
}

.faq-q:hover {
  background: #1c1c3a;
  border-color: rgba(255,215,0,.25);
}

.faq-q:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.faq-q[aria-expanded="true"] {
  background: #1a1a38;
  border-color: rgba(255,215,0,.4);
  color: var(--gold) !important;
  border-radius: 8px 8px 0 0;
  margin-bottom: 0 !important;
}

/* Toggle icon */
.faq-tog {
  font-size: 1.4rem;
  color: var(--gold);
  font-weight: 300;
  line-height: 1;
  flex-shrink: 0;
  margin-left: 12px;
  transition: transform var(--transition);
}

/* FAQ Answer (p element after the faq-q) */
.faq-ans {
  background: #0f0f2a;
  border: 1px solid rgba(255,215,0,.15);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 14px 16px !important;
  margin: 0 0 14px !important;
  color: var(--text-secondary) !important;
  font-size: 0.94rem !important;
  line-height: 1.75 !important;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  padding: 50px 0 24px;
}

/* Footer grid */
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 36px;
}

@media (min-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
  }
}

/* Footer brand */
.footer-brand .footer-logo-link {
  display: inline-flex;
  margin-bottom: 12px;
}

.footer-brand .footer-logo-link img {
  height: 40px;
  width: auto;
}

.footer-tagline {
  color: #5050a0;
  font-size: 0.83rem;
  line-height: 1.5;
  max-width: 280px;
}

/* Footer nav & casino lists */
.footer-nav h3,
.footer-casinos h3 {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.footer-nav ul,
.footer-casinos ul {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-nav a,
.footer-casinos a {
  color: #6060a0;
  font-size: 0.86rem;
  transition: color var(--transition);
  text-decoration: none;
}

.footer-nav a:hover,
.footer-casinos a:hover {
  color: var(--gold);
}

/* Responsible gaming banner */
.footer-responsible {
  margin-bottom: 28px;
}

.responsible-banner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(206,43,55,.07);
  border: 1px solid rgba(206,43,55,.18);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.resp-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  line-height: 1.3;
}

.responsible-banner strong {
  display: block;
  color: #ff7070;
  font-size: 0.88rem;
  margin-bottom: 5px;
}

.responsible-banner p {
  color: #6868a0;
  font-size: 0.8rem;
  line-height: 1.55;
  margin: 0;
}

/* Footer bottom */
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 22px;
  text-align: center;
}

.footer-disclaimer {
  color: #404068;
  font-size: 0.76rem;
  line-height: 1.6;
  margin-bottom: 10px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.footer-copy {
  color: #333358;
  font-size: 0.76rem;
}

/* ============================================================
   RESPONSIVE MOBILE FINE-TUNING
   ============================================================ */

/* Prevent horizontal overflow globally */
@media (max-width: 767px) {

  .content-section {
    padding: 40px 0 48px;
  }

  .content-article table {
    font-size: 0.82rem;
  }

  .content-article td,
  .content-article th {
    padding: 8px 10px;
    min-width: 90px;
  }

  .hero {
    padding: 28px 0 24px;
  }

  .listing-section {
    padding: 32px 0 36px;
  }

  .listing-title {
    font-size: 1.15rem;
  }

  .card-main {
    gap: 12px;
    padding: 14px;
  }

  .card-logo-box {
    width: 80px;
    height: 44px;
  }

  .card-name {
    font-size: 1rem;
  }

  .hero h1 {
    font-size: 1.65rem;
  }

  .hero-intro {
    font-size: 0.91rem;
  }

  .site-footer {
    padding: 36px 0 20px;
  }
}

/* Ultra-small screens */
@media (max-width: 360px) {
  .header-cta {
    padding: 8px 12px;
    font-size: 0.78rem;
  }
  .hero h1 {
    font-size: 1.45rem;
  }
}

/* ============================================================
   PRINT STYLES (basic)
   ============================================================ */
@media print {
  .site-header,
  .hero-decor,
  .card-cta,
  .site-footer {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
  }
}
