/* SPDX-License-Identifier: AGPL-3.0-only
   School module styles. Reuses the host site's CSS custom properties
   (--text-primary, --card-bg, --border-color, --color-primary, --radius-lg,
   --shadow-*, --bg-light, --text-secondary), which are defined in the main
   base stylesheet loaded before this file. Falls back gracefully if absent.
   ────────────────────────────────────────────────────────── */

/* Back-to-hub pill (mirrors the camera_traps .ct-back-link). */
.school-back-link {
    position: absolute;
    top: 0.5rem;
    left: 1rem;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.65rem;
    font-size: 0.78rem;
    line-height: 1;
    color: var(--text-secondary, #556);
    background: var(--bg-light, #f4f5f7);
    border: 1px solid var(--border-color, #dcdfe4);
    border-radius: 999px;
    text-decoration: none;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.school-back-link:hover {
    color: var(--color-primary, #2b6cb0);
    border-color: var(--color-primary, #2b6cb0);
    text-decoration: none;
}

/* ── Module hub (start page) ─────────────────────────────── */
.module-hub { max-width: 1200px; margin: 0 auto; padding: 2rem 1rem; }
.hub-header { text-align: center; margin-bottom: 2.5rem; }
.hub-header h1 {
    font-size: 2rem; font-weight: 600;
    color: var(--text-primary, #1a202c); margin: 0 0 .5rem;
}
.hub-header p {
    color: var(--text-secondary, #556); max-width: 640px; margin: 0 auto;
    font-size: 1rem; line-height: 1.5;
}
.hub-section { margin-bottom: 2rem; }
.hub-section-title {
    font-size: 1rem; font-weight: 600;
    color: var(--text-secondary, #556);
    border-bottom: 1px solid var(--border-color, #dcdfe4);
    padding-bottom: .5rem; margin: 0 0 1rem;
}
.hub-grid {
    display: grid;
    gap: 1rem;
    /* Responsive column count: phones 2 → up to 5 on desktop.
       Explicit breakpoints keep it predictable regardless of the host
       container width (site .container is width:80%, no max-width). */
    grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 480px)  { .hub-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px)  { .hub-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) { .hub-grid { grid-template-columns: repeat(5, 1fr); } }
.hub-card {
    display: flex; flex-direction: column; align-items: flex-start;
    gap: .5rem; padding: 1.25rem;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #dcdfe4);
    border-radius: var(--radius-lg, 12px);
    text-decoration: none; color: var(--text-primary, #1a202c);
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.06));
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.hub-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,.12));
    border-color: var(--color-primary, #2b6cb0);
    color: var(--text-primary, #1a202c); text-decoration: none;
}
.hub-card__icon { font-size: 1.75rem; line-height: 1; }
.hub-card__title { font-size: 1.05rem; font-weight: 600; overflow-wrap: anywhere; }
.hub-card__desc {
    font-size: .85rem; color: var(--text-secondary, #556); line-height: 1.4;
}

/* ── Worksheet page (preview + download buttons) ─────────── */
.worksheet-page { max-width: 900px; margin: 0 auto; padding: 2rem 1rem; }
.worksheet-head { text-align: center; margin-bottom: 1.5rem; }
.worksheet-head h1 {
    font-size: 1.7rem; font-weight: 600;
    color: var(--text-primary, #1a202c); margin: 0 0 .4rem;
}
.worksheet-head__icon { margin-right: .3rem; }
.worksheet-head__desc { color: var(--text-secondary, #556); margin: 0; }

/* ── Settings form ─────────────────────────────────────── */
.worksheet-form {
    border: 1px solid var(--border-color, #dcdfe4);
    border-radius: var(--radius-lg, 12px);
    background: var(--card-bg, #fff);
    padding: 1.1rem 1.25rem; margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.06));
}
.worksheet-form__title {
    font-size: .8rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; color: var(--text-secondary, #556);
    margin: 0 0 .9rem;
}
.worksheet-form__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .75rem 1.25rem; align-items: end;
}
.field { display: flex; flex-direction: column; gap: .3rem; }
.field__label { font-size: .85rem; color: var(--text-secondary, #556); }
.field input[type="number"], .field select {
    padding: .45rem .55rem; font-size: 1rem;
    border: 1px solid var(--border-color, #dcdfe4);
    border-radius: 8px; background: var(--bg-light, #fff);
    color: var(--text-primary, #1a202c); width: 100%;
}
.field--check {
    flex-direction: row; align-items: center; gap: .5rem;
    font-size: .9rem; color: var(--text-primary, #1a202c);
    padding-bottom: .35rem;
}
.field--check input { width: 1.05rem; height: 1.05rem; flex: none; }
.worksheet-form__actions { margin-top: 1.1rem; }

.worksheet-actions {
    display: flex; justify-content: center; flex-wrap: wrap;
    gap: .75rem; margin-bottom: 1.75rem;
}
.btn--download {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .7rem 1.4rem; font-size: 1rem; font-weight: 600;
    border-radius: var(--radius-lg, 12px);
    background: var(--color-primary, #2b6cb0); color: #fff;
    border: 1px solid var(--color-primary, #2b6cb0);
    text-decoration: none;
    transition: filter .15s ease, transform .15s ease;
}
.btn--download:hover { filter: brightness(1.08); transform: translateY(-1px); text-decoration: none; }
.btn--download.btn--secondary {
    background: var(--card-bg, #fff);
    color: var(--color-primary, #2b6cb0);
}

.worksheet-preview {
    border: 1px solid var(--border-color, #dcdfe4);
    border-radius: var(--radius-lg, 12px);
    background: #fff; padding: .75rem;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.06));
}
.worksheet-preview img {
    display: block; width: 100%; height: auto;
    border: 1px solid var(--border-color, #eee);
}