/* ===============================
   Base & Reset
   =============================== */
:root {
  --bg: #fdfdfd;
  --surface: #fff;
  --surface-alt: #f5f7fa;
  --text: #1c2532;
  --muted: #5d6673;
  --accent: #3c7ce8;
  --accent-dark: #275bb5;
  --border: #d9dde3;
  --shadow: 0 3px 8px rgba(0,0,0,0.05);
  --radius: 8px;
  --transition: 0.2s ease;
  --max-width: 940px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.catalog, .worksheet {
  max-width: var(--max-width);
  margin: 2rem auto;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 2rem;
  border-radius: var(--radius);
}

/* ===============================
   Header & Nav
   =============================== */
.site-header {
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
}
.site-title a {
  font-size: 1.7rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--accent);
}
.language-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .75rem;
}
.language-link {
  display: inline-block;
  padding: .4rem .9rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-weight: 600;
  font-size: .95rem;
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
}
.language-link:hover {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--accent);
}
.language-link.active,
.language-link[aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ===============================
   Headings & Text
   =============================== */
h1, h2 {
  font-weight: 700;
  margin: 0 0 .75rem;
}
.page-title { font-size: 1.6rem; color: var(--accent-dark); }
.page-heading { font-size: 1.3rem; }
.category-title { font-size: 1.1rem; border-left: 3px solid var(--accent-dark); padding-left: .6rem; margin-top: 1.5rem; }
p { margin-bottom: 1rem; color: var(--muted); }

/* ===============================
   Catalog Grid
   =============================== */
.worksheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .9rem;  /* tighter grid */
}
.worksheet-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}
.worksheet-card:hover {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 6px 14px rgba(60,124,232,0.18);
  transform: translateY(-3px);
}
.thumbnail {
  width: 100%;
  height: 130px; /* smaller, more square */
  object-fit: cover;
  border-bottom: 1px solid var(--border);
  background: #eef1f5;
}
.worksheet-name {
  text-align: center;
  padding: .6rem;
  font-weight: 600;
  font-size: .9rem;
  color: var(--text);
}

/* ===============================
   Worksheet Page
   =============================== */
.back-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
}
.back-link:hover { text-decoration: underline; }
.pdf-embed {
  width: 100%;
  height: 70vh;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-alt);
  margin: 1.2rem 0;
}
.download-btn {
  display: inline-block;
  padding: .7rem 1.2rem;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}
.download-btn:hover { background: var(--accent-dark); }
.file-info { font-size: .9rem; color: var(--muted); margin-top: .4rem; }

/* ===============================
   Footer
   =============================== */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding-top: 1rem;
  text-align: center;
  font-size: .9rem;
  color: var(--muted);
}
.site-footer a {
  color: var(--accent);
  text-decoration: none;
}
.site-footer a:hover { text-decoration: underline; }

/* ===============================
   Helpers
   =============================== */
.visually-hidden {
  position: absolute; 
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  border: 0;
}

/* ===============================
   Responsive
   =============================== */
@media (max-width: 700px) {
  .catalog, .worksheet { padding: 1.5rem; margin: 1.5rem auto; }
  .thumbnail { height: 110px; }
  .page-title { font-size: 1.3rem; }
}

