/* --- GLOBAL GRID CONTAINER --- */
.curriculum-grid {
    display: grid;
    /* On mobile, stack them. On wider screens, fit 3-4 columns. */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 25px; 
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* --- INDIVIDUAL CARD STYLING --- */
.grade-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background-color: #f9f9f9;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    text-align: center;
}

/* Title styling */
.grade-card h3 {
    font-size: 1.15em;
    color: #1a5e85; 
    margin: 0 0 15px 0;
    min-height: 50px; 
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    text-transform: uppercase;
}

/* Book cover link */
.pdf-link {
    display: block;
    margin-bottom: 15px;
    max-width: 150px; 
}

/* Image styling */
.grade-card img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.grade-card img:hover {
    transform: translateY(-3px);
}

/* --- DOWNLOAD BUTTONS --- */

/* Base style for all buttons */
.slides-link, 
.download-link {
    display: block;
    width: 90%;
    padding: 10px 0;
    margin-top: 10px; 
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s; /* Added color transition */
    box-sizing: border-box;
}

/* Style for the primary Download Book link */
.download-link {
    background-color: #d3aa4e; /* Your specified gold color */
    color: white; /* Bright white text looks good on this darker gold */
}

.download-link:hover {
    background-color: #b58d3c; /* Darker shade on hover */
    color: white;
}

/* Style for the Lesson Slides link */
.slides-link {
    background-color: #e8c67c; /* Lighter shade of gold */
    color: #333333; /* **DARK GRAY TEXT for contrast on the light background** */
    border: 1px solid #d3aa4e; 
}

.slides-link:hover {
    background-color: #d3aa4e; /* Revert to the main color on hover */
    color: white; /* Switch to white text when the background darkens */
}

/* Style for the N/A (PK) entry remains the same */
.slides-link.unavailable {
    background-color: #ccc;
    color: #666;
    pointer-events: none;
    margin-top: auto; 
    width: 90%;
    border: none;
}

/* --- CONTAINER: Flexbox for alignment --- */
.resource-links-container {
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on smaller screens */
    justify-content: center; /* Center items horizontally */
    gap: 20px; /* Space between the cards */
    padding: 20px 0;
    margin: 0 auto;
    max-width: 900px;
}

/* --- INDIVIDUAL CARD STYLING: Make the whole card clickable --- */
.resource-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Align content to the top */
    text-align: center;
    text-decoration: none; /* Remove underline from the link */
    width: 250px; /* Base width for each card */
    padding: 20px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #ffffff;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Hover effect */
.resource-card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-3px);
    background-color: #f0f8ff; /* Light background change on hover */
}

/* --- ICON STYLING --- */
.resource-icon {
    width: 60px; /* Larger, more prominent icon size */
    height: auto;
    margin-bottom: 10px;
}

/* --- TEXT STYLING --- */
.resource-text {
    font-size: 1.1em;
    font-weight: bold;
    color: #1a5e85; /* Your specified color */
    line-height: 1.3;
}

/* Media Query: Stack items vertically on very small screens */
@media (max-width: 600px) {
    .resource-card {
        width: 100%; /* Full width on mobile */
        max-width: 300px; /* Limit max width in case of very wide phones */
    }
}

/* =========================
   PRE-SERVANTS (SCOPED)
   Won't affect your other grids
   ========================= */

.preservants .grade-card {
  position: relative; /* helps if you add more UI later */
}

/* Make the "View Lessons" button look like your existing buttons */
.preservants .toggle-lessons {
  display: block;
  width: 90%;
  padding: 10px 0;
  margin-top: 10px;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;

  background-color: #ffffff;
  color: #333333;
  border: 1px solid #d3aa4e;

  transition: background-color 0.3s, color 0.3s;
}

.preservants .toggle-lessons:hover {
  background-color: #d3aa4e;
  color: #ffffff;
}

/* The expandable lessons area */
.preservants .lessons {
  width: 90%;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #ddd;
  text-align: left; /* easier to scan lesson titles */
}

/* Individual lesson links */
.preservants .lesson-link {
  display: block;
  padding: 8px 10px;
  margin: 6px 0;
  border-radius: 5px;
  text-decoration: none;

  background-color: #f3f3f3;
  color: #1a5e85;

  transition: transform 0.2s, background-color 0.2s;
}

.preservants .lesson-link:hover {
  background-color: #e8c67c;
  transform: translateY(-1px);
}

/* ===== PRE-SERVANTS: Subject -> Units -> Lessons (minimal + consistent) ===== */

.preservants .subject-card{
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:15px;
  border:1px solid #ddd;
  border-radius:10px;
  background-color:#f9f9f9;
  box-shadow:0 4px 6px rgba(0,0,0,0.05);
  text-align:center;
}

/* Subject title */
.preservants .subject-card > h3{
  font-size:1.15em;
  color:#1a5e85;
  margin:0 0 10px 0;
  line-height:1.2;
  text-transform:uppercase;
}

/* Buttons (same gold style, wraps text) */
.preservants .btn{
  display:block;
  width:90%;
  padding:10px 12px;
  margin-top:10px;
  border-radius:5px;
  font-weight:bold;
  text-decoration:none;
  box-sizing:border-box;
  border:1px solid #d3aa4e;
  cursor:pointer;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.2;
  text-align:center;
}

.preservants .btn.download{
  background-color:#d3aa4e;
  color:#fff;
}
.preservants .btn.download:hover{
  background-color:#b58d3c;
  color:#fff;
}

/* Unit list */
.preservants .unit{
  width:100%;
  margin-top:10px;
  border:1px solid #e2e2e2;
  border-radius:10px;
  background:#ffffff;
  box-shadow:0 2px 4px rgba(0,0,0,0.06);
  overflow:hidden;
}

/* Subtle, compact unit header */
.preservants .unit-header{
  width:100%;
  padding:8px 12px;
  border:0;
  background:#f5f2e8;     /* very light gold */
  color:#1a5e85;
  font-size:0.9rem;       /* smaller than subject title */
  font-weight:600;        /* medium, not heavy */
  text-transform:none;    /* normal casing */
  text-align:left;
  cursor:pointer;
  line-height:1.3;
  border-bottom:1px solid #e2e2e2;
}

.preservants .unit-header:hover{
  background:#e8c67c;
  color:#333;
}

/* Expanded content */
.preservants .unit-body{
  padding:12px 0 6px;
}

/* Lessons */
.preservants .lessons{
  width:90%;
  margin:10px auto 8px;
  padding-top:10px;
  border-top:1px solid #ddd;
  text-align:left;
}

.preservants .lesson{
  display:block;
  padding:8px 10px;
  margin:6px 0;
  border-radius:5px;
  text-decoration:none;
  background:#f3f3f3;
  color:#1a5e85;
  transition:transform 0.2s, background-color 0.2s;
}
.preservants .lesson:hover{
  background:#e8c67c;
  transform:translateY(-1px);
}
/* Video overview thumbnail */
.preservants .video-thumb{
  display:block;
  width:90%;
  margin:10px auto 0;
  text-decoration:none;
}

.preservants .video-thumb img{
  width:100%;
  height:auto;
  display:block;
  border-radius:8px;
  box-shadow:0 2px 4px rgba(0,0,0,0.1);
}

.preservants .video-caption{
  margin-top:6px;
  font-weight:bold;
  color:#1a5e85;
  text-align:center;
}

/* Unit download row: same as lesson style, just a tiny emphasis */
.preservants .lesson.unit-action{
  font-weight:bold;
}

/* Smaller + subtler unit headers */
.preservants .unit-header{
  font-size: 0.82rem;   /* smaller */
  padding: 7px 10px;    /* tighter */
}

/* Subject-level controls */
.preservants .subject-controls{
  width: 90%;
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.preservants .subject-controls .btn{
  width: 50%;
  margin-top: 0;
  background: #ffffff;
  color: #333333;
}

/* Keep hover consistent */
.preservants .subject-controls .btn:hover{
  background-color:#d3aa4e;
  color:#ffffff;
}

/* Mobile tightening */
@media (max-width: 600px){
  .preservants .curriculum-grid{
    gap: 14px;
    padding: 12px 0;
    grid-template-columns: 1fr; /* single column */
  }

  .preservants .subject-card{
    padding: 12px;
  }

  .preservants .unit{
    margin-top: 10px;
  }

  .preservants .lessons{
    width: 92%;
    margin: 8px auto 6px;
    padding-top: 8px;
  }

  .preservants .lesson{
    padding: 7px 9px;
    margin: 5px 0;
    font-size: 0.92rem;
  }

  .preservants .unit-header{
    font-size: 0.78rem; /* even smaller on mobile */
    padding: 6px 10px;
  }

  .preservants .btn{
    width: 92%;
    padding: 9px 10px;
    margin-top: 8px;
    font-size: 0.95rem;
  }

  .preservants .subject-controls{
    width: 92%;
    gap: 8px;
  }
}

/* Top-of-page global controls */
.preservants .preservants-controls{
  max-width: 1200px;
  margin: 0 auto 10px;
  padding: 0 10px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.preservants .preservants-controls .btn{
  width: auto;               /* override the 90% button width */
  min-width: 220px;
  margin-top: 0;
  background: #ffffff;
  color: #333333;
}

.preservants .preservants-controls .btn:hover{
  background-color:#d3aa4e;
  color:#ffffff;
}

@media (max-width: 600px){
  .preservants .preservants-controls{
    gap: 8px;
    padding: 0 8px;
  }
  .preservants .preservants-controls .btn{
    min-width: 0;
    flex: 1;                 /* two equal buttons */
    padding: 9px 10px;
    font-size: 0.95rem;
  }
}


