/* ==========================================================================

CSS VARIABLES & THEME RESETS
========================================================================== */
:root {
/ Italian Flag Brand Accents */
--green: #008c45;
--green-hover: #00b359;
--white: #f4f4f6;
--red: #cd212a;
--red-hover: #e63946;

/* Dark Theme Palette (Default) */
--bg-dark: #121214;
--surface-dark: #1e1e22;
--surface-card: #25252b;
--surface-border: #33333d;
--text-main: #f4f4f6;
--text-muted: #a0a0ab;
--radius: 12px;

/* Grid & Layout System */
--leftnav: 260px;
--main: 940px;
--gap: 20px;
--container: calc(var(--leftnav) + var(--main) + var(--gap));
}

*, *::before, *::after {
box-sizing: border-box;
}

html, body {
height: 100%;
margin: 0;
-webkit-text-size-adjust: 100%;
}

body {
font-family: 'Open Sans', sans-serif;
background-color: var(--bg-dark);
background-image: linear-gradient(
90deg,
rgba(0, 140, 69, 0.08) 0%,
rgba(18, 18, 20, 1) 50%,
rgba(205, 33, 42, 0.08) 100%
);
color: var(--text-main);
overflow-x: hidden;
}

h1, h2, h3, h4, .title, .btn, .nav-head, .mobile-nav-label {
font-family: 'Oswald', sans-serif;
}

.container {
width: min(100% - 32px, var(--container));
margin: 0 auto;
}

/* ==========================================================================
2. HEADER & NAVIGATION (DESKTOP & SLIDE-OUT DRAWER)
========================================================================== */
header.top {
background: rgba(26, 26, 30, 0.94);
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
backdrop-filter: blur(10px);
position: sticky;
top: 0;
z-index: 100;
border-bottom: 1px solid var(--surface-border);
min-height: 64px;
}

header .inner {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 0;
min-height: 64px;
}

.brand {
display: flex;
align-items: center;
gap: 12px;
}

header .brand a.brand-link,
.brand a.brand-link {
display: flex;
align-items: center;
gap: 12px;
text-decoration: none;
}

.brand img.logo {
width: 42px;
height: 42px;
object-fit: contain;
}

.brand .title,
header .brand .title {
font-size: 1.5rem !important;
font-weight: 700;
text-transform: uppercase;
color: var(--text-main);
letter-spacing: 0.5px;
margin: 0;
}

.header-actions {
display: flex;
align-items: center;
gap: 8px;
}

.header-actions .btn,
.header-actions .lang-select select {
  height: 38px !important;
  min-height: 38px !important;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.header-actions .btn-mobile-toggle {
  height: 38px !important;
  min-height: 38px !important;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.lang-select select {
padding: 0 10px;
border-radius: 8px;
border: 1px solid var(--surface-border);
background: var(--surface-card);
font-family: 'Oswald', sans-serif;
color: var(--text-main);
cursor: pointer;
line-height: 38px;
}

/* Modern Hamburger Button */
.btn-mobile-toggle {
display: none;
background: var(--surface-card);
border: 1px solid var(--surface-border);
color: var(--text-main);
border-radius: 8px;
width: 40px;
cursor: pointer;
font-size: 20px;
transition: 0.2s ease;
}

.btn-mobile-toggle:hover {
background: var(--surface-border);
color: #fff;
}

/* Off-Canvas Slide Drawer */
.mobile-drawer-backdrop {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.7);
backdrop-filter: blur(4px);
z-index: 999;
opacity: 0;
visibility: hidden;
transition: 0.3s ease;
}

.mobile-drawer-backdrop.is-open {
opacity: 1;
visibility: visible;
}

.mobile-drawer {
position: fixed;
top: 0;
right: -320px;
width: 300px;
height: 100%;
background: var(--surface-dark);
border-left: 1px solid var(--surface-border);
z-index: 1000;
box-shadow: -10px 0 30px rgba(0,0,0,0.5);
display: flex;
flex-direction: column;
transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
overflow-y: auto;
}

.mobile-drawer.is-open {
right: 0;
}

.mobile-drawer-header {
padding: 16px 20px;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid var(--surface-border);
}

.mobile-drawer-nav {
padding: 16px;
display: flex;
flex-direction: column;
gap: 4px;
}

.mobile-drawer-nav a {
padding: 12px 14px;
border-radius: 8px;
color: var(--text-main);
text-decoration: none;
font-family: 'Oswald', sans-serif;
font-size: 1.05rem;
text-transform: uppercase;
display: flex;
align-items: center;
justify-content: space-between;
transition: background 0.15s ease;
}

.mobile-drawer-nav a:hover,
.mobile-drawer-nav a.active {
background: rgba(205, 33, 42, 0.15);
color: var(--red-hover);
border-left: 4px solid var(--red);
}

.mobile-drawer-nav .nav-sec-title {
font-size: 0.78rem;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 1px;
margin: 16px 8px 6px 8px;
font-weight: 700;
}

/* Legacy Mobile Dropdown fallback */
.mobile-nav {
display: none;
padding: 10px 0;
}

.mobile-nav-label {
color: var(--text-main);
margin-right: 8px;
}

.mobile-nav select {
width: 100%;
padding: 10px;
border-radius: 8px;
background: var(--surface-card);
border: 1px solid var(--surface-border);
color: var(--text-main);
font-family: 'Oswald', sans-serif;
font-size: 15px;
cursor: pointer;
}
@media (min-width: 992px) {
  .mobile-drawer,
  .mobile-drawer-backdrop {
    display: none !important;
  }
}
/* ==========================================================================
3. BUTTONS & BADGES
========================================================================== */
.btn {
font-family: 'Oswald', sans-serif;
font-size: 15px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
text-decoration: none;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
text-align: center;
gap: 8px;
padding: 10px 18px;
min-height: 44px; / Touch target standard */
border-radius: 8px;
background: var(--surface-card);
color: var(--text-main);
border: 1px solid var(--surface-border);
transition: all 0.2s ease;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn:hover {
transform: translateY(-2px);
background: var(--surface-border);
box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

.btn.light {
background: var(--text-main);
color: var(--bg-dark);
border: 1px solid var(--text-main);
}

.btn-fb {
background: linear-gradient(135deg, #1877f2, #0e52b2);
border-color: #1877f2;
color: #ffffff !important;
}

.btn-ig {
background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
border-color: #dc2743;
color: #ffffff !important;
}

/* Update these rules in core.css */

.btn-hero-cta {
  background: transparent;
  color: var(--red) !important;
  border: 2px solid var(--red);
  font-size: 16px;
  font-weight: 700;
  padding: 13px 23px; /* Slightly adjusted to account for the thicker 2px border */
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(205, 33, 42, 0.4); /* Keeps the red glow */
  width: 100%;
  transition: all 0.3s ease;
}

.btn-hero-cta:hover {
  background: linear-gradient(135deg, var(--red), var(--red-hover));
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(205, 33, 42, 0.6);
}

.btn-portal-primary {
  background: transparent;
  color: var(--red) !important;
  border: 2px solid var(--red);
  font-weight: 700;
  transition: all 0.3s ease;
}

.btn-portal-primary:hover {
  background: var(--red);
  color: #ffffff !important;
}

.btn-portal-secondary {
background: transparent;
color: var(--text-main);
border: 1px solid var(--surface-border);
}

.btn-portal-secondary:hover {
border-color: var(--text-main);
background: rgba(255, 255, 255, 0.05);
}

.btn-theme-toggle {
background: var(--surface-card);
border: 1px solid var(--surface-border);
color: var(--text-main);
padding: 7px 14px;
border-radius: 8px;
font-size: 13px;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
}

.event-badge,
.event-badge-tag {
display: inline-block;
background: rgba(205, 33, 42, 0.2);
color: var(--white);
border: 1px solid var(--red);
font-family: 'Oswald', sans-serif;
font-size: 11px;
font-weight: 600;
padding: 4px 10px;
border-radius: 6px;
text-transform: uppercase;
letter-spacing: 0.8px;
box-shadow: 0 0 10px rgba(205, 33, 42, 0.3);
}

.community-badge,
.community-badge-tag {
display: inline-block;
background: rgba(0, 140, 69, 0.2);
color: var(--white);
border: 1px solid var(--green);
font-family: 'Oswald', sans-serif;
font-size: 11px;
font-weight: 600;
padding: 4px 10px;
border-radius: 6px;
text-transform: uppercase;
letter-spacing: 0.8px;
box-shadow: 0 0 10px rgba(0, 140, 69, 0.3);
}

/* ==========================================================================
4. LAYOUT & GRID ARCHITECTURE
========================================================================== */
.wrap {
padding: 24px 0 60px 0;
}

.grid {
display: grid;
grid-template-columns: var(--leftnav) minmax(0, 1fr);
gap: var(--gap);
align-items: start;
}

.main-column {
display: flex;
flex-direction: column;
gap: 20px;
width: 100%;
}

.card {
background: var(--surface-dark);
border-radius: var(--radius);
border: 1px solid var(--surface-border);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
padding: 22px;
width: 100%;
margin-bottom: 20px;
}

.card:last-child {
margin-bottom: 0;
}

.two-col {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
}

.card-spotlight-box {
background: linear-gradient(145deg, var(--surface-dark), rgba(205, 33, 42, 0.12));
border-left: 5px solid var(--red);
}

.card-community-box {
background: linear-gradient(145deg, var(--surface-dark), rgba(0, 140, 69, 0.12));
border-left: 5px solid var(--green);
}

.event-date-location {
font-weight: 600;
color: var(--red-hover);
margin: 6px 0 12px;
}

/* ==========================================================================
5. SIDEBAR NAVIGATION
========================================================================== */
.tabs-box {
background: var(--surface-dark);
border: 1px solid var(--surface-border);
border-radius: var(--radius);
padding: 14px;
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
margin-bottom: 20px;
}

.sidebar-column .tabs-box:last-child {
margin-bottom: 0;
}

nav.primary.side {
display: flex;
flex-direction: column;
gap: 6px;
}

nav.primary.side a {
font-family: 'Oswald', sans-serif;
padding: 10px 14px;
border-radius: 6px;
background: var(--surface-card);
border: 1px solid var(--surface-border);
border-left: 3px solid transparent;
color: var(--text-main);
text-decoration: none;
font-size: 15px;
font-weight: 500;
letter-spacing: 0.5px;
text-align: center;
display: block;
transition: all 0.15s ease;
}

nav.primary.side a:hover {
background: var(--surface-border);
color: #ffffff;
transform: translateX(2px);
border-left-color: var(--red);
}

nav.primary.side a.active {
background: linear-gradient(90deg, rgba(0, 140, 69, 0.3), var(--surface-card) 50%, rgba(205, 33, 42, 0.3));
border-color: var(--red);
color: #ffffff;
border-left-color: var(--red);
}

nav.primary.side a[href="faq.html"] {
border: 1px solid rgba(244, 244, 246, 0.22);
background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), var(--surface-card));
box-shadow: 0 0 10px rgba(255, 255, 255, 0.06);
font-weight: 600;
}

nav.primary.side a[href="faq.html"]:hover {
border-color: var(--red);
background: linear-gradient(145deg, rgba(205, 33, 42, 0.15), var(--surface-card));
box-shadow: 0 0 12px rgba(205, 33, 42, 0.3);
transform: translateY(-1px);
}

.nav-head {
font-family: 'Oswald', sans-serif;
font-size: 13px;
text-transform: uppercase;
color: var(--text-main);
background: var(--surface-card);
padding: 8px 12px;
border-radius: 6px;
margin: 12px 0 6px;
letter-spacing: 0.8px;
font-weight: 700;
text-align: center;
border: 1px solid var(--surface-border);
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 2px 6px rgba(0, 0, 0, 0.3);
position: relative;
}

.nav-head:first-child {
margin-top: 0;
}

.nav-head[data-i18n="navEvent"] {
border: 1px solid var(--red) !important;
box-shadow: 0 0 8px rgba(205, 33, 42, 0.35) !important;
}

.nav-head[data-i18n="navGeneral"] {
border: 1px solid var(--green) !important;
box-shadow: 0 0 8px rgba(0, 140, 69, 0.35) !important;
}

.sponsor-sidebar-card .nav-head {
border: 1px solid rgba(244, 244, 246, 0.4) !important;
background: var(--surface-card);
box-shadow: 0 0 8px rgba(244, 244, 246, 0.15) !important;
}

.nav-sep {
height: 8px;
}

/* ==========================================================================
6. FORMS & INPUT CONTROLS (iOS Auto-zoom Prevention)
========================================================================== */
.field {
display: flex;
flex-direction: column;
gap: 6px;
}

.field label {
font-size: 14px;
color: var(--text-main);
}

.field input,
.field select,
.field textarea {
border: 1px solid var(--surface-border);
border-radius: 8px;
padding: 10px 12px;
font-size: 16px !important; /* CRITICAL: Prevents iOS Safari auto-zoom */
background: var(--surface-card);
color: var(--text-main);
font-family: 'Open Sans', sans-serif;
box-sizing: border-box;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
outline: none;
border-color: var(--red);
background: var(--surface-dark);
}

/* ==========================================================================
7. FOOTER
========================================================================== */
footer {
background: var(--surface-dark);
border-top: 1px solid var(--surface-border);
padding: 24px 0;
font-size: 13px;
color: var(--text-muted);
margin-top: 40px;
}

footer .inner,
footer .footer-inner {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 16px;
}

.privacy-link-wrap {
margin-top: 6px;
}

.footer-privacy-link {
color: var(--text-muted, #aaa);
font-size: 0.85rem;
text-decoration: underline;
}

.ftm-branding-box {
display: flex;
align-items: center;
gap: 10px;
background: rgba(255, 255, 255, 0.03);
padding: 8px 12px;
border-radius: 8px;
border: 1px solid rgba(255, 255, 255, 0.08);
}

.ftm-built-text {
font-size: 0.8rem;
color: #888;
}

.ftm-link {
display: flex;
align-items: center;
text-decoration: none;
line-height: 0;
}

.ftm-link img {
max-height: 24px;
width: auto;
object-fit: contain;
display: block;
transition: opacity 0.2s ease, transform 0.2s ease;
}

.ftm-link:hover img {
opacity: 0.85;
transform: scale(1.03);
}

/* ==========================================================================
8. LIGHT THEME PALETTE & OVERRIDES
========================================================================== */
body.light-theme {
--bg-dark: #f5f5f7;
--surface-dark: #ffffff;
--surface-card: #f8f8fc;
--surface-border: #dcdce2;
--text-main: #18181a;
--text-muted: #555562;

background-color: var(--bg-dark);
background-image: linear-gradient(
90deg,
rgba(0, 140, 69, 0.05) 0%,
rgba(245, 245, 247, 1) 50%,
rgba(205, 33, 42, 0.05) 100%
);
color: var(--text-main);
}

body.light-theme header.top {
background: rgba(255, 255, 255, 0.94);
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
border-bottom-color: var(--surface-border);
}

body.light-theme .brand .title {
color: #181818;
}

body.light-theme .card {
background: #ffffff;
border-color: var(--surface-border);
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

body.light-theme .tabs-box {
background: #ffffff;
border-color: var(--surface-border);
}

body.light-theme nav.primary.side a {
background: #f0f0f4;
color: #181818;
border-color: #dcdce2;
}

body.light-theme nav.primary.side a:hover {
background: #e2e2e8;
color: var(--red);
}

body.light-theme nav.primary.side a[href="faq.html"] {
border-color: rgba(205, 33, 42, 0.35);
background: linear-gradient(145deg, #ffffff, #f0f0f4);
box-shadow: 0 0 8px rgba(205, 33, 42, 0.12);
}

body.light-theme nav.primary.side a[href="faq.html"]:hover {
border-color: var(--red);
background: #ffffff;
box-shadow: 0 0 10px rgba(205, 33, 42, 0.25);
}

body.light-theme .nav-head {
background: #e4e4ea;
color: #181818;
}

body.light-theme .btn-portal-secondary {
background: #f0f0f4;
color: #181818;
border-color: var(--surface-border);
}

body.light-theme .btn-portal-secondary:hover {
background: #e2e2e8;
}

body.light-theme .btn-mobile-toggle,
body.light-theme .btn-theme-toggle {
background: #ffffff;
border-color: var(--surface-border);
color: #181818;
}

body.light-theme .mobile-drawer {
background: #ffffff;
border-left-color: var(--surface-border);
}

body.light-theme .mobile-drawer-header {
border-bottom-color: var(--surface-border);
}

body.light-theme .mobile-drawer-nav a {
color: #181818;
}

body.light-theme .event-badge,
body.light-theme .event-badge-tag {
color: #181818 !important;
font-weight: 700;
border-color: rgba(205, 33, 42, 0.6);
background: rgba(205, 33, 42, 0.15);
}

body.light-theme .community-badge,
body.light-theme .community-badge-tag {
color: #181818 !important;
font-weight: 700;
border-color: rgba(0, 140, 69, 0.6);
background: rgba(0, 140, 69, 0.15);
}

body.light-theme footer {
background: #ffffff;
border-top-color: var(--surface-border);
}

body.light-theme .btn-hero-cta,
body.light-theme .btn-portal-primary {
  color: var(--red) !important;
  border-color: var(--red);
  box-shadow: 0 4px 12px rgba(205, 33, 42, 0.25);
}

body.light-theme .btn-hero-cta:hover,
body.light-theme .btn-portal-primary:hover {
  color: #ffffff !important;
}

/* ==========================================================================
9. RESPONSIVE BREAKPOINTS
========================================================================== */
@media (max-width: 991px) {
.grid {
grid-template-columns: 1fr;
}

.tabs-box,
.sidebar-column {
display: none;
}

.btn-mobile-toggle {
display: inline-flex;
}

.two-col {
grid-template-columns: 1fr;
}
}

@media (max-width: 768px) {
  header .inner {
    flex-wrap: wrap;
    padding: 12px 0;
    position: relative; /* Anchors the hamburger menu */
  }
  
  .brand {
    max-width: calc(100% - 50px); /* Prevents text from overlapping the menu button */
  }
  
  /* Creates the second row and centers the buttons */
  .header-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
  }
  
  /* Pins the hamburger menu to the top right of the first row */
  .header-actions .btn-mobile-toggle {
    position: absolute;
    top: 12px;
    right: 0;
    margin: 0;
  }
  
  /* Hide only the theme toggle text to keep the row tidy */
  #themeToggleText {
    display: none;
  }
  
  .header-actions #fbBtn,
  .header-actions #igBtn {
    padding: 6px 10px;
    font-size: 13px;
  }
  
  .brand .title {
    font-size: 1.2rem !important;
  }
  
  .brand img.logo {
    width: 34px;
    height: 34px;
  }
}