/* Modern CSS per Pinolallo.com - 2025 - Responsive Update */
:root {
  --primary-color: #2563eb;
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --bg-light: #f9fafb;
  --white: #ffffff;
  --border-color: #e5e7eb;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--white);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
header {
  padding: 2rem 0 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
  position: relative; /* for hamburger positioning */
}

.logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  color: var(--primary-color);
}

h3 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.75rem;
  color: var(--text-dark);
}

/* Navigation */
#nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  background: var(--bg-light);
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

#nav > li {
  position: relative;
}

#nav a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text-dark);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 0.2s;
}

#nav a:hover {
  background: var(--white);
  color: var(--primary-color);
}

.dropdown ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  list-style: none;
  min-width: 200px;
  z-index: 100;
  padding: 0.5rem 0;
}

.dropdown:hover ul {
  display: block;
}

.dropdown ul li a {
  padding: 0.5rem 1rem;
}

/* Content */
.wrap {
  background: var(--bg-light);
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

.image img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 150px;
}

.content ul, .wrap ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.content li, .wrap li {
  margin-bottom: 0.5rem;
}

/* Footer */
.footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-light);
  font-size: 0.875rem;
}

.footer a {
  color: var(--primary-color);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* Hamburger Menu (Mobile) */
.nav-toggle {
  display: none;
}
.nav-toggle-label {
  display: none;
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 30px;
  height: 24px;
  cursor: pointer;
  z-index: 200;
}
.nav-toggle-label span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: var(--text-dark);
  border-radius: 3px;
  opacity: 1;
  left: 0;
  transition: .25s ease-in-out;
}
.nav-toggle-label span:nth-child(1) { top: 0; }
.nav-toggle-label span:nth-child(2) { top: 9px; }
.nav-toggle-label span:nth-child(3) { top: 18px; }

.nav-toggle:checked + .nav-toggle-label span:nth-child(1) {
  top: 9px;
  transform: rotate(135deg);
}
.nav-toggle:checked + .nav-toggle-label span:nth-child(2) {
  opacity: 0;
  left: -60px;
}
.nav-toggle:checked + .nav-toggle-label span:nth-child(3) {
  top: 9px;
  transform: rotate(-135deg);
}

/* Responsive */
@media (max-width: 768px) {
  body {
    font-size: 1.125rem; /* 18px */
    line-height: 1.7;
    padding: 0 0.75rem;
  }

  .logo {
    width: 60px;
    height: 60px;
    margin-bottom: 0.75rem;
  }

  h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  h2 {
    font-size: 1.35rem;
    margin: 1.5rem 0 0.75rem;
  }

  h3 {
    font-size: 1.15rem;
  }

  .nav-toggle-label {
    display: block;
  }

  /* Hide nav by default on mobile, show when checkbox checked */
  nav {
    display: none;
  }
  .nav-toggle:checked ~ nav,
  body.nav-open nav {
    display: block;
  }

  #nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow);
    z-index: 150;
    gap: 0.25rem;
    margin-bottom: 0;
  }

  #nav a {
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border-radius: var(--radius);
  }

  .wrap {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }

  .footer {
    font-size: 0.875rem;
    padding-top: 0.75rem;
  }

  .dropdown ul {
    display: none !important;
  }

  .content ul, .wrap ul {
    margin-left: 1rem;
  }
}

/* Utility */
.loghino { display: none; }

/* Active menu item */
#nav li.active > a {
  background: var(--primary-color);
  color: var(--white);
  border-radius: var(--radius);
}

/* Course page specific */
.course-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}
.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-light);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text-light);
}
.course-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.lesson-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.lesson-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}
.lesson-card h4 {
  margin: 0 0 0.75rem 0;
  color: var(--primary-color);
  font-size: 1.1rem;
  line-height: 1.3;
}
.lesson-card .module {
  font-size: 0.85rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}
.lesson-card p {
  flex-grow: 1;
  font-size: 0.9rem;
  color: var(--text-dark);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.lesson-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--primary-color);
  color: var(--white);
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: background 0.2s;
}
.btn:hover {
  background: #1d4ed8;
}
.btn-secondary {
  background: var(--text-light);
}
.btn-secondary:hover {
  background: #4b5563;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 1rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}
.back:hover {
  text-decoration: underline;
}

/* Responsive tweaks for course page */
@media (max-width: 768px) {
  .course-grid {
    grid-template-columns: 1fr;
  }
  .lesson-actions {
    flex-direction: column;
  }
  .btn {
    width: 100%;
    text-align: center;
  }
}
