/* ==========================================================================
   স্মৃতির পাতা — Editorial memory book styles
   ========================================================================== */

:root {
  --paper: #F6F0E4;
  --surface: #FFFAF0;
  --green: #245B47;
  --ink: #17342B;
  --gold: #B48B45;
  --muted: #6E756F;
  --rule: rgba(36, 91, 71, 0.18);
  --shadow: 0 10px 30px rgba(23, 52, 43, 0.08);
  --radius: 2px;
  --font-ui: "Hind Siliguri", "Noto Sans Bengali", sans-serif;
  --font-serif: "Noto Serif Bengali", "Cormorant Garamond", serif;
  --font-display: "Cormorant Garamond", "Noto Serif Bengali", serif;
  --space: clamp(1rem, 2vw, 2rem);
  --max: 1120px;
  --ease: 200ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(180, 139, 69, 0.08), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(36, 91, 71, 0.06), transparent 30%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(23, 52, 43, 0.015) 2px,
      rgba(23, 52, 43, 0.015) 3px
    ),
    var(--paper);
  line-height: 1.7;
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--green);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  background: var(--ink);
  color: var(--surface);
  padding: 0.6rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  top: 1rem;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(246, 240, 228, 0.92);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4.25rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  margin-right: auto;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.brand-meta {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  position: relative;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.2rem;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width var(--ease);
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--rule);
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-toggle span:not(.sr-only) {
  display: block;
  width: 1.1rem;
  height: 1px;
  background: var(--ink);
}

.verified-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--green);
  border: 1px solid var(--rule);
  background: var(--surface);
  padding: 0.35rem 0.75rem;
}

.verified-chip.compact {
  font-size: 0.8rem;
}

.verified-chip a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.verified-chip a:hover {
  border-bottom-color: var(--gold);
  color: var(--ink);
}

/* Hero
   -------------------------------------------------------------------------- */

.hero {
  padding: clamp(3.5rem, 10vw, 7rem) 0 clamp(2.5rem, 6vw, 4rem);
  border-bottom: 1px solid var(--rule);
}

.hero-inner {
  max-width: 40rem;
  position: relative;
}

.eyebrow,
.section-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 8vw, 5rem);
  line-height: 1.05;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--ink);
}

.hero-institution {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--green);
}

.hero-session {
  margin: 0.25rem 0 1.5rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.hero-copy {
  margin: 0;
  font-size: 1.05rem;
  max-width: 34rem;
  color: var(--ink);
}

.year-motif {
  margin-top: 2.5rem;
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 5.5rem);
  color: rgba(36, 91, 71, 0.08);
  letter-spacing: 0.08em;
  user-select: none;
}

/* Featured quote
   -------------------------------------------------------------------------- */

.featured-quote {
  padding: clamp(3rem, 8vw, 5rem) 0;
  border-bottom: 1px solid var(--rule);
}

.quote-stage {
  max-width: 46rem;
}

.quote-block {
  margin: 0;
  position: relative;
  padding: 0.5rem 0 0.5rem 1.25rem;
  border-left: 2px solid var(--gold);
}

.quote-block::before {
  content: "“";
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 1;
  color: rgba(180, 139, 69, 0.45);
  position: absolute;
  top: -0.6rem;
  left: 1rem;
}

.quote-text {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.5vw, 1.7rem);
  line-height: 1.85;
  margin: 1.5rem 0 1.5rem;
  white-space: pre-line;
}

.quote-attribution {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-style: normal;
}

.quote-attribution cite {
  font-style: normal;
  font-weight: 600;
  display: block;
}

.quote-attribution a {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}

.quote-attribution a:hover {
  color: var(--green);
}

.quote-avatar,
.member-photo,
.portrait-frame img {
  object-fit: cover;
  object-position: center;
}

.quote-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--rule);
}

.text-link {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin-top: 1.5rem;
  font: inherit;
  color: var(--green);
  cursor: pointer;
  border-bottom: 1px solid transparent;
}

.text-link:hover {
  border-bottom-color: var(--gold);
}

/* Members
   -------------------------------------------------------------------------- */

.members-section {
  padding: clamp(3rem, 8vw, 5rem) 0;
}

.section-header {
  margin-bottom: 2rem;
}

.section-header h2,
.about-section h2,
.profile-name,
.error-page h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}

.section-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.filters {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 1fr auto;
  gap: 0.85rem;
  align-items: end;
  margin-bottom: 1.75rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-field label {
  font-size: 0.8rem;
  color: var(--muted);
}

input[type="search"],
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
textarea,
select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule);
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  padding: 0.7rem 1.15rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--ease), background var(--ease), border-color var(--ease), color var(--ease);
}

.btn-primary {
  background: var(--green);
  color: #fff;
}

.btn-primary:hover {
  background: var(--ink);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--rule);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--gold);
}

.btn-danger {
  background: #7a2e2e;
  color: #fff;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.member-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}

.member-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(180, 139, 69, 0.45);
}

.member-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.member-photo-wrap {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: rgba(36, 91, 71, 0.08);
  border-bottom: 1px solid var(--rule);
}

.member-photo {
  width: 100%;
  height: 100%;
  transition: transform 280ms ease;
}

.member-card:hover .member-photo {
  transform: scale(1.02);
}

.member-card-body {
  padding: 1rem 1rem 1.15rem;
}

.member-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin: 0 0 0.35rem;
}

.member-roll {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.member-roll span {
  display: block;
  letter-spacing: 0.14em;
  font-size: 0.68rem;
  color: var(--gold);
}

.member-blood {
  margin: 0.45rem 0 0;
  font-size: 0.85rem;
  color: var(--green);
}

.member-quote-preview {
  margin: 0.75rem 0 0;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, rgba(36, 91, 71, 0.12), rgba(180, 139, 69, 0.18));
  color: var(--green);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.5rem;
}

.quote-avatar.avatar-fallback {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 0.9rem;
}

.empty-state,
.empty-note {
  text-align: center;
  color: var(--muted);
  padding: 2.5rem 1rem;
}

.filter-count {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

/* About
   -------------------------------------------------------------------------- */

.about-section {
  padding: clamp(3rem, 7vw, 4.5rem) 0 clamp(4rem, 8vw, 6rem);
  border-top: 1px solid var(--rule);
}

.about-inner {
  max-width: 38rem;
}

.about-section h2 {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  margin-bottom: 1rem;
}

.about-section p {
  margin: 0;
  font-size: 1.05rem;
}

/* Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2.5rem 0 3rem;
  background: rgba(255, 250, 240, 0.55);
}

.footer-inner {
  text-align: center;
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin: 0 0 0.35rem;
}

.footer-meta,
.footer-line {
  margin: 0.15rem 0;
  color: var(--muted);
}

.footer-line {
  margin-top: 1rem;
  font-family: var(--font-serif);
  font-style: italic;
}

/* Profile
   -------------------------------------------------------------------------- */

.profile {
  padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 7vw, 5rem);
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.portrait-frame {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}

.portrait-frame img,
.portrait-fallback {
  width: 100%;
  height: 100%;
}

.portrait-fallback {
  font-size: 3rem;
}

.profile-yearbook-label {
  margin: 0.85rem 0 0;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.profile-name {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 0.5rem;
}

.profile-roll {
  margin: 0 0 1.75rem;
  color: var(--muted);
}

.profile-roll span {
  display: block;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--gold);
}

.profile-quote {
  margin: 0 0 2rem;
  padding: 1.5rem 0 1.5rem 1.25rem;
  border-left: 2px solid var(--gold);
  position: relative;
}

.profile-quote::before {
  content: "“";
  font-family: var(--font-display);
  font-size: 3.5rem;
  color: rgba(180, 139, 69, 0.4);
  position: absolute;
  top: 0.2rem;
  left: 1rem;
}

.profile-quote p {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.9;
  margin: 1.25rem 0 0;
  white-space: pre-line;
}

.profile-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0 0 2rem;
  padding: 0;
}

.profile-meta div,
.contact-list div {
  border-top: 1px solid var(--rule);
  padding-top: 0.75rem;
}

.profile-meta dt,
.contact-list dt {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.25rem;
}

.profile-meta dd,
.contact-list dd {
  margin: 0;
  font-weight: 600;
}

.contact-block {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.contact-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.contact-header h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin: 0;
}

.contact-list {
  margin: 0 0 1.25rem;
  display: grid;
  gap: 0.85rem;
}

.back-link a {
  color: var(--muted);
  text-decoration: none;
}

.back-link a:hover {
  color: var(--green);
}

.error-page {
  padding: 5rem 0;
  text-align: center;
  max-width: 32rem;
}

.error-page p {
  color: var(--muted);
}

/* Modal
   -------------------------------------------------------------------------- */

.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 52, 43, 0.45);
}

.modal-dialog {
  position: relative;
  width: min(100%, 28rem);
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: var(--shadow);
  animation: fadeIn 200ms ease;
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.65rem;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.modal-dialog h2 {
  font-family: var(--font-serif);
  margin: 0 0 0.75rem;
  font-size: 1.4rem;
}

.modal-lead {
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.modal-dialog label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.modal-dialog .btn {
  width: 100%;
  margin-top: 1rem;
}

.form-error {
  color: #7a2e2e;
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .members-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 860px) {
  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .filters .btn {
    grid-column: 1 / -1;
  }

  .members-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .profile-layout {
    grid-template-columns: 1fr;
  }

  .portrait-frame {
    max-width: 320px;
  }

  .profile-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.25rem 0 1rem;
    gap: 0.85rem;
  }

  .site-nav.is-open {
    display: flex;
  }

  .verified-chip {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 560px) {
  .filters {
    grid-template-columns: 1fr;
  }

  .members-grid {
    grid-template-columns: 1fr;
  }

  .member-photo-wrap {
    aspect-ratio: 5 / 4;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
