/* Cakebread Science — Worksheets Index Page — Lok Style */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@700;900&family=Barlow:wght@400;600&display=swap');

:root {
    --maths:    #2255cc;
    --physics:  #d08000;
    --chemistry:#c8001e;
    --biology:  #005e22;
    --cross:    #555;
    --cream:    #eeeae0;
    --ink:      #111;
}

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

body {
    font-family: 'Barlow', 'Arial Narrow', Arial, sans-serif;
    background: var(--cream);
    min-height: 100vh;
    color: var(--ink);
}

/* ── Back link ── */
.back-link {
    display: inline-block;
    margin: 16px 24px;
    padding: 8px 16px 8px 14px;
    background: var(--ink);
    color: var(--cream);
    text-decoration: none;
    font-family: 'Barlow Condensed', Arial, sans-serif;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-left: 4px solid #005e22;
    transition: background 0.15s ease;
}

.back-link:hover { background: #005e22; }

/* ── Page header ── */
header {
    background: var(--ink);
    padding: 24px 40px 20px;
    position: relative;
}

header::before {
    content: '';
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 7px;
    background: linear-gradient(to right,
        #005e22 0%,   #005e22 45%,
        #111    45%,  #111    50%,
        #005e22 50%,  #005e22 80%,
        #111    80%,  #111    84%,
        #005e22 84%,  #005e22 100%
    );
}

header h1 {
    font-family: 'Barlow Condensed', Arial, sans-serif;
    font-size: 44px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -1px;
    color: var(--cream);
    line-height: 1;
}

.subtitle {
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-top: 6px;
}

/* ── Main container ── */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 48px;
}

/* ── Resources grid ── */
.resources {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin: 24px 0 32px;
}

/* ── Subject section cards ── */
.resource-section {
    background: white;
    overflow: hidden;
    box-shadow: 3px 3px 0 var(--ink);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.resource-section:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 #005e22;
}

.section-header {
    padding: 14px 20px;
    color: white;
    font-family: 'Barlow Condensed', Arial, sans-serif;
    font-size: 22px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-header.maths    { background: var(--maths); }
.section-header.physics  { background: var(--physics); }
.section-header.chemistry{ background: var(--chemistry); }
.section-header.biology  { background: var(--biology); }
.section-header.cross    { background: var(--ink); }

.section-actions { padding: 8px 20px 0; background: #f8f6f0; }

.resource-list { padding: 12px 20px 16px; background: #f8f6f0; }

/* ── Topic groups ── */
.topic-group {
    margin-bottom: 14px;
    padding: 10px 12px 8px 14px;
    border-left: 4px solid #ccc;
    background: white;
}

.topic-group.maths    { border-left-color: var(--maths); }
.topic-group.physics  { border-left-color: var(--physics); }
.topic-group.chemistry{ border-left-color: var(--chemistry); }
.topic-group.biology  { border-left-color: var(--biology); }

.topic-title {
    font-family: 'Barlow Condensed', Arial, sans-serif;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ink);
    margin-bottom: 6px;
}

/* ── Resource items ── */
.resource-item { margin: 2px 0; }

.resource-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    color: #005e22;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: color 0.15s ease;
    border-bottom: 1px solid #ece8e0;
}

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

.resource-item a:hover { color: var(--ink); }

.spec-text {
    font-size: 10px;
    color: #888;
    background: #eeeae0;
    padding: 2px 7px;
    flex-shrink: 0;
    margin-left: 8px;
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    header { padding: 20px 20px 16px; }
    header h1 { font-size: 34px; }
    .resources { grid-template-columns: 1fr; }
    .container { padding: 0 16px 40px; }
}
