:root {
  --color-primary: #4f46e5;
  --color-primary-dark: #4338ca;
  --color-secondary: #f97316;
  --color-bg: #ffffff;
  --color-surface: #f8fafc;
  --color-text: #1e293b;
  --color-muted: #64748b;
  --color-border: #e2e8f0;
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --max-width: 1100px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  margin: 0;
  padding: 0;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-primary);
}
.main-nav a {
  margin-left: 1.5rem;
  color: var(--color-text);
  font-weight: 500;
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--color-text);
  margin: 5px 0;
  border-radius: 2px;
}

.breadcrumbs {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.breadcrumbs li + li::before { content: "›"; margin: 0 0.5rem; color: var(--color-muted); }

.hero {
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  padding: 3rem 1rem;
  text-align: center;
}
.hero h1 { font-size: 2.4rem; margin: 0 0 1rem; }
.lead { font-size: 1.15rem; color: var(--color-muted); max-width: 640px; margin: 0 auto 1.5rem; }
.hero-cta { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); text-decoration: none; }
.btn-secondary { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-ghost { background: transparent; color: var(--color-primary); border: 1px solid var(--color-border); }
.btn-block { display: block; width: 100%; margin-bottom: 0.5rem; }
.btn-pinterest { background: #bd081c; color: #fff; }
.btn-facebook { background: #1877f2; color: #fff; }

.section { padding: 2.5rem 1rem; }
.section-title { text-align: center; margin-bottom: 1.5rem; font-size: 1.75rem; }

.card-grid, .subject-grid, .feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.category-card, .subject-card, .thumb-card, .feature {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.category-card:hover, .subject-card:hover, .thumb-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.06); }
.category-card h3, .subject-card h3 { margin: 0 0 0.25rem; font-size: 1.15rem; }
.category-card p, .subject-card p { margin: 0; color: var(--color-muted); font-size: 0.9rem; }
.card-image { height: 160px; display: flex; align-items: center; justify-content: center; margin-bottom: 0.75rem; }
.card-image img { max-height: 100%; max-width: 100%; object-fit: contain; }

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.thumb-card { padding: 0.5rem; }
.thumb-card img { width: 100%; height: auto; border-radius: 6px; background: #fff; }
.thumb-title { display: block; margin-top: 0.5rem; font-size: 0.9rem; font-weight: 500; color: var(--color-text); }

.page-article { padding: 1.5rem 0; }
.page-article h1 { font-size: 2rem; margin-bottom: 1rem; }
.page-layout { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; align-items: start; }
.page-image-wrap { background: var(--color-surface); border-radius: var(--radius); padding: 1rem; text-align: center; }
.page-image { max-width: 100%; height: auto; }
.page-actions { position: sticky; top: 80px; }
.page-actions .btn { margin-bottom: 0.6rem; }
.print-instructions { font-size: 0.9rem; color: var(--color-muted); margin: 1rem 0; padding: 1rem; background: #f1f5f9; border-radius: var(--radius); }
.share { margin-top: 1.5rem; }
.share h3 { font-size: 1.05rem; margin-bottom: 0.75rem; color: var(--color-muted); }
.share-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: transform 0.1s, background 0.1s;
}
.share-btn:hover { transform: scale(1.08); text-decoration: none; }
.share-btn.pinterest { color: #bd081c; border-color: #f9d2d7; }
.share-btn.pinterest:hover { background: #bd081c; color: #fff; }
.share-btn.facebook { color: #1877f2; border-color: #d2e4fc; }
.share-btn.facebook:hover { background: #1877f2; color: #fff; }
.share-btn.x { color: #000; border-color: #e2e8f0; }
.share-btn.x:hover { background: #000; color: #fff; }
.share-btn.whatsapp { color: #25d366; border-color: #d3f6e1; }
.share-btn.whatsapp:hover { background: #25d366; color: #fff; }
.share-btn.email { color: #4f46e5; border-color: #e0e7ff; }
.share-btn.email:hover { background: #4f46e5; color: #fff; }
.share-btn.copy.copied { background: #22c55e; color: #fff; border-color: #22c55e; }
.share-btn svg { width: 18px; height: 18px; }

.legal-page { max-width: 800px; margin: 2rem auto; }
.legal-page h1 { font-size: 2rem; }
.legal-body h2 { font-size: 1.25rem; margin-top: 1.5rem; }

.site-footer { background: var(--color-surface); border-top: 1px solid var(--color-border); padding: 1.5rem 1rem; text-align: center; color: var(--color-muted); font-size: 0.9rem; }
.site-footer a { margin: 0 0.3rem; }

@media (max-width: 768px) {
  .main-nav { display: none; }
  .nav-open .main-nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem;
  }
  .nav-open .main-nav a { margin: 0.5rem 0; }
  .menu-toggle { display: block; }
  .hero h1 { font-size: 1.75rem; }
  .page-layout { grid-template-columns: 1fr; }
  .page-actions { position: static; }
  .card-grid, .subject-grid, .feature-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
