

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

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  opacity: 0.70;
}

:root {
  --bg: #064e3b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --surface: #0f5f4f;
  --accent: #10b981;
  --header-bg: #042f1f;
  --nav-bg: #042f1f;
  --footer-bg: #042f1f;
  --card-bg: #0f5f4f;
  --success-bg: #15803d;
  --error-bg: #b91c1c;
}

html {
  scroll-behavior: smooth;
  font-size: 120%;
  background-color: var(--bg);
  color-scheme: light dark;
} 

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
} 

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 0.5rem;
} 

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
  color: var(--muted);
} 

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.site-header {
  background: var(--header-bg);
  color: #fff;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

:root:not(.dark-theme) .site-header {
  color: var(--text);
}

:root:not(.dark-theme) .site-header .site-title a,
:root:not(.dark-theme) .site-header .site-tagline {
  color: #ffffff;
}
:root:not(.dark-theme) .site-header .site-title a:hover {
  opacity: 0.95;
}

:root:not(.dark-theme) .nav-link {
  color: var(--text);
  border-bottom-color: transparent;
}
:root:not(.dark-theme) .nav-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
:root:not(.dark-theme) .nav-link.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  background: rgba(16, 185, 129, 0.04);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.brand {
  flex: 1;
}

.site-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  letter-spacing: -0.5px;
}

.site-title a {
  color: #fff;
  text-decoration: none;
}

.site-logo {
  height: 32px;
  width: auto;
  vertical-align: middle;
  margin-right: 0.5rem;
  display: inline-block;
  color: #ffffff; 
}

.site-title a:hover {
  opacity: 0.9;
}

.site-tagline {
  font-size: 0.95rem;
  opacity: 0.95;
  margin: 0;
  color: #d1fae5;
}

.site-nav {
  background-color: var(--nav-bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  position: sticky;
  top: 0;
  z-index: 1000;
} 

.nav-list {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  list-style: none;
  justify-content: flex-start;
  gap: 0;
  padding: 0;
}

.nav-link {
  display: block;
  padding: 1rem 1.25rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
} 

.nav-link:visited {
  color: var(--muted);
}

.nav-link:hover {
  color: #fff;
  border-bottom-color: #10b981;
  text-decoration: none;
}

.nav-link.active {
  color: #fff;
  border-bottom-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

.nav-link.active:visited {
  color: #fff;
}

.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.content-section {
  margin-bottom: 3rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 1rem;
}

.section-header h2 {
  margin: 0;
  font-size: 1.75rem;
  color: var(--text);
} 

.link-more {
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}

.link-more:hover {
  color: var(--text);
  text-decoration: underline;
}

.hero {
  margin-bottom: 3rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #000;
  aspect-ratio: 12 / 5;
}

.carousel-inner {
  position: relative;
  width: 100%;
  overflow: hidden;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

.carousel-slide.active {
  opacity: 1;
  position: relative;
}

.carousel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-gallery {
  aspect-ratio: 4 / 3;
  min-height: 720px;
  background: #000;
}

.gallery-carousel-block {
  margin-bottom: 2.5rem;
}

.gallery-carousel-block h3 {
  margin-bottom: 0.9rem;
}

.carousel-gallery .carousel-img {
  object-fit: contain;
}

.carousel-portrait {
  aspect-ratio: 3 / 4;
  max-width: 620px;
  min-height: 0;
  height: min(78vh, 760px);
  margin-left: auto;
  margin-right: auto;
  background: transparent;
}

.carousel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
  pointer-events: none;
}

.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3rem 2rem;
  max-width: 600px;
  color: #fff;
}

.carousel-caption h2 {
  color: #fff;
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.carousel-caption p {
  color: #e0e7ff;
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  padding: 1rem 1.25rem;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  z-index: 100;
}

.carousel-control:hover {
  background: rgba(0, 0, 0, 0.7);
}

.carousel-control-prev {
  left: 1.5rem;
}

.carousel-control-next {
  right: 1.5rem;
}

.carousel-indicators {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.75rem;
  z-index: 100;
}

.carousel-indicators button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.carousel-indicators button.active {
  background: #fff;
  border-color: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Hero Banner Centrato */
.hero-center {
  width: 100%;
  aspect-ratio: 12 / 5;
  background: #000;
  margin-bottom: 3rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.hero-link {
  display: flex;
  position: relative;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.hero-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-link .carousel-caption {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  max-width: 80%;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

.hero-link .carousel-caption h2 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  margin: 0;
}

.hero-link:hover img {
  filter: brightness(0.85);
  transition: filter 0.3s ease;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

/* Link-tree specific styling */
.link-tree {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.link-tree .news-card {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 120px;
  padding: 0;
  transition: transform 0.24s ease, box-shadow 0.24s ease, background 0.24s ease;
}

.link-tree .news-card .news-card-body {
  padding: 1.25rem 1rem;
}

.link-tree .news-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.12);
}

.link-tree .news-card-title {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.link-tree .news-card-excerpt {
  font-size: 0.9rem;
  color: var(--muted);
}

.link-tree .news-card-link:hover .news-card-title {
  color: var(--accent);
}

.news-grid-category {
  grid-column: 1 / -1;
  margin: 0.5rem 0 -0.75rem;
  font-size: 1.5rem;
  color: var(--text);
}

.news-card {
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
} 

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.news-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.news-card-link:hover {
  opacity: 1;
}

.news-card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.news-card-body {
  padding: 1.5rem;
}

.news-card-title {
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.4;
} 

.news-card-link:hover .news-card-title {
  color: var(--accent);
  opacity: 1;
}

.news-card-excerpt {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.5;
} 

.news-card-date {
  display: block;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 500;
}

.video-embed {
  width: auto;
  max-width: 100%;
  height: auto;
  border: 0;
  border-radius: 0;
  display: block;
}

.video-frame-container {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  padding: 0;
  margin: 0;
  line-height: 0;
  background: transparent;
}

.video-embed-large {
  width: 100%;
  height: auto;
  border-radius: 0;
}

.video-block-vertical .video-frame-container-vertical {
  width: min(420px, 100%);
}

.video-embed-vertical {
  aspect-ratio: 9 / 16;
  object-fit: cover;
}

.video-block {
  text-align: center;
}

.news-article,
.content-article {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 2rem;
  max-width: 1100px;
  margin: 0 auto 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
} 

/* Responsive tweaks: keep mobile formatting while improving large-screen distribution */
@media (max-width: 1100px) {
  .header-container,
  .nav-list,
  .main-content {
    max-width: 100%;
    padding: 0 1rem;
  }

  .news-article,
  .content-article {
    max-width: 900px;
    padding: 1.5rem;
  }

  .link-tree {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (min-width: 1400px) {
  .link-tree {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
  }

  .news-grid {
    gap: 2.25rem;
  }
}

.news-article h1,
.content-article h1 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  color: var(--text);
} 

.news-article h2,
.content-article h2 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(226,232,240,0.6);
} 

.news-article h3,
.content-article h3 {
  font-size: 1.15rem;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--muted);
} 

.news-article img,
.content-article img {
  width: 100%;
  border-radius: 8px;
  margin: 1.5rem 0;
  display: block;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.article-meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
} 

.news-article p,
.content-article p {
  margin-bottom: 1rem;
  line-height: 1.7;
  color: var(--text);
} 

.news-article ul,
.content-article ul,
.news-article ol,
.content-article ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.news-article li,
.content-article li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
  color: var(--text);
} 

.news-article a,
.content-article a {
  color: var(--accent);
  text-decoration: underline;
  font-weight: 500;
} 

.news-article a:hover,
.content-article a:hover {
  color: #059669;
  opacity: 1;
}

.news-article a.link-more,
.content-article a.link-more {
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 1rem;
}

.news-article a.link-more:hover,
.content-article a.link-more:hover {
  color: var(--text);
  text-decoration: underline;
}

.event-details,
.gallery-section,
.contact-section,
.schedule-section {
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  padding: 1.5rem;
  border-left: 4px solid var(--accent);
  margin: 1.5rem 0;
  border-radius: 4px;
} 

.contact-section {
  border-left-color: auto;
}

.schedule-section {
  border-left-color: var(--accent);
}

.schedule-section table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.schedule-section tbody tr {
  border-bottom: 1px solid #e2e8f0;
}

.schedule-section td {
  padding: 0.75rem;
  text-align: left;
  color: var(--text);
}

.schedule-section td:first-child {
  font-weight: 600;
  color: var(--text);
  width: 150px;
} 

.sidebar {
  background: transparent;
  margin-top: 2rem;
}

.widget {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border-left: 4px solid var(--accent);
} 

.widget-title {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 1rem;
  font-weight: 700;
} 

.events-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.event-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(226,232,240,0.6);
  font-size: 0.95rem;
  color: var(--muted);
} 

.event-item:last-child {
  border-bottom: none;
}

.widget-more {
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}

.widget-text {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0;
} 

.locandina-trigger {
  margin-top: 0.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.locandina-thumb {
  max-width: 70%;
  max-height: 280px;
  height: auto;
}

.flyer-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.flyer-popup[hidden] {
  display: none;
}

.flyer-popup-content {
  position: relative;
  max-width: min(92vw, 980px);
  max-height: 92vh;
}

.flyer-popup-img {
  max-width: 100%;
  max-height: 92vh;
  border-radius: 8px;
}

.flyer-popup-close {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid #000000;
  border-radius: 999px;
  background: #ffffff;
  color: #000000 !important;
  -webkit-text-fill-color: #000000;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: Arial, sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-shadow: none;
}

body.no-scroll {
  overflow: hidden;
}

.gallery-preview {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.gallery-preview img {
  width: 100px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.gallery-preview img:hover {
  transform: scale(1.05);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
} 

.tool-form {
  display: grid;
  gap: 0.85rem;
  max-width: 560px;
}

.tool-field label {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.tool-field input,
.tool-field select,
.tool-field textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  background: #0e6d53;
  color: #ffffff;
  border: 1px solid #0a8b66;
  font-size: 0.95rem;
}

.quiz-legend {
  width: 100%;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.85rem;
  padding: 0;
  line-height: 1.4;
}

#sciencePillQuiz fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-inline-size: 0;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.7rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.quiz-option:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--surface) 78%, var(--accent) 10%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.quiz-option:focus-within {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--surface) 80%, var(--accent) 8%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
}

.quiz-option input {
  width: auto;
  flex: 0 0 auto;
  margin-top: 0.25rem;
  accent-color: var(--accent);
}

.quiz-option span {
  flex: 1;
}

.quiz-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.quiz-actions .btn {
  min-width: 150px;
}

.tool-output {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-left: 4px solid var(--accent);
}

.tool-sequence {
  margin-top: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9rem;
}

.tool-image {
  margin-top: 0.75rem;
  max-width: 280px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.btn-primary {
  background: #10b981;
  color: #fff;
}

.btn-primary:hover {
  background: #059669;
  text-decoration: none;
}

.btn-secondary {
  background: #047857;
  color: #fff;
}

.btn-secondary:hover {
  background: #065f46;
}

.btn-tertiary {
  background: var(--surface);
  color: var(--text);
}

.btn-tertiary:hover {
  background: color-mix(in srgb, var(--surface) 88%, black 6%);
} 

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.lang-select {
  min-width: 9.5rem;
  height: 2.3rem;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
}

.lang-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-footer {
  background: var(--footer-bg);
  color: #fff;
  padding: 3rem 1.5rem 1.5rem;
  margin-top: 4rem;
  border-top: 1px solid rgba(0,0,0,0.15);
} 

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: #fff;
  margin-bottom: 1rem;
} 

.footer-title {
  font-size: 1.05rem;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: #fff;
  text-decoration: none;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: underline;
} 

.footer-section p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #fff;
} 

.footer-section a {
  color: #fff;
  text-decoration: none;
}

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

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0,0,0,0.15);
  font-size: 0.9rem;
  color: #fff;
} 

.footer-bottom p {
  color: #fff;
}

.feedback-region {
  position: fixed;
  bottom: 2rem;
  right: 1.5rem;
  max-width: 400px;
  background: var(--footer-bg);
  color: var(--surface);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
} 

.feedback-region.visible {
  opacity: 1;
  pointer-events: auto;
}

.feedback-region.success {
  background: #15803d;
}

.feedback-region.error {
  background: #b91c1c;
}

.mobile-nav-toggle {
  display: none;
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid #fff;
  color: #fff;
  padding: 0.6rem 0.95rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  gap: 0.5rem;
}

.mobile-nav-toggle:hover {
  background: rgba(0, 0, 0, 0.5);
}

.mobile-nav-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

body.nav-open::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1400;
  pointer-events: auto;
}

.site-nav {
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.site-nav.open {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1024px) {
  .mobile-nav-toggle { display: inline-flex; }

  .lang-select {
    min-width: 8.5rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  
  .site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    padding-top: 5.25rem;
    transform: translateY(-100%);
    background: linear-gradient(180deg, rgba(4,47,31,0.98), rgba(4,47,31,0.95));
    z-index: 1500;
    overflow-y: auto;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
  }

  .nav-link {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 1rem;
  }

  .site-header .header-container {
    align-items: center;
  }
}

@media (max-width: 1024px) {
  .header-container {
    flex-direction: column;
    gap: 1rem;
  }

  .carousel {
    aspect-ratio: 16 / 9;
    min-height: 420px;
  }

  .carousel-gallery {
    min-height: 620px;
  }

  .hero-center {
    aspect-ratio: 16 / 9;
  }

  .hero-link .carousel-caption h2 {
    font-size: 2rem;
  }

  .carousel-portrait {
    max-width: 540px;
    height: min(72vh, 680px);
  }

  .main-content {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 768px) {
  .site-title {
    font-size: 1.5rem;
  }

  .site-tagline {
    font-size: 0.85rem;
  }

  .carousel {
    aspect-ratio: 4 / 5;
    min-height: 460px;
  }

  .carousel-gallery {
    aspect-ratio: 4 / 5;
    min-height: 520px;
  }

  .carousel-portrait {
    aspect-ratio: 3 / 4;
    max-width: 420px;
    min-height: 0;
    height: min(66vh, 560px);
  }

  .carousel-caption {
    padding: 1.5rem 1rem 3.25rem;
    max-width: 100%;
  }

  .carousel-caption h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
  }

  .carousel-caption p {
    font-size: 0.9rem;
    line-height: 1.45;
    margin-bottom: 1rem;
  }

  .hero-center {
    aspect-ratio: 4 / 5;
    margin-bottom: 2rem;
  }

  .hero-link .carousel-caption {
    top: 66%;
    bottom: auto;
    transform: translate(-50%, -50%);
    max-width: 90%;
    padding: 1.5rem 1rem;
  }

  .hero-link .carousel-caption h2 {
    font-size: 1.5rem;
    letter-spacing: 1px;
  }

  .carousel-control {
    width: 44px;
    height: 44px;
    padding: 0.5rem;
    top: 34%;
  }

  .carousel-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.45) 40%, rgba(0, 0, 0, 0.12) 70%, transparent 100%);
  }

  .carousel-indicators {
    bottom: 0.9rem;
  }

  .nav-list {
    flex-wrap: wrap;
  }

  .nav-link {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .news-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .news-article,
  .content-article {
    padding: 1.5rem 1rem;
  }

  .news-article h1,
  .content-article h1 {
    font-size: 1.75rem;
  }

  .news-article h2,
  .content-article h2 {
    font-size: 1.25rem;
  }

  .schedule-section td:first-child {
    width: 110px;
    font-size: 0.9rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .feedback-region {
    right: 1rem;
    max-width: calc(100% - 2rem);
  }
}

@media (max-width: 480px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }

  .site-header {
    padding: 1rem;
  }

  .carousel {
    aspect-ratio: 9 / 14;
    min-height: 500px;
  }

  .carousel-gallery {
    aspect-ratio: 3 / 5;
    min-height: 540px;
  }

  .carousel-portrait {
    aspect-ratio: 3 / 4;
    max-width: 320px;
    min-height: 0;
    height: min(60vh, 460px);
  }

  .carousel-caption {
    padding: 1rem 0.875rem 2.9rem;
  }

  .carousel-caption h2 {
    font-size: 1.1rem;
  }

  .carousel-caption p {
    font-size: 0.84rem;
    margin-bottom: 0.85rem;
  }

  .carousel-control {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
    top: 33%;
  }

  .carousel-control-prev {
    left: 0.5rem;
  }

  .carousel-control-next {
    right: 0.5rem;
  }

  .main-content {
    padding: 1rem;
  }

  .news-grid {
    gap: 1rem;
  }

  .widget {
    padding: 1rem;
  }

  .btn {
    width: 100%;
  }
}

@media print {
  .site-nav,
  .hero,
  .feedback-region {
    display: none;
  }

  body {
    background: #fff;
  }

  .main-content {
    max-width: 100%;
  }
}

:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-color-scheme: dark) {
  
  body { background-color: var(--bg); color: var(--text); }
  .news-card, .widget { background: var(--card-bg); }
  .site-header, .site-nav { background-color: var(--header-bg); }
}

/* Admin panel */
.admin-wrap {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.admin-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  margin-bottom: 2rem;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-header h2 {
  margin: 0;
}

#login-section {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 60vh;
  padding-top: 4rem;
}

#login-section .admin-card {
  max-width: 420px;
  width: 100%;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
  font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(4, 47, 31, 0.6);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(4, 47, 31, 0.8);
}

.form-group textarea {
  min-height: 160px;
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.alert {
  padding: 0.9rem 1.2rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.alert-success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.pill-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.pill-table th,
.pill-table td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pill-table th {
  font-weight: 700;
  color: rgba(226, 232, 240, 0.8);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pill-table tr:first-child td {
  color: var(--accent);
  font-weight: 600;
}

.pill-table .pill-actions {
  display: flex;
  gap: 0.5rem;
}

.badge-active {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.5rem;
}

.quiz-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.quiz-section h4 {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: rgba(226, 232, 240, 0.8);
}

[data-view] {
  display: none;
}

[data-view].active {
  display: block;
}

@media screen {
  body,
  body * {
    color: #fff !important;
  }
}

