@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@700&display=swap');

/* ==================================================
   THE OPEN SHELF
   Design System
   Version 2.0
================================================== */

/* ==================================================
   1. DESIGN TOKENS
================================================== */

:root {

    /* ==========================================
       Colors
    ========================================== */

    --bg: #f4f7fb;

    --panel: #ffffff;

    --accent: #2563eb;
    --accent-dark: #1d4ed8;

    --text: #132238;
    --muted: #5f6f82;

    --border: #dce4ee;


    /* ==========================================
       Spacing
    ========================================== */

    --space-xs: .5rem;
    --space-sm: .75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;


    /* ==========================================
       Border Radius
    ========================================== */

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 22px;
    --radius-pill: 999px;


    /* ==========================================
       Shadows
    ========================================== */

    --shadow-sm: 0 2px 8px rgba(19,34,56,.04);

    --shadow-md: 0 8px 24px rgba(19,34,56,.08);

    --shadow-lg: 0 10px 28px rgba(19,34,56,.08);

    --shadow-button:
        0 8px 20px rgba(37,99,235,.20);


    /* ==========================================
       Typography
    ========================================== */

    --font-main:
        "Poppins",
        "Trebuchet MS",
        "Segoe UI",
        sans-serif;

}
/* ==================================================
   2. RESET
================================================== */

* {
  box-sizing: border-box;
}

/* ==================================================
   3. TYPOGRAPHY
================================================== */

body {
    font-family: "Poppins", "Trebuchet MS", "Segoe UI", sans-serif;
    font-weight: 700;
    color: var(--text);
}

h1,
h2,
h3 {
  font-family: "Poppins", "Trebuchet MS", sans-serif;
  font-weight: 700;
}

/* ==================================================
   4. APPLICATION LAYOUT
================================================== */

.app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px 48px;
}

.workspace {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.hero {
    margin-bottom: 2rem;
    text-align: center;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  text-align: center;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 700px;
  line-height: 1.5;
}

.panel {

    border: 1px solid var(--border);

}
/* ==================================================
   5. SIDEBAR
================================================== */
.sidebar {    
    display: flex;
    flex-direction: column;

    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);

    box-shadow: var(--shadow-lg);

    position: sticky;
    top: 2rem;
}
/* ==================================================
   6. WORKFLOW CARDS
================================================== */

.workflow-step {
    display: flex;
    flex-direction: column;

    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    margin-bottom: var(--space-lg);

    overflow: hidden;

    box-shadow: var(--shadow-sm);

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.workflow-header {
    background: #f7f9fc;

    padding: 1rem 1.25rem;

    border-bottom: 1px solid var(--border);
}

.workflow-header h2 {
    margin: 0;

    font-size: 1.1rem;
    color: var(--text);
}

.workflow-header p {
    margin: .35rem 0 0;

    color: var(--muted);

    font-size: .92rem;

    line-height: 1.5;

    font-weight: 400;
}

/* ------------------------------------------
   Internal Spacing
------------------------------------------ */

.workflow-step label:first-of-type {
    margin-top: 1.25rem;
}
.workflow-step textarea:last-child,
.workflow-step .button-row:last-child {
    margin-bottom: 1.25rem;
}

/* ==================================================
   7. FORMS
================================================== */

/* ------------------------------------------
   Form Groups
------------------------------------------ */

.form-group {
    padding: 1rem 1.25rem 1.25rem;
}

.form-group textarea {
    margin-top: .75rem;
}

/* ------------------------------------------
   Labels
------------------------------------------ */

label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

/* ------------------------------------------
   Helper Text
------------------------------------------ */

.helper-text {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--muted);
}
/* ------------------------------------------
   Inputs
------------------------------------------ */
input,
textarea,
select {
    width: 100%;
    padding: 12px;

    border: 1px solid var(--border);
    border-radius: 12px;

    font-size: 1rem;
    font-family: inherit;

    background: white;

    resize: none;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;

    border-color: var(--accent);

    box-shadow:
        0 0 0 4px rgba(37,99,235,.12);
}

/* ==================================================
   8. BUTTONS
================================================== */
.primary-btn {
    width: calc(100% - 2.5rem);

    margin: 1.25rem 1.25rem 1rem;

    padding: 1rem 1.25rem;

    border: none;
    border-radius: 12px;

    background: var(--accent);
    color: white;

    font-size: 1rem;
    font-weight: 700;

    cursor: pointer;

    transition:
        background .2s ease,
        transform .18s ease,
        box-shadow .18s ease;

    box-shadow:
        0 8px 20px rgba(37, 99, 235, .20);
}

.primary-btn:hover {

    background: var(--accent-dark);

    transform: translateY(-2px);

    box-shadow:
        0 12px 28px rgba(37, 99, 235, .28);
}

.primary-btn:active {

    transform: translateY(0);
}

.secondary-actions {

    display: flex;

    gap: .75rem;

    margin:
        0 1.25rem
        1.25rem;
}

.secondary-actions button {

    flex: 1;
}

button {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent);
  color: white;
}

button:hover {
  background: var(--accent-dark);
}

button.secondary {

    background: #f3f6fb;

    color: var(--text);

    border: 1px solid var(--border);

    box-shadow: none;
}

button.secondary:hover {
  background: #cbd5e1;
}

/* ==================================================
   9. LIVE PREVIEW
================================================== */

.canvas {
    display: flex;
    flex-direction: column;

    gap: var(--space-xl);

    min-width: 0;

    background: linear-gradient(
        to bottom,
        #f8fafc,
        #eef3f8
    );

    border-radius: var(--radius-xl);

    padding:
      var(--space-2xl)
      calc(var(--space-2xl) * 1.5);
}

/* ------------------------------------------
   Document Stack
------------------------------------------ */

.document-stack {

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: var(--space-2xl);

    width: 100%;

}
.paper {

    width: min(100%, 8.5in);

    background: white;

    border-radius: var(--radius-lg);

    box-shadow:
        0 18px 40px rgba(34, 51, 74, .10);

}

.canvas-header {
    display: block !important;
    text-align: center !important;
    margin-bottom: 2rem !important;
}

.canvas-header h2 {
    display: block !important;
    margin: 0 0 .5rem 0 !important;
}

.canvas-header p {
    display: block !important;
    margin: 0 !important;
    font-weight: 400 !important;
}

/* ------------------------------------------
   Paper
------------------------------------------ */

.paper {

    background: white;

    border-radius: var(--radius-xl);

    padding: var(--space-2xl);

    box-shadow:
        0 4px 8px rgba(19,34,56,.06),
        0 20px 48px rgba(19,34,56,.12);

    overflow: hidden;

    transition:
        box-shadow .2s ease,
        transform .2s ease;

    min-height: 11in;

    box-sizing: border-box;

    margin-top: var(--space-lg);
    margin-bottom: var(--space-lg);

}

/* ==================================================
   10. PRINTABLE WORKSHEET
================================================== */

/* ------------------------------------------
   Worksheet Header (Screen)
------------------------------------------ */

.worksheet-header {

    display: grid;

    grid-template-columns: 240px 1fr 240px;

    align-items: start;

    gap: 1rem;

    margin-bottom: 2rem;

}

.title-block {

    grid-column: 2;

    justify-self: center;

    text-align: center;

    transform: translateX(20px);

}

.student-name-block {

    display: flex;

    flex-direction: row;

    align-items: center;

    gap: .5rem;

}

.blank-line {

    width: 200px;

    border-bottom: 1px solid var(--text);

    min-height: 1.25rem;

}

.blank-line {

    width: 200px;

    border-bottom: 1px solid var(--text);

    min-height: 24px;

}

.worksheet-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: start;
  gap: 12px;
  margin-bottom: 48px;
  padding-top: 24px;
}

.worksheet-header h2 {
  margin: 0;
  grid-column: 2;
  justify-self: center;
  text-align: center;
  padding-top: 8px;
  font-size: 18pt;
}

.title-block {
    grid-column: 2;
    justify-self: center;
    text-align: center;

    margin-left: 24px;
}

.directions-text {
  margin: 8px 0 0;
  font-size: 11pt;
  color: var(--muted);
}

.worksheet-header .blank-line-label {
  font-size: 11pt;
}

.puzzle-grid td {
  font-size: 1.15rem;
}

.blank-line {
  width: 100%;
  border-bottom: 1px solid var(--text);
  min-height: 24px;
}

.blank-line-label {
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
  text-transform: capitalize;
  letter-spacing: 0.03em;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--muted);
}

.puzzle-container {
  overflow-x: auto;
}

.puzzle-grid {
  border-collapse: collapse;
  margin: 0 auto;
}

.puzzle-grid td {
  width: 48px;
  height: 48px;
  border: none;
  text-align: center;
  font-weight: 700;
  font-size: 1.15rem;
  background: #fcfdff;
}

.puzzle-grid {
  border: 2px solid var(--text);
}

.word-bank-section {
  margin-top: 20px;
}

.answer-key-section {
  margin-top: 24px;
  page-break-before: always;
}

.answer-key-section h3 {
  margin-top: 0;
  margin-bottom: 24px;
  text-align: center;
}

.answer-key-grid {
  border-collapse: collapse;
  margin: 0 auto;
}

.answer-key-grid td {
  width: 48px;
  height: 48px;
  border: none;
  text-align: center;
  font-weight: 700;
  font-size: 1.15rem;
  background: #fcfdff;
}

.answer-key-grid {
  border: 2px solid var(--text);
}

.answer-key-grid td.highlighted {
  background-color: #facc15 !important;
  background: #facc15 !important;
  color: #92400e;
  font-weight: 900;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.word-bank li {
  padding: 8px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--accent-dark);
  font-weight: 700;
}

.word-bank li.hidden {
  color: transparent;
  background: transparent;
}

/* ==================================================
   11. RESPONSIVE
================================================== */

@media (max-width: 900px) {

    .workspace {
    display: grid;
    grid-template-columns:
    240px
    1fr
    240px;
    gap: 2rem;
    align-items: start;
}

    .canvas.panel.results {
        max-width: 100%;
    }

}

/* ==================================================
   MOBILE
================================================== */

@media (max-width: 700px) {

    /* ------------------------------------------
       Main App
    ------------------------------------------ */

    .app {
        width: 100%;
        padding: 24px 16px 40px;
    }


    /* ------------------------------------------
       Hero
    ------------------------------------------ */

    .hero {
        margin-bottom: 1.5rem;
    }

    .hero h1 {
        font-size: 1.7rem;
    }

    .hero p {
        font-size: .95rem;
    }


    /* ------------------------------------------
       Workspace
    ------------------------------------------ */

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


    /* ------------------------------------------
       Sidebar
    ------------------------------------------ */

    .sidebar {
        position: static;
        width: 100%;
        padding: 1rem;
    }


    /* ------------------------------------------
       Live Preview
    ------------------------------------------ */

    .canvas {
        width: 100%;
        padding: 1.25rem;
        border-radius: 18px;
    }


    /* ------------------------------------------
       Printable Worksheet
    ------------------------------------------ */

    .paper {
        width: 100%;
        padding: 1.25rem;
        min-height: auto;
        border-radius: 16px;
    }


    /* ------------------------------------------
       Worksheet Header
    ------------------------------------------ */

    .worksheet-header {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1.5rem;
        padding-top: 0;
    }

    .title-block {
        order: -1;
        width: 100%;
        transform: none;
        margin-left: 0;
    }

    .worksheet-header h2 {
        font-size: 1.4rem;
        padding-top: 0;
    }

    .student-name-block {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .blank-line {
        width: 100%;
        max-width: 240px;
    }


    /* ------------------------------------------
       Puzzle
    ------------------------------------------ */

    .puzzle-container {
        width: 100%;
        overflow-x: auto;
        display: flex;
        justify-content: center;
    }

    .puzzle-grid {
        max-width: 100%;
    }

    .puzzle-grid td {
        width: auto;
        height: auto;
        aspect-ratio: 1 / 1;
        font-size: .9rem;
    }


    /* ------------------------------------------
       Word Bank
    ------------------------------------------ */

    .word-bank {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .5rem;
    }

    .word-bank li {
        text-align: center;
    }

}

/* ==================================================
   12. PRINT
================================================== */

@media print {
/* ------------------------------------------
   Page Setup
------------------------------------------ */
  @page {
    size: Letter;
    margin: 0.5in;
  }

  html,
  body,
  .page,
  .puzzle-grid td,
  .answer-key-grid td,
  .word-bank li,
  .directions-text,
  .blank-line-label {
    font-family: "Poppins", "Trebuchet MS", "Segoe UI", sans-serif !important;
    font-weight: 700 !important;
    background: white;
    border: none !important;
    box-shadow: none !important;
  }
  .page {
    width: 7.5in;
    max-width: 7.5in;
    padding: 0;
    margin: 0 auto;
  }

/* ------------------------------------------
   Hide Screen Elements
------------------------------------------ */
 .hero,
  .controls,
 .site-header,
.canvas-header,
.site-footer {

    display: none !important;

}

/* ------------------------------------------
   Typography
------------------------------------------ */


/* ------------------------------------------
   Show Printable Content
------------------------------------------ */
.canvas,
.document-stack,
.paper,
.print-page,
.answer-key-section,
.word-bank-section {

    display: block !important;

    visibility: visible !important;

}

.word-list {
    display: grid !important;
    visibility: visible !important;
}

/* ------------------------------------------
   Printable Area
------------------------------------------ */

  .panel.results.print-page {
    border: none;
    box-shadow: none;
    padding: 0.04in 0 0.06in;
    margin: 0;
  }


/* ------------------------------------------
   Worksheet Header
------------------------------------------ */
  .worksheet-header {
    padding-top: 0.17in;
    margin-bottom: 0.08in;
    gap: 0.06in;
    align-items: end;
  }

  .worksheet-header h2 {
    padding-top: 0;
    margin: 0 0 0.03in;
    font-size: 16pt;
  }

  .student-name-block {
    min-width: 1.4in;
    gap: 0.03in;
  }

  .blank-line {
    min-height: 0.22in;
  }

  .title-block {
    align-self: end;
  }


/* ------------------------------------------
   Puzzle
------------------------------------------ */
  .puzzle-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0.5in 0 0.08in;
  }

  .puzzle-grid {
    width: 100%;
    max-width: 7.2in;
    table-layout: fixed;
    page-break-inside: avoid;
    margin: 0 auto;
  }

  .puzzle-grid td {
    width: auto;
    height: auto;
    padding: 0;
    aspect-ratio: 1 / 1;
    font-size: clamp(0.95rem, 1.05vw, 1.15rem);
  }


/* ------------------------------------------
   Word Bank
------------------------------------------ */
  .word-bank-section {
    margin-top: 0.04in;
    page-break-inside: avoid;
  }

  .word-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(1.2in, 1fr));
    gap: 0.06in 0.1in;
  }

  .word-list li {
    margin: 0;
    text-align: center;
    padding: 0.06in 0.08in;
  }


/* ------------------------------------------
   Answer Key
------------------------------------------ */
.answer-key-section {
    border: none !important;
    box-shadow: none !important;
    padding: 0.12in 0 0;
  }


/* ------------------------------------------
   Page Breaks
------------------------------------------ */

/* ------------------------------------------
   Document Stack
------------------------------------------ */

.document-stack {

    display: block;

}

.paper {

    width: 100%;

    background: white;

    box-shadow: none;

    border-radius: 0;

    margin: 0;

}

/* ==================================================
   Print Mode
================================================== */
body.print-mode .hero,
body.print-mode .sidebar,
body.print-mode .canvas-header {
    display: none !important;
}

body.print-mode .workspace {
    display: block;
}

body.print-mode .canvas {
    background: white;
    box-shadow: none;
    padding: 0;
}

body.print-mode .document-stack {
    width: 100%;
    margin: 0;
}

body.print-mode .paper {
    box-shadow: none;
    border: none;
    margin: 0 auto;
}

}

/* ==========================================================
   OPEN SHELF SITE HEADER
========================================================== */

.site-header {

    width: min(1200px, 92%);

    margin: 0 auto;

    padding: 2rem 0 1rem;

    display: flex;

    justify-content: space-between;

    align-items: center;

}

.logo {

    display: flex;

    align-items: center;

    gap: 1rem;

    text-decoration: none;

}

.logo img {

    width: 90px;

    height: auto;

    display: block;

}

.logo span {

    font-family: "Poppins", sans-serif;

    font-size: 1.6rem;

    font-weight: 700;

    color: #22334A;

}

.site-header nav {

    display: flex;

    gap: 2.5rem;

}

.site-header nav a {

    font-family: "Inter", sans-serif;

    font-weight: 600;

    color: #394A5A;

    text-decoration: none;

    transition: color .25s ease;

}

.site-header nav a:hover {

    color: #92A98A;

}

/* ==========================================================
   SITE FOOTER
========================================================== */

.site-footer {

    width: 100%;

    margin-top: 6rem;

    padding: 4rem 2rem 2rem;

    background: #F4F0E8;

    border-top: 1px solid #E8E3D9;

    text-align: center;

}


.site-footer-content {

    width: min(900px, 100%);

    margin: 0 auto;

    display: flex;

    flex-direction: column;

    align-items: center;

}


/* ==========================================================
   Footer Logo
========================================================== */

.site-footer-logo {

    width: 55px;

    height: auto;

    display: block;

    margin: 0 auto .75rem;

}


/* ==========================================================
   Footer Name
========================================================== */

.site-footer-name {

    font-family: "Poppins", sans-serif;

    font-size: 1.35rem;

    font-weight: 700;

    color: #22334A;

}


/* ==========================================================
   Footer Tagline
========================================================== */

.site-footer-tagline {

    margin: .5rem 0 1.75rem;

    font-size: .95rem;

    line-height: 1.6;

    color: #6D7A86;

}


/* ==========================================================
   Footer Navigation
========================================================== */

.site-footer-nav {

    display: flex;

    align-items: center;

    justify-content: center;

    flex-wrap: wrap;

    gap: 2rem;

}


.site-footer-nav a {

    font-family: "Inter", sans-serif;

    font-size: .9rem;

    font-weight: 600;

    color: #22334A;

    text-decoration: none;

    transition: color .2s ease;

}


.site-footer-nav a:hover {

    color: #92A98A;

}


/* ==========================================================
   Footer Bottom
========================================================== */

.site-footer-bottom {

    width: 100%;

    margin-top: 2.5rem;

    padding-top: 1.5rem;

    border-top: 1px solid #E8E3D9;

}


.site-footer-bottom p {

    margin: 0;

    font-size: .75rem;

    letter-spacing: .03em;

    color: #8A949C;

}


.site-footer-signoff {

    margin-top: .5rem !important;

    font-size: .85rem !important;

    font-style: italic;

    color: #7F9276 !important;

}

/* ==========================================================
   FOOTER TEXT FIX
========================================================== */

.site-footer .site-footer-brand p {
    font-weight: 400 !important;
}