.full-width-img {
  width: 100%;      
  height: auto;     
}

/* ===================================================== */
/* =================== THEME TOKENS ==================== */
/* ===================================================== */

:root {
  --bg: #ffffff;
  --text: #2D3C59;   /* before #111111 */
  --muted: #8e9296  ;
  --border: #e5e5e5;

  --btn-bg: #2D3C59; /* before #111111 */
  --btn-text: #ffffff;

  --header-bg: rgba(255, 255, 255, 0.75);
}

/* Manual dark mode (via .dark-mode on html) */
.dark-mode {
  --bg: #1A1A1A;
  --text: #2D3C59;   /* before #F0F0F0 */
  --muted: #8e9296;
  --border: #2c2c2c;

  --btn-bg: #2D3C59;  /* before #F0F0F0 */
  --btn-text: #1A1A1A;

  --header-bg: rgba(32, 32, 32, 0.85);
}


/* ===================================================== */
/* ======================= BASE ======================== */
/* ===================================================== */

html {
  transition: background-color 0.25s ease, color 0.25s ease;
}

body {
  margin: 0;
  font-family: "Ubuntu", system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background-color 0.25s ease, color 0.25s ease;
}

.site-content {
  max-width: 900px;
  margin: 4rem auto;
  padding: 0 1.2rem;
}


/* ===================================================== */
/* ===================== LANDING ======================= */
/* ===================================================== */

body.landing {
  overflow: hidden;
}

.landing-page {
  position: relative;
  height: 100vh;
  width: 100%;
  background-image: url("../img/zinal.jpg");
  background-size: cover;
  background-position: center;
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.landing-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #ffffff; /* important: fixed white for landing */
  padding: 1rem;
}

.landing-content h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.landing-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
}


/* ===================================================== */
/* ===================== BUTTONS ======================= */
/* ===================================================== */

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn.primary {
  background: var(--btn-bg);
  color: var(--btn-text);
}

.btn.secondary {
  border: 1px solid #ffffff;
  color: #ffffff;
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}


/* ===================================================== */
/* ====================== HEADER ======================= */
/* ===================================================== */

/* IMPORTANT: Only affects default layout, NOT landing */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;

  backdrop-filter: blur(8px);
  background: var(--header-bg);

  border-bottom: 1px solid var(--border);
  transition: all 0.25s ease;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  text-decoration: none;
  color: var(--text);
  font-size: 1.8rem;
  font-weight: 700;
  transition: opacity 0.2s ease;
}

.site-title:hover {
  opacity: 0.7;
}


/* ===================================================== */
/* =================== THEME TOGGLE ==================== */
/* ===================================================== */

.theme-toggle button {
  width: 40px;
  height: 40px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;

  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.theme-toggle img {
  width: 20px;
  height: 20px;
  pointer-events: none;
}


/* ===================================================== */
/* ====================== FOOTER ======================= */
/* ===================================================== */

/* Landing footer */
.landing-footer {
  position: absolute;
  bottom: 1rem;
  width: 100%;

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;

  font-size: 0.9rem;
  color: #dddddd;
  z-index: 1;
}

/* Default footer */
.site-footer {
  margin-top: 4rem;
  padding: 2rem 1rem;

  text-align: center;

  border-top: 1px solid var(--border);

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;

  font-size: 0.9rem;
}

.site-footer a,
.site-footer a:visited,
.site-footer a:hover,
.site-footer a:active {
  color: inherit;           
  text-decoration: none;    
}


/* ===================================================== */
/* ==================== GITHUB ICON ==================== */
/* ===================================================== */

.github-link {
  display: inline-flex;
  align-items: center;
}

.github-icon {
  width: 20px;
  height: 20px;
  opacity: 0.85;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.github-link:hover .github-icon {
  opacity: 1;
}

.dark-mode .github-icon {
  filter: invert(1);
}

.dark-mode .landing-page .github-icon {
  filter: none;
}

/* ===================================================== */
/* ==================== STATS PLOTS ==================== */
/* ===================================================== */

/* ---------- Header ---------- */

.plot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  /* gap: 1rem; */
}

.plot-header h2 {
  margin: 0;
}

.plot-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.90rem;
  position: relative;
}

.plot-toggle::after {
  content: "The detailed charts show the most performed \A sport according to each year and stat, \A together with the overall numbers.";
  position: absolute;
  bottom: -56px;
  right: 0;
  background: var(--text);
  color: white;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  /* white-space: nowrap; */
  white-space: pre; 
  text-align: left; 
}

.plot-toggle:hover::after {
  opacity: 1;
}

/* ---------- Layout Plots ---------- */

.plot-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 5% 0;   

  width: 100%;
  overflow: hidden; 
}

.plot-stat.reverse {
  flex-direction: row-reverse;
}

.plot-graph {
  /* flex: 0 0 72%; */
  flex: 1 1 72%;
  min-width: 0; 
}

.plot-highlight {
  flex: 0 0 28%;
  max-width: 28%;
  min-width: 0; 

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;  
  text-align: center;
  gap: 0;

  overflow: hidden;  

  /* padding-left: 4%; */
}

.plot-wrapper,
.plot-wrapper > div,
.js-plotly-plot {
  width: 100% !important;
}

/* ---------- Typography Unit ---------- */

/* .highlight-number {
  font-size: 6rem;        
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -2px;
} */

.highlight-number {
  font-size: clamp(2.5rem, 6vw, 6rem);
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 0.9;
}

.highlight-unit {
  font-size: 1.8rem;
  font-weight: 500;
  opacity: 0.7;
  margin-top: -0.1rem;
  /* margin-top: 0.5rem; */
}

/* ---------- Graph transition ---------- */

.plot-basic,
.plot-detailed {
  display: none;
}

.plot-basic.active,
.plot-detailed.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Toggle switch ---------- */

.switch {
  position: relative;

  width: 46px;
  height: 26px;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border);
  /* border-radius: 34px; */
  border-radius: 999px;
  transition: 0.25s;
  /* transition: background-color 0.3s ease; */
}

.slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 4px;
  top: 4px;
  background-color: white;
  border-radius: 50%;
  /* transition: transform 0.3s ease; */
  transition: 0.25s;
}

.switch input:checked + .slider {
  background-color: var(--btn-bg);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

/* ===================================================== */
/* ===================== MOBILE ======================== */
/* ===================================================== */

@media (max-width: 900px) {

  .plot-stat,
  .plot-stat.reverse {
    flex-direction: column;
    align-items: center;
  }

  .plot-graph {
    flex: none;
    width: 100%;
  }

  .plot-highlight {
    flex: none;
    width: 100%;
    padding-left: 0;

    align-items: flex-start; 
    text-align: left; 
    overflow: visible;
  }

  .highlight-number {
    /* font-size: clamp(3rem, 15vw, 6rem);
    white-space: nowrap; */

    font-size: clamp(2.5rem, 10vw, 5rem);
    white-space: normal;   
    overflow: visible; 
  }

  .highlight-unit {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    margin-top: 0.4rem;
  }

}

