/* ==========================================================================
   PRINCIPAL'S LETTERS PAGE STYLESHEET
   Replicating exact layout of Aitchison College Principal's Letters Page
   Matches Screenshot media_1792042663287.png for Basharat H.S.S
   ========================================================================== */

/* Hero Banner & Hollow Gold Outlined Title */
.letters-page .subpage-hero {
  position: relative;
  width: 100%;
  height: 420px;
  background-color: var(--color-navy-dark);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.letters-page .subpage-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.letters-page .subpage-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(4, 13, 29, 0.45) 0%,
    rgba(8, 27, 58, 0.3) 40%,
    rgba(4, 13, 29, 0.85) 100%
  );
}

.letters-page .subpage-hero-content {
  position: relative;
  z-index: 10;
  width: 100%;
  padding-bottom: 24px;
}

.letters-page .subpage-title {
  font-family: 'Cinzel', 'Playfair Display', Georgia, serif;
  font-size: clamp(2.2rem, 5.2vw, 3.8rem);
  font-weight: 700;
  color: transparent !important;
  -webkit-text-stroke: 1.8px #EAA023;
  letter-spacing: 4px;
  text-transform: uppercase;
  line-height: 1.15;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.7);
}

/* Yellow Accent Breadcrumb Bar */
.letters-page .breadcrumb-bar {
  background: #EAA023;
  padding: 8px 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: #1E293B;
}

.letters-page .breadcrumb-bar a {
  color: #1E293B;
  text-decoration: none;
  font-weight: 600;
}

.letters-page .breadcrumb-bar a:hover {
  text-decoration: underline;
}

.letters-page .breadcrumb-separator {
  margin: 0 6px;
  color: #334155;
}

/* Main Two-Column Layout Section */
.letters-section {
  padding: 40px 0 60px;
  background-color: #F8FAFC;
}

.letters-layout-grid {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 1024px) {
  .letters-layout-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

/* Left Letters Grid */
.letters-cards-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .letters-cards-container {
    grid-template-columns: 1fr;
  }
}

/* Single Letter Card */
.letter-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 3px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  cursor: pointer;
  min-height: 86px;
}

.letter-card:hover {
  border-color: #D4AF37;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(8, 27, 58, 0.08);
}

/* Envelope Icon */
.letter-envelope {
  width: 52px;
  height: 40px;
  background: linear-gradient(135deg, #0A2540 0%, #081B3A 100%);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 3px 8px rgba(8, 27, 58, 0.2);
  color: #D4AF37;
  font-size: 1.15rem;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.letter-envelope::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  border-top: 18px solid rgba(255, 255, 255, 0.08);
  border-left: 26px solid transparent;
  border-right: 26px solid transparent;
}

.letter-envelope i {
  position: relative;
  z-index: 2;
  font-size: 0.95rem;
}

.letter-info {
  flex: 1;
  min-width: 0;
}

.letter-date {
  font-size: 0.76rem;
  font-weight: 500;
  color: #64748B;
  display: block;
  margin-bottom: 4px;
}

.letter-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #081B3A;
  line-height: 1.35;
  display: block;
  transition: color 0.2s ease;
}

.letter-card:hover .letter-title {
  color: #0369A1;
}

/* Right Sidebar Widgets */
.letters-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Time Period Widget */
.time-period-widget {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.time-period-header {
  background: #081B3A;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #FFFFFF;
}

.time-period-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.2;
  text-transform: uppercase;
  color: #94A3B8;
}

.time-period-year-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.time-period-year {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #EAA023;
  letter-spacing: 1px;
}

.time-period-nav {
  display: flex;
  gap: 6px;
}

.time-nav-btn {
  background: transparent;
  border: none;
  color: #CBD5E1;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px 4px;
  transition: color 0.2s ease;
}

.time-nav-btn:hover {
  color: #EAA023;
}

.months-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: #E2E8F0;
  padding: 1px;
}

.month-btn {
  background: #F8FAFC;
  border: none;
  padding: 12px 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.month-btn:hover {
  background: #081B3A;
  color: #EAA023;
}

.month-btn.active {
  background: #081B3A;
  color: #EAA023;
  font-weight: 700;
}

/* Sidebar News & Events Card */
.sidebar-news-card {
  background: linear-gradient(180deg, #BAE6FD 0%, #E0F2FE 100%);
  border: 1px solid #7DD3FC;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
  text-decoration: none;
  display: block;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.sidebar-news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.2);
}

.sidebar-news-header {
  padding: 16px 20px 10px;
  text-align: center;
}

.sidebar-news-title {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #081B3A;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: inline-block;
  padding-bottom: 6px;
  border-bottom: 2px solid #EAA023;
}

.sidebar-news-img-wrap {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.sidebar-news-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.sidebar-news-card:hover .sidebar-news-img {
  transform: scale(1.04);
}

/* Sidebar Feature Promo Cards (Old Boys Bulletin & Publications) */
.sidebar-feature-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.25s ease;
}

.sidebar-feature-card:hover {
  border-color: #D4AF37;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(8, 27, 58, 0.08);
}

.sidebar-feature-title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 800;
  color: #081B3A;
  letter-spacing: 1px;
  text-transform: uppercase;
  line-height: 1.25;
}

.sidebar-feature-card:hover .sidebar-feature-title {
  color: #0369A1;
}

.sidebar-feature-preview {
  width: 80px;
  height: 80px;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  background: #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-feature-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Stay Up to Date Callout Section */
.stay-updated-section {
  background: #FFFFFF;
  padding: 50px 0 60px;
  border-top: 1px solid #E2E8F0;
}

.stay-updated-container {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.stay-updated-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #64748B;
  display: block;
  margin-bottom: 16px;
}

.stay-updated-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  flex-wrap: wrap;
}

.stay-updated-headline {
  font-family: 'Cinzel', 'Playfair Display', serif;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 900;
  color: #081B3A;
  letter-spacing: 2px;
  line-height: 1.05;
  margin: 0;
}

.stay-updated-link-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.stay-updated-visit {
  font-size: 1.05rem;
  color: #64748B;
}

.stay-updated-brand-link {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: #0369A1;
  text-decoration: none;
  transition: color 0.2s ease;
}

.stay-updated-brand-link:hover {
  color: #EAA023;
  text-decoration: underline;
}

.stay-updated-desc {
  font-size: 0.88rem;
  color: #64748B;
}

/* Modal for Reading Letter */
.letter-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 13, 29, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.letter-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.letter-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: min(720px, 92vw);
  max-height: 85vh;
  background: #FFFFFF;
  border-radius: 6px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  border-top: 4px solid #D4AF37;
}

.letter-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.letter-modal-header {
  padding: 20px 24px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.letter-modal-title {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  color: #081B3A;
  margin: 0;
  font-weight: 700;
}

.letter-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #64748B;
  cursor: pointer;
  transition: color 0.2s ease;
}

.letter-modal-close:hover {
  color: #081B3A;
}

.letter-modal-body {
  padding: 30px;
  overflow-y: auto;
  line-height: 1.8;
  color: #334155;
  font-size: 0.95rem;
}

.letter-seal {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #E2E8F0;
}

.letter-seal img {
  width: 50px;
  height: 50px;
}
