/* Basic page styles. Phone-first: everything works on a narrow screen,
   and the content stays a comfortable width on big screens. */

/* The site's colors and fonts, named once here and reused below.
   ("--name" values are called CSS variables; var(--name) uses one.) */
:root {
  --navy: #1f3a5f;
  --ivory: #faf8f3;
  --gold: #b8975a;        /* muted gold, for thin lines */
  --gold-light: #d8c193;  /* gold text on the navy header */
  --gold-text: #87672f;   /* darker gold, readable as text on ivory/white */
  --text: #2a2a2a;
  --muted: #6b6b6b;
  --border: #e6dfd0;
  /* Elegant serif for headings. These fonts are already on people's
     devices (iPhone/Mac, Windows, then Georgia as a fallback), so nothing
     extra is downloaded from other websites. */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  /* Clean, readable font for everything else (each device's own system font) */
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--sans);
  line-height: 1.6;
  color: var(--text);
  background: var(--ivory);
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.25;
}

h2 {
  color: var(--navy);
}

/* ---------- Header (navy band at the top) ---------- */

.site-header {
  background: var(--navy);
  color: #fff;
  text-align: center;
  padding: 1rem 1.25rem 2.25rem;
}

/* The small Hebrew mark in the top corner */
.bsd {
  margin: 0;
  text-align: right;
  font-size: 0.95rem;
  opacity: 0.85;
}

h1 {
  margin: 0.75rem 0 0.5rem;
  font-size: 2.2rem;
  letter-spacing: 0.01em;
}

/* "Fromowitz Chabad Center / Beachwood, Ohio": small, spaced-out capitals */
.affiliation {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.85);
}

/* The thin gold line under the name */
.divider {
  width: 64px;
  height: 1px;
  margin: 1.25rem auto;
  border: 0;
  background: var(--gold);
}

.tagline {
  margin: 0 0 0.35rem;
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--gold-light);
}

.intro {
  margin: 0 auto;
  max-width: 30rem;
  color: rgba(255, 255, 255, 0.85);
}

/* Used on the admin pages' header */
.center-name {
  margin: 0;
  font-size: 1.05rem;
  opacity: 0.9;
}

/* ---------- Main content ---------- */

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.25rem 0.5rem;
}

/* "Explore the Teachings" and the line under it */
.section-heading {
  text-align: center;
  margin-bottom: 1.5rem;
}

.section-heading h2 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
}

.section-sub {
  margin: 0;
  color: var(--muted);
}

/* A short gold line under the section heading */
.section-heading::after {
  content: "";
  display: block;
  width: 40px;
  height: 1px;
  margin: 1.1rem auto 0;
  background: var(--gold);
}

/* "Loading…" and error messages */
.status {
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

/* The welcome box shown before any recordings are added */
.library-empty {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2rem 1.5rem;
  text-align: center;
}

.library-empty h3 {
  margin: 0 0 0.6rem;
  font-size: 1.45rem;
  color: var(--navy);
}

.library-empty p {
  margin: 0 auto;
  max-width: 30rem;
}

.library-empty .empty-note {
  margin-top: 1.25rem;
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold-text);
}

/* A short gold line above "The collection is being assembled." */
.empty-note::before {
  content: "";
  display: block;
  width: 40px;
  height: 1px;
  margin: 0 auto 1.1rem;
  background: var(--gold);
}

/* The list of lessons: remove the default bullets and indent */
.lesson-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Each lesson is a white card */
.lesson {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem 1.4rem;
  margin-bottom: 1rem;
}

.lesson h3 {
  margin: 0 0 0.3rem;
  font-size: 1.3rem;
  color: var(--navy);
}

/* The date and topic under each title */
.lesson-meta {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: var(--gold-text);
}

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

/* The audio player stretches to the card's full width (good on phones) */
.lesson audio {
  display: block;
  width: 100%;
  margin-top: 0.9rem;
}

/* ---------- Footer ---------- */

.site-footer {
  max-width: 760px;
  margin: 1.5rem auto 0;
  padding: 1.25rem 1rem 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.site-footer p {
  margin: 0 0 0.3rem;
}

.site-footer a,
.lesson-copyright a,
.back-link a {
  color: var(--navy);
}

/* ---------- Copyright ---------- */

/* The small copyright line at the bottom of each lesson card */
.lesson .lesson-copyright {
  margin: 0.9rem 0 0;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--muted);
}

/* The Copyright and Usage Policy page */
.page-title {
  font-size: 1.9rem;
}

.policy {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem 1.4rem;
}

.policy h2 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.4rem;
}

.policy p {
  margin: 0 0 0.75rem;
}

.policy .policy-copyright {
  margin: 1.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--muted);
}

.back-link {
  text-align: center;
}

/* On wider screens, make the headings a bit bigger and add breathing room */
@media (min-width: 600px) {
  .site-header {
    padding: 1.25rem 2rem 2.75rem;
  }

  h1 {
    font-size: 2.8rem;
  }

  .page-title {
    font-size: 2.3rem;
  }

  .tagline {
    font-size: 1.45rem;
  }

  .section-heading h2 {
    font-size: 2rem;
  }

  .library-empty {
    padding: 2.5rem 2rem;
  }
}

/* ---------- Admin pages ---------- */

.site-header a {
  color: #fff;
}

.admin-box {
  background: #fff;
  border: 1px solid #e3ddd0;
  border-radius: 8px;
  padding: 1.25rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Center the green/red messages above the boxes */
main > .form-success,
main > .form-error {
  max-width: 600px;
  margin: 0 auto 1rem;
}

.admin-box h2 {
  margin-top: 0;
}

.admin-box label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.25rem;
}

/* Big, easy-to-tap fields and buttons (good on phones) */
.admin-box input,
.admin-box textarea {
  font-family: inherit;
  display: block;
  width: 100%;
  padding: 0.6rem;
  font-size: 1rem;
  border: 1px solid #bbb;
  border-radius: 6px;
  margin-bottom: 1rem;
}

button {
  font-family: inherit; /* use the page's font, not the browser's default */
  font-size: 1rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  background: #1f3a5f;
  color: #fff;
  cursor: pointer;
}

button:hover {
  background: #2c4f7c;
}

.button-secondary {
  background: #777;
}

.form-error {
  color: #a11;
  font-weight: bold;
}

.form-success {
  color: #176b2c;
  font-weight: bold;
}

button:disabled {
  background: #999;
  cursor: wait;
}

/* Space between the admin boxes */
.admin-box + .admin-box {
  margin-top: 1rem;
}

/* Delete buttons are red so they stand out as dangerous */
.button-danger {
  background: #a11;
  border: 1px solid #a11;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.button-danger:hover {
  background: #c22;
}

/* A link that looks like a small button (the "Edit" link) */
.button-link {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  line-height: 1.4;
  border: 1px solid #1f3a5f;
  border-radius: 6px;
  color: #1f3a5f;
  text-decoration: none;
}

/* "Save changes" and "Cancel" side by side */
.form-buttons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* The "All lessons" list on the admin page */
.admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-list li {
  display: flex;
  flex-wrap: wrap; /* on phones, the buttons drop below the title */
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
  border-top: 1px solid #eee;
}

.admin-list-text .lesson-meta {
  margin-right: 0.5rem;
}

.admin-list-buttons {
  display: flex;
  gap: 0.5rem;
}

.admin-list-buttons form {
  margin: 0;
}

/* The box under the form with the "see lessons" link and Log out */
.admin-footer {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.admin-footer p {
  margin: 0;
}

