/* /styles/gradeteachersguides.css */
/* Light mode – A4 cover cards (contain), aligned content, educational blue */

/* ---------------------------------------
   Variables
---------------------------------------- */
:root{
  --bg: #f5f8fc;
  --surface: #ffffff;
  --surfaceSoft: #eef2ff;
  --border: #e2e8f0;

  --text: #0f172a;
  --muted: #475569;
  --muted2: #64748b;

  --blue: #2563eb;
  --blue700: #1d4ed8;
  --blueSoft: #dbeafe;

  --radius: 16px;
  --shadow: 0 10px 26px rgba(15,23,42,.08);
  --shadowHover: 0 18px 40px rgba(15,23,42,.12);

  --container: 1180px;
  --gap: 18px;
}

*,
*::before,
*::after{ box-sizing: border-box; }

html, body{ height: 100%; }

body{
  margin: 0;
  font-family: "Poppins", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

img{ display: block; max-width: 100%; }
a{ color: inherit; text-decoration: none; }

/* ---------------------------------------
   Layout
---------------------------------------- */
.container{
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
  padding: 24px 0 56px;
}

/* ---------------------------------------
   Header (no border)
---------------------------------------- */
.page-header{
  width: min(100% - 32px, var(--container));
  margin: 22px auto 8px;
  padding: clamp(18px, 2.2vw, 28px);
  background: linear-gradient(135deg, #ffffff 0%, #f0f6ff 100%);
  border-radius: calc(var(--radius) + 8px);
}

.page-header h1{
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
  line-height: 1.25;
  color: #0b3aa5;
}

.page-header p{
  margin: 0;
  color: var(--muted);
  max-width: 80ch;
}

/* ---------------------------------------
   Letter header
---------------------------------------- */
.letter-header{
  margin: 28px 0 12px;
  font-size: 1.6rem;
  font-family: "Poppins", sans-serif;
  font-weight: 800;
  color: #1e40af;
  display: flex;
  align-items: center;
  gap: 12px;
}

.letter-header::after{
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--blueSoft), transparent);
}

/* ---------------------------------------
   Grid
---------------------------------------- */
.card-grid{
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* 2 cards by default (mobile) */
}

/* Optional: super small phones */
@media (max-width: 380px){
  .card-grid{
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

@media (min-width: 900px){
  .card-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1200px){
  .card-grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------------------------------------
   Card (SIMILAR TO YOUR SNIPPET)
---------------------------------------- */
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(17,24,39,.04);

  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover{
  transform: translateY(-3px);
  box-shadow: var(--shadowHover);
  border-color: rgba(37,99,235,.22);
}

/* ---------------------------------------
   Cover Image (A4-ish) – matches your approach
   A4 ratio ~ 1 : 1.414
---------------------------------------- */
.card-image{
  position: relative;
  width: 100%;
  background: var(--surfaceSoft);
  aspect-ratio: 1 / 1.414;
  overflow: hidden;

  /* subtle separator like a “card section” */
  border-bottom: 1px solid rgba(226,232,240,.9);
}

/* Full cover display, no cropping */
.card-image img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  filter: drop-shadow(0 6px 18px rgba(17,24,39,.14));
  transform: translateZ(0);
}

/* Grade badge overlapping at the bottom of the cover */
.grade-badge{
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;

  padding: 6px 12px;
  font-size: .8rem;
  font-weight: 700;
  border-radius: 999px;

  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 16px rgba(37,99,235,.22);
}

/* ---------------------------------------
   Content (aligned across cards)
---------------------------------------- */
.card-content{
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1; /* makes meta stick to bottom consistently */
}

.card-title{
  margin: 0;
  font-size: .98rem;
  line-height: 1.3;
  color: var(--text);

}

.card-meta{
  margin-top: auto; /* key for alignment */
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .88rem;
  color: var(--muted2);
  font-family: "Roboto", sans-serif;
}

.meta-separator{ opacity: .6; }

/* ---------------------------------------
   Empty state
---------------------------------------- */
main.container > p{
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}

/* ---------------------------------------
   Small screen polish
---------------------------------------- */
@media (max-width: 380px){
  .card-content{ padding: 14px; }
  .grade-badge{ left: 10px; bottom: 10px; }
}
