/* ===========================
   🌐 ROOT VARIABLES — MEXICO
=========================== */
:root {
  --bg: linear-gradient(135deg,#f0f7ee,#e0f2e4); /* soft green gradient */
  --card: rgba(255,255,255,0.85);
  --text: #0d1117;
  --muted: #555;
  --accent: #006847; /* 🇲🇽 Mexico green */
  --radius: 16px;
  --shadow: 0 8px 24px rgba(0,0,0,0.08);
}

body.dark-mode {
  --bg: linear-gradient(135deg,#0d1117,#161b22);
  --card: rgba(22,27,34,0.92);
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #00a859; /* bright green */
  --shadow: 0 8px 30px rgba(0,0,0,0.4);
}

/* Base Layout */
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.4s, color 0.3s;
}

.hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
  max-width: 1280px;
  margin: 40px auto;
  padding: 0 20px;
}

/* Card Style */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

/* Main Clock */
.main-clock {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
}
.main-clock .time {
  font-size: 64px;
  font-weight: 700;
  color: var(--accent);
}
.main-clock .tz {
  font-size: 16px;
  color: var(--muted);
  margin-top: 6px;
}
.utc-small {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,104,71,0.1);
  border-radius: 10px;
  padding: 6px 12px;
  text-align: right;
}
.utc-small .clock-time {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
}
.utc-small .clock-tz {
  font-size: 12px;
  color: var(--muted);
}

/* Meta Info */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 18px;
}
.meta {
  background: rgba(0,0,0,0.05);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--muted);
}
body.dark-mode .meta {
  background: rgba(255,255,255,0.05);
}

/* Cities */
.cities {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(160px,1fr));
  gap: 12px;
  margin-top: 10px;
}
.city-card {
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  transition: all 0.2s ease;
}
.city-card:hover {
  transform: translateY(-3px);
}
.city-name {
  font-weight: 600;
}
.city-time {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

/* 📍 Sidebar (Mexico States Directory) */
.sidebar, .mexico-divisions {
  align-self: start;
  position: sticky;
  top: 90px;
  text-align: center;
}

.sidebar h3, .mexico-divisions h3 {
  margin-bottom: 10px;
}

.state-list, .mexico-divisions div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

/* Links */
.state-list a, .division-link {
  display: inline-block;
  padding: 8px 12px;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: 0.3s;
  text-align: center;
}
.state-list a:hover, .division-link:hover {
  background: #d52b1e; /* 🇲🇽 red hover */
  color: #fff;
  transform: translateY(-2px);
}
.active-division {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border: 1px solid var(--accent);
}

/* 🌙 Dark Mode */
body.dark-mode .division-link,
body.dark-mode .state-list a {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
}
body.dark-mode .division-link:hover,
body.dark-mode .state-list a:hover {
  background: #00a859;
  color: #fff;
}

/* Flags */
.flag-inline-title {
  height: 1em;
  width: auto;
  margin-right: 0.4em;
  vertical-align: middle;
  position: relative;
  top: -0.1em;
  border-radius: 0.2em;
  object-fit: cover;
  box-shadow: 0 0.05em 0.15em rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}
.flag-inline-title:hover {
  transform: scale(1.05);
}

/* Back Button */
.back-home-wrapper {
  text-align: center;
  margin: 40px 0;
}
.back-home-button {
  background: #d52b1e; /* 🇲🇽 red */
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: 0.2s;
}
.back-home-button:hover {
  background: #006847; /* 🇲🇽 green hover */
}

/* Responsive */
@media(max-width:768px){
  .hero {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
  .main-clock .time {
    font-size: 42px;
  }
  .main-clock .tz {
    font-size: 14px;
  }
  .utc-small {
    position: static;
    margin-top: 10px;
    text-align: center;
  }
  .utc-small .clock-time {
    font-size: 16px;
  }
  .utc-small .clock-tz {
    font-size: 11px;
  }
}
