:root {
  --navy: #031e42;
  --maroon: #9e1f20;
  --font-serif: "Playfair Display", Georgia, serif;
  --font-sans: "Jost", system-ui, sans-serif;
  --max-width: 56rem;
  --border: #e5e5e5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: #1a1a1a;
  background: #fff;
  line-height: 1.5;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  color: var(--navy);
  margin: 0 0 0.25em;
}

a {
  color: inherit;
}

/* Header (shared by public and admin pages) */
.site-header {
  background: var(--navy);
}

.site-header .header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.site-header img {
  width: 48px;
  height: 48px;
}

.site-header .site-title {
  font-family: var(--font-serif);
  color: #fff;
  font-size: 1.25rem;
}

.site-header .header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
}

.site-header .header-right a,
.site-header .header-right button {
  color: #fff;
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* Class list cards */
.class-grid {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

@media (min-width: 640px) {
  .class-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.class-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.class-card:hover {
  border-color: var(--navy);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.class-card h2 {
  font-size: 1.25rem;
}

.class-card p {
  margin: 0.25rem 0 0;
  color: #555;
  font-size: 0.9rem;
}

.empty-state {
  color: #737373;
  margin-top: 2rem;
}

/* Class page header (name/teacher + subscribe button) */
.class-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.class-header p {
  margin: 0.25rem 0 0;
  color: #555;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--maroon);
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

/* "This week" update card */
.update-card {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.5rem 2rem;
}

.update-card .date-range {
  color: var(--maroon);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.update-items {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.subject-block {
  border-left: 4px solid var(--navy);
  padding-left: 1rem;
}

.subject-block.border-maroon {
  border-left-color: var(--maroon);
}

.subject-block h3 {
  font-size: 1.1rem;
}

.subject-block .content {
  white-space: pre-line;
  color: #333;
  margin: 0.25rem 0 0;
}

.subject-block img {
  display: block;
  margin-top: 0.75rem;
  max-width: 100%;
  height: auto;
  border-radius: 0.25rem;
}

.subject-block a.item-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--maroon);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: underline;
}

/* Past updates list */
.past-updates {
  margin-top: 3rem;
}

.past-updates ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.past-updates li {
  border-top: 1px solid var(--border);
}

.past-updates li:first-child {
  border-top: none;
}

.past-updates a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  text-decoration: none;
}

.past-updates a:hover {
  color: var(--maroon);
}

.past-updates .date {
  color: #737373;
  font-size: 0.875rem;
}

/* Forms */
.subscribe-form {
  max-width: 24rem;
  margin-top: 2rem;
}

.form-field {
  margin-bottom: 1rem;
}

.form-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid #d4d4d4;
  border-radius: 0.25rem;
  padding: 0.5rem 0.75rem;
  font: inherit;
}

.form-field textarea {
  min-height: 6rem;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: 0.25rem;
  padding: 0.6rem 1.25rem;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
}

.btn-primary:hover {
  background: #052a5c;
}

.btn-outline {
  background: none;
  border: 1px solid var(--maroon);
  color: var(--maroon);
}

.btn-outline:hover {
  background: var(--maroon);
  color: #fff;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.message-error {
  color: var(--maroon);
  background: rgba(158, 31, 32, 0.06);
  border: 1px solid rgba(158, 31, 32, 0.2);
  border-radius: 0.25rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}

.message-success {
  color: var(--navy);
  background: rgba(3, 30, 66, 0.06);
  border: 1px solid rgba(3, 30, 66, 0.15);
  border-radius: 0.25rem;
  padding: 1rem;
}

/* Auth / access gate screens */
.access-gate {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 28rem;
  margin: 0 auto;
  padding: 1.5rem;
}
