/* ============================================================
 * Marketing home page (templates/home.html)
 *
 * Wrapped in @layer base so Tailwind utilities (@layer utilities)
 * win when both apply to the same element. See tailwind.input.css
 * for the layer-order declaration.
 * ============================================================ */

@layer base {
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
  }

  /* ── Header ── */
  header {
    background: var(--color-primary);
    color: #fff;
    padding: 0.4rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
  }
  header h1 { font-size: 1.25rem; font-weight: 600; margin: 0; }
  .header-left-group { display: flex; align-items: center; gap: 1.75rem; }
  .header-logo-link { display: inline-flex; align-items: center; }
  .header-logo { height: 3rem; width: auto; display: block; }
  .header-nav { display: flex; gap: 1.25rem; align-items: center; }
  .header-nav a {
    font-size: 1.09375rem;
    color: var(--color-primary-on-dark);
    text-decoration: none;
  }
  .header-nav a:hover { text-decoration: underline; }
  .header-actions { display: flex; gap: 1.5rem; align-items: center; }
  .header-actions a {
    font-size: 1.09375rem;
    color: var(--color-primary-on-dark);
    text-decoration: none;
  }
  .header-actions a:hover { text-decoration: underline; }
  /* Logout rendered as a POST form (Django 4.1+ no longer accepts GET);
     style the inline button to match the sibling header links. */
  .header-actions .logout-link-form { display: inline; margin: 0; }
  .header-actions .logout-link-button {
    background: none; border: 0; padding: 0; cursor: pointer;
    font-size: 1.09375rem; color: var(--color-primary-on-dark);
    font-family: inherit; line-height: inherit;
  }
  .header-actions .logout-link-button:hover { text-decoration: underline; }
  .header-actions .btn-header {
    background: #fff;
    color: var(--color-primary);
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1.09375rem;
    text-decoration: none;
  }
  .header-actions .btn-header:hover { background: #e8eef4; text-decoration: none; }

  /* ── Layout ── */
  .page-section {
    max-width: 820px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
  }
  .page-section + .page-section {
    padding-top: 0;
  }

  /* ── Hero ── */
  .hero {
    text-align: center;
    padding: 4rem 1.5rem 0.75rem;
    max-width: 820px;
    margin: 0 auto;
  }
  .hero h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.24;
    color: var(--color-text);
    margin-bottom: 1.1875rem;
  }
  .hero p {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    max-width: 640px;
    margin: 0 auto 2rem;
    line-height: 1.65;
  }
  .hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
  }
  .btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    border-radius: 4px;
    font-size: 1.09375rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
  }
  .btn-primary { background: var(--color-primary); color: #fff; }
  .btn-primary:hover { background: var(--color-primary-hover); }
  .btn-secondary-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
  }
  .btn-secondary-outline:hover { background: #e8eef4; }

  /* ── Cards ── */
  .card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 2rem;
    margin-bottom: 0.375rem;
  }
  .card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-text);
  }
  .card p {
    color: #444;
    font-size: 0.97rem;
    line-height: 1.65;
  }

  /* ── How it works steps ── */
  .steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
  }
  .step {
    background: #f8fafc;
    border: 1px solid var(--color-progress-track);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
  }
  .step-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.5rem;
  }
  .step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
  }
  .step h4 {
    font-size: 0.97rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
  }
  .step p {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    line-height: 1.55;
  }

  /* ── Callout box ── */
  .callout {
    background: var(--color-info-bg);
    border-left: 4px solid var(--color-info-text);
    border-radius: 4px;
    padding: 1rem 1.25rem;
    margin-top: 1.25rem;
    font-size: 0.93rem;
    color: var(--color-info-text);
    line-height: 1.6;
    text-align: center;
  }

  /* ── Checklist ── */
  .checklist {
    list-style: none;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
  }
  .checklist li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.97rem;
    color: var(--color-text-dropdown);
  }
  .checklist li::before {
    content: "✓";
    color: var(--color-success);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.05rem;
  }
  .checklist-note {
    margin-top: 0.75rem;
    font-size: 0.88rem;
    color: #777;
    font-style: italic;
  }

  /* ── CTA section ── */
  .cta-section {
    text-align: center;
    padding: 1.5rem 1.5rem 3rem;
    max-width: 820px;
    margin: 0 auto;
  }
  .cta-section h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--color-text);
  }

  /* ── Event two-column table ── */
  .event-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
  }
  .event-table tr + tr .event-label,
  .event-table tr + tr .event-body {
    padding-top: 0.75rem;
  }
  .event-label {
    white-space: nowrap;
    font-weight: 700;
    font-size: 0.97rem;
    color: var(--color-text);
    vertical-align: top;
    padding-right: 1.25rem;
  }
  .event-body {
    font-size: 0.97rem;
    color: #444;
    line-height: 1.65;
    vertical-align: top;
  }

  /* ── Divider ── */
  .section-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    max-width: 820px;
    margin: 0 auto;
  }

  /* ── Footer ── */
  footer {
    background: var(--color-primary);
    color: var(--color-primary-on-dark);
    margin-top: 3rem;
    padding: 2.5rem 1.5rem;
  }
  .footer-inner {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }
  .footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
  .footer-logo-link { display: inline-flex; align-items: center; }
  .footer-logo {
    height: 1.25rem;
    width: auto;
    display: block;
  }
  .footer-tagline {
    font-size: 0.85rem;
    color: #7aaed4;
  }
  .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
  }
  .footer-links a {
    color: var(--color-primary-on-dark);
    text-decoration: none;
    font-size: 0.875rem;
  }
  .footer-links a:hover {
    color: #fff;
    text-decoration: underline;
  }
  .footer-legal {
    font-size: 0.8rem;
    color: #6a9fc0;
    line-height: 1.6;
    border-top: 1px solid #2e5480;
    padding-top: 1rem;
  }

  /* ── Mobile: collapse the public header so it doesn't overflow ── */
  @media (max-width: 768px) {
    header { padding: 0.4rem 0.9rem; }
    .header-logo { height: 2rem; }
    .header-left-group { gap: 0.75rem; }
    .header-nav { display: none; }
    .header-actions { gap: 0.75rem; }
    .header-actions a,
    .header-actions .logout-link-button { font-size: 0.95rem; }
    .header-actions .btn-header {
      padding: 0.35rem 0.7rem;
      font-size: 0.9rem;
      white-space: nowrap;
    }
  }
  @media (max-width: 480px) {
    /* Hide bare "Login" text link; primary CTA button still shown. */
    .header-actions a:not(.btn-header) { display: none; }
  }

  /* ── Mobile: stack event-table label above description ── */
  @media (max-width: 640px) {
    .event-table,
    .event-table tbody,
    .event-table tr,
    .event-table .event-label,
    .event-table .event-body { display: block; width: 100%; }
    .event-table .event-label {
      white-space: normal;
      padding: 0 0 0.25rem 0;
    }
    .event-table .event-body { padding: 0 0 1rem 0; }
    .event-table tr + tr .event-label,
    .event-table tr + tr .event-body { padding-top: 0; }
    .event-table tr + tr {
      border-top: 1px solid var(--color-border);
      padding-top: 1rem;
      margin-top: 1rem;
    }
  }
}
