/* Weekly Plan Header Section */
.weekly-plan-header {
  text-align: center;
  padding: 3rem 1.5rem;
  background: linear-gradient(to bottom, #f9fdf9, #f1f1f1);
  border-bottom: 2px solid var(--primary-green);
  max-width: 1000px;
  margin: 0 auto 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.weekly-plan-header .section-image {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
}

.weekly-plan-header .section-image img {
  width: 100%;              /* ensure it fills the container */
  height: 100%;             /* match the overlay container height */
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  object-fit: cover;        /* maintain aspect ratio, crop overflow */
  object-position: top;     /* bias cropping toward the top */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.weekly-plan-header .section-image img:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

.weekly-plan-header h2 {
  font-family: var(--font-serif-primary);
  font-size: 2.2rem;
  color: var(--primary-green);
  margin-bottom: 0.5rem;
}

.weekly-plan-header h3 {
  font-family: var(--font-serif-secondary);
  font-size: 1.4rem;
  color: #444;
  margin-bottom: 1rem;
}

.weekly-plan-header p {
  font-family: var(--font-sans-secondary);
  font-size: 1.1rem;
  line-height: 1.6;
  color: #333;
  max-width: 800px;
  margin: 0 auto;
}

/* Overlay mode */
.weekly-plan-header .section-image.overlay-mode {
  position: relative;
  width: 100%;
  max-height: 400px;
  overflow: hidden;
}

.weekly-plan-header .section-image.overlay-mode .overlay-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: #ffffff;
  color: #222;
  padding: 1.5rem 2rem;
  border-radius: 10px;
  max-width: 80%;
  z-index: 2;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  opacity:0.9;
}

/* Weekly Plan Content Section */
.weekly-plan-content {
  text-align: center;
  padding: 2rem 1rem;
  max-width: 1000px;
  margin: 0 auto 3rem;
}

.weekly-plan-content h2 {
  font-family: var(--font-serif-primary);
  font-size: 2rem;
  color: var(--primary-green);
  margin-bottom: 0.5rem;
}

.weekly-plan-content h3 {
  font-family: var(--font-serif-secondary);
  font-size: 1.3rem;
  color: #444;
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
  padding-bottom: 0.3rem;
}

.weekly-plan-content h3::after {
  content: "";
  display: block;
  width: 50px;
  height: 3px;
  background-color: var(--primary-green);
  margin: 0.5rem auto 0;
  border-radius: 2px;
  opacity: 0.7;
}

.plan-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  justify-items: center;
}

.plan-button {
  display: flex;              /* center child horizontally */
  align-items: center;        /* center child vertically */
  justify-content: center;    /* center child horizontally */
  width: 100%;
  max-width: 200px;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  font-family: var(--font-sans-primary);
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.plan-button a {
  display: inline-block;      /* predictable sizing inside flex container */
  text-align: center;
}

.plan-button.plan-available {
  background: #fff;
  border: 1px solid var(--primary-green);
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.plan-buttons.recent-plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 200px)); /* exactly two columns */
  gap: 1rem;
  justify-content: center;   /* center the whole grid block */
}

.plan-button.plan-available a {
  color: var(--primary-green);
  text-decoration: none;
  font-size: 1.1rem;
}

.plan-button.plan-available:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.plan-button.plan-unavailable {
  background: #f5f5f5;
  border: 1px solid #ccc;
  color: #999;
  cursor: not-allowed;
}

.plan-button.plan-unavailable span {
  font-size: 1.1rem;
  color: #999;
}

/* Archive Section */
.weekly-plan-archive {
  text-align: center;
  padding: 2rem 1rem;
  max-width: 900px;
  margin: 0 auto 3rem;
}

.weekly-plan-archive h2 {
  font-family: var(--font-serif-primary);
  font-size: 2rem;
  color: var(--primary-green);
  margin-bottom: 1rem;
}

.weekly-plan-archive h3 {
  font-family: var(--font-serif-secondary);
  font-size: 1.3rem;
  color: #444;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
  padding-bottom: 0.3rem;
}

.weekly-plan-archive h3::after {
  content: "";
  display: block;
  width: 50px;
  height: 3px;
  background-color: var(--primary-green);
  margin: 0.5rem auto 0;
  border-radius: 2px;
  opacity: 0.7;
}

/* Group layouts */
.weekly-plan-archive .year-buttons,
.weekly-plan-archive .month-buttons,
.weekly-plan-archive .date-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

/* Archive buttons styled as links */
.weekly-plan-archive .archive-button {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--primary-green);
  color: var(--primary-green);
  font-family: var(--font-sans-primary);
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.weekly-plan-archive .archive-button:hover {
  background: var(--primary-green);
  color: #fff;
  transform: translateY(-2px);
}

/* Back link variant */
.weekly-plan-archive .archive-button.back-link {
  background: #f5f5f5;
  border: 1px solid #ccc;
  color: #666;
  font-weight: 500;
  position: relative;
  padding-left: 2rem;
}

.weekly-plan-archive .archive-button.back-link::before {
  content: "←";
  position: absolute;
  left: 0.75rem;
  font-size: 1rem;
  color: #666;
}

.weekly-plan-archive .archive-button.back-link:hover {
  background: #e0e0e0;
  color: #333;
  transform: none;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .plan-buttons {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
  }
  .plan-button {
    padding: 0.75rem;
  }
  .weekly-plan-archive .year-buttons,
  .weekly-plan-archive .month-buttons,
  .weekly-plan-archive .date-buttons {
    gap: 0.5rem;
  }
  .weekly-plan-archive .archive-button {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
  }
}
