/* Coffee with IPD — shared design tokens & component styles */

:root {
  --espresso: #3C2A1E;
  --espresso-light: #5A3E2B;
  --cream: #EDECE8;
  --card: #FFFFFF;
  --copper: #5A3E2B;
  --copper-dark: #3C2A1E;
  --latte: #DAD8D2;
}

html { scroll-behavior: smooth; scroll-padding-top: 112px; }

body {
  font-family: Georgia, 'Times New Roman', 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', serif;
  background-color: var(--cream);
  color: var(--espresso);
}

.font-display {
  font-family: Georgia, 'Noto Serif TC', 'Times New Roman', serif;
}

/* Nav */
#site-nav.scrolled {
  box-shadow: 0 2px 14px rgba(60, 42, 30, 0.08);
}

.nav-link {
  position: relative;
  color: var(--espresso);
  opacity: 0.75;
  transition: opacity 0.2s ease;
}
.nav-link:hover { opacity: 1; }
.nav-link.active {
  color: var(--copper-dark);
  opacity: 1;
  font-weight: 700;
}
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0.25rem; right: 0.25rem; bottom: -6px;
  height: 2px;
  background: var(--copper);
  border-radius: 2px;
}

#mobile-nav {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
#mobile-nav.open { max-height: 640px; }

/* Cards */
.resource-card {
  background: var(--card);
  border: 1px solid var(--latte);
  border-radius: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.resource-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(60, 42, 30, 0.12);
  border-color: var(--copper);
}

.grade-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--latte);
  color: var(--espresso-light);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  border-radius: 9999px;
  padding: 0.25rem 0.7rem;
}

.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, var(--copper), var(--copper-dark));
  color: #fff;
  flex-shrink: 0;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper-dark);
}

/* Hero — hand-drawn illustration background with dark scrim for text contrast */
.hero-bg {
  background-image:
    linear-gradient(rgba(26, 17, 11, 0.55), rgba(26, 17, 11, 0.55)),
    url("https://drive.google.com/thumbnail?id=1ppXLTFjtpHOTlNW9ZMApMwTfEiphDLcD&sz=w3000") !important;
  background-size: cover, cover;
  background-position: center, top;
  background-repeat: no-repeat, no-repeat;
  background-color: var(--espresso);
}
.hero-bg .section-kicker { color: rgba(255, 255, 255, 0.8) !important; }
.hero-bg h1 { color: #fff !important; }
.hero-bg p.font-display,
.hero-bg p.text-copperDark { color: #E3D5C4 !important; }
.hero-bg p:not(.font-display) { color: rgba(255, 255, 255, 0.85) !important; }

/* Scrollbar-less chip row */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Inline slide embed wrapper (Google Slides "Publish to web" embed) */
.embed-wrap {
  position: relative;
  width: 100%;
  padding-top: 60.9%; /* Google Slides default embed ratio */
  background: var(--latte);
  border-top: 1px solid var(--latte);
  overflow: hidden;
}
.embed-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* Expired sign-up / dated links (see assets/expiry.js) */
.link-expired {
  pointer-events: none;
  cursor: default;
  opacity: 0.55;
  border-style: solid !important;
  background: var(--latte) !important;
  color: var(--espresso-light) !important;
}

/* Tab selector (Department Overview / AP Courses) */
.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: var(--card);
  border: 1px solid var(--latte);
  border-radius: 1rem;
  padding: 1.1rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  flex: 1 1 130px;
  text-align: center;
  font-family: inherit;
}
.tab-btn:hover { transform: translateY(-2px); }
.tab-btn.active {
  border-color: var(--copper);
  box-shadow: 0 0 0 1px var(--copper);
}
.tab-btn span.tab-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--espresso);
}
.tab-panel-placeholder {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--espresso-light);
  text-align: left;
  padding: 1rem 1.25rem;
}

/* Numbered section header (single-page layout) */
.numbered-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background: var(--espresso);
  color: #fff;
  font-family: Georgia, 'Noto Serif TC', serif;
  font-weight: 800;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.section-anchor {
  scroll-margin-top: 112px;
}

.embed-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--espresso-light);
  font-size: 0.8rem;
  text-align: center;
  padding: 1rem;
  border-top: 1px dashed rgba(90, 62, 43, 0.4);
}

/* Lightbox — click a thumbnail, page through the group in place */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 7, 5, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 3rem 1rem;
}
.lightbox-overlay.open { display: flex; }
.lightbox-img {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 0.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-size: 2rem;
  line-height: 1;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
}
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255, 255, 255, 0.24); }
.lightbox-prev { left: 0.75rem; }
.lightbox-next { right: 0.75rem; }
.lightbox-counter {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  font-weight: 600;
}
