/* ==========================================================================
   REL 320: Sexuality and Gender in Buddhism — Stylesheet
   Theme: plum / copper, with a layered lotus-petal motif rendered as
   restrained line art — a recurring image across the figures this course
   studies (Tara, Guanyin, female bodhisattvas) without leaning on
   gendered color cliché.
   Edit the CSS custom properties in :root to retheme the whole site.
   ========================================================================== */

:root {
  /* ---- Color palette ---- */
  --bg-deep: #1c1522;
  --bg-mid: #241a2d;
  --bg-panel: #2b2035;
  --bg-panel-alt: #352840;
  --ink: #f5ece2;
  --ink-soft: #d6c8d3;
  --ink-muted: #a8919f;
  --copper: #c98a4b;
  --copper-strong: #e0a35f;
  --plum: #7d4f74;
  --plum-strong: #9c6693;
  --line: #453a52;
  --focus-ring: #ffcf5c;

  /* ---- Type ---- */
  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-body: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* ---- Layout ---- */
  --max-width: 62rem;
  --radius: 1rem;
  --gap: 1.5rem;
}

/* ---- Reset & base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, #3a2540 0%, transparent 45%),
    radial-gradient(circle at 90% 88%, #2a1a2e 0%, transparent 42%),
    linear-gradient(160deg, var(--bg-deep) 0%, var(--bg-mid) 55%, var(--bg-deep) 100%);
  background-attachment: fixed;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: 0.01em;
}

a {
  color: var(--copper-strong);
}

a:hover,
a:focus-visible {
  color: var(--copper);
}

/* ---- Visible focus for all interactive elements (a11y) ---- */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--focus-ring);
  color: #2a1a06;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 700;
  z-index: 100;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* ---- Decorative lotus background (aria-hidden, purely visual) ---- */
.mandala-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.mandala-decor svg {
  position: absolute;
  opacity: 0.14;
  color: var(--copper);
}

.mandala-decor .m1 {
  top: -14vw;
  right: -14vw;
  width: 46vw;
  height: 46vw;
  animation: spin-slow 200s linear infinite;
}

.mandala-decor .m2 {
  bottom: -20vw;
  left: -18vw;
  width: 54vw;
  height: 54vw;
  color: var(--plum-strong);
  animation: spin-slow-reverse 240s linear infinite;
}

@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes spin-slow-reverse {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(-360deg);
  }
}

/* ---- Page shell ---- */
.site-header {
  position: relative;
  z-index: 1;
  padding: 3rem 1.5rem 2rem;
  text-align: center;
}

.site-header__eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.8rem;
  color: var(--copper-strong);
  margin-bottom: 0.75rem;
}

.site-header h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  margin: 0 0 0.5rem;
  font-weight: 600;
  background: linear-gradient(90deg, var(--copper-strong) 0%, var(--plum-strong) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-header p.subtitle {
  color: var(--ink-soft);
  font-size: 1.1rem;
  max-width: 40rem;
  margin: 0 auto;
}

.ring-divider {
  display: block;
  margin: 1.75rem auto 0;
  width: 4.5rem;
  height: 4.5rem;
  opacity: 0.9;
}

main {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

/* ---- Tabs ---- */
.tabs-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  padding: 1rem 0.75rem;
  margin-bottom: 2rem;
  background: rgba(28, 21, 34, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.tab-btn {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--bg-panel);
  border: 1px solid var(--line);
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.tab-btn:hover {
  border-color: var(--copper-strong);
  color: var(--ink);
}

.tab-btn[aria-selected="true"] {
  background: linear-gradient(120deg, var(--plum-strong), var(--copper));
  color: #241129;
  border-color: transparent;
  box-shadow: 0 0 0 1px rgba(201, 138, 75, 0.4), 0 6px 18px -6px rgba(125, 79, 116, 0.6);
}

/* ---- Panels ---- */
.tab-panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  animation: fade-in 0.25s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tab-panel:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 4px;
}

.tab-panel h2 {
  font-size: 1.7rem;
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tab-panel h2 .icon {
  width: 1.6rem;
  height: 1.6rem;
  flex-shrink: 0;
  color: var(--copper-strong);
}

.tab-panel h3 {
  font-size: 1.2rem;
  color: var(--copper-strong);
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  border-top: 1px dashed var(--line);
  padding-top: 1.75rem;
}

.tab-panel > h3:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 1.5rem;
}

.tab-panel p {
  color: var(--ink-soft);
}

.lede {
  font-size: 1.05rem;
  color: var(--ink);
}

/* ---- Info cards (course info / contact) ---- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.info-card {
  background: var(--bg-panel-alt);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1.25rem 1.4rem;
}

.info-card h3 {
  margin: 0 0 0.6rem;
  padding: 0;
  border: none;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--plum-strong);
  font-family: var(--font-body);
  font-weight: 600;
}

.info-card p,
.info-card ul {
  margin: 0;
  color: var(--ink);
}

.info-card dl {
  margin: 0;
}

.info-card dt {
  font-weight: 600;
  color: var(--ink-muted);
  font-size: 0.85rem;
  margin-top: 0.6rem;
}

.info-card dt:first-child {
  margin-top: 0;
}

.info-card dd {
  margin: 0.1rem 0 0;
  color: var(--ink);
}

/* ---- Lists ---- */
.obj-list,
.tab-panel ul,
.tab-panel ol {
  padding-left: 1.4rem;
  color: var(--ink-soft);
}

.obj-list li,
.tab-panel li {
  margin-bottom: 0.55rem;
}

.tag-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-list li {
  background: rgba(201, 138, 75, 0.12);
  border: 1px solid rgba(201, 138, 75, 0.35);
  color: var(--copper-strong);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  margin: 0;
}

/* ---- Tables (grading, schedule, rubric) ---- */
.table-scroll {
  overflow-x: auto;
  margin: 1.25rem 0 2rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: 0.95rem;
}

caption {
  text-align: left;
  padding: 0.9rem 1rem 0.5rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
  font-style: italic;
}

th,
td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

thead th {
  background: var(--bg-panel-alt);
  color: var(--plum-strong);
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  position: sticky;
  top: 0;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(201, 138, 75, 0.06);
}

td.num,
th.num {
  text-align: right;
  white-space: nowrap;
}

/* ---- Weekly schedule table: fixed columns, Reading widest ---- */
table.schedule-table {
  table-layout: fixed;
  min-width: 62rem;
}

table.schedule-table .col-num {
  width: 3rem;
}

table.schedule-table .col-date {
  width: 8rem;
}

table.schedule-table .col-unit {
  width: 12rem;
}

table.schedule-table .col-reading {
  width: 22rem;
}

table.schedule-table .col-notes {
  width: 12rem;
}

table.schedule-table td,
table.schedule-table th {
  overflow-wrap: break-word;
}

/* ---- Policy accordion-like blocks ---- */
.policy-block {
  background: var(--bg-panel-alt);
  border: 1px solid var(--line);
  border-left: 4px solid var(--copper);
  border-radius: 0.5rem;
  padding: 1.1rem 1.4rem;
  margin-bottom: 1.25rem;
}

.policy-block h3 {
  margin: 0 0 0.5rem;
  padding: 0;
  border: none;
  font-size: 1.1rem;
}

.policy-block p:last-child {
  margin-bottom: 0;
}

.policy-block.accent-plum {
  border-left-color: var(--plum-strong);
}

/* ---- Callouts for editable placeholder guidance ---- */
.editor-note {
  background: rgba(201, 138, 75, 0.12);
  border: 1px dashed var(--focus-ring);
  color: #ffe3a3;
  border-radius: 0.6rem;
  padding: 0.85rem 1.1rem;
  font-size: 0.9rem;
  margin: 1.25rem 0;
}

.editor-note strong {
  color: var(--copper-strong);
}

/* ---- "To be added later" placeholder text ---- */
p.tbd {
  font-style: italic;
  color: var(--ink-muted);
  border: 1px dashed var(--line);
  border-radius: 0.4rem;
  padding: 0.6rem 0.9rem;
  margin: 0;
}

/* ---- Rubric level legend ---- */
.rubric-scale {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 1.75rem;
}

.rubric-scale span {
  background: var(--bg-panel-alt);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ---- Grade breakdown chips (compact grid) ---- */
.chip-grid {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.5rem;
}

.chip-grid li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  background: var(--bg-panel-alt);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
}

.chip-grid .label {
  font-weight: 600;
  color: var(--copper-strong);
}

.chip-grid .value {
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ---- Footer ---- */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2.5rem 1.5rem 3.5rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--copper-strong);
}

/* ---- Utility ---- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Print styles: force legible black-on-white for handouts ---- */
@media print {
  .mandala-decor,
  .skip-link,
  .tabs-nav {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .tab-panel {
    display: block !important;
    background: #fff;
    border: none;
    color: #000;
    page-break-after: always;
  }

  .tab-panel h2,
  .tab-panel h3,
  .site-header h1 {
    color: #000 !important;
    background: none !important;
    -webkit-text-fill-color: initial;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}

/* ---- Small screens ---- */
@media (max-width: 40rem) {
  .tabs-nav {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    flex: 0 0 auto;
  }
}
