@layer components {
  /* Details + form sit side by side, details shrink to fit content */
  #nights header {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 3rem;
    align-items: flex-end;
    justify-content: center;
    margin-block-start: 2rem;
    padding-block-start: 1.5rem;
    border-top: 1px solid color-mix(in srgb, currentColor 15%, transparent);
  }

  #nights header section:first-child {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  #nights > p {
  	width: 70%;
  	margin-inline: auto;
  }

  /* Venue name */
  #nights header section:first-child h5:first-child {
    font-size: 1.4rem;
    font-weight: 400;
    margin: 0;
    line-height: 1.2;
  }

  #nights header section:first-child h5:first-child strong {
    font-weight: 800;
  }

  /* Date line */
  #nights header section:first-child h5:nth-child(2) {
    font-size: 1.1rem;
    font-weight: 400;
    color: color-mix(in srgb, currentColor 60%, transparent);
    margin: 0;
  }

  #nights header p {
    margin: 0;
    font-size: 1rem;
  }

  /* Form section only as wide as its content */
  #nights #signup {
    flex: 0 0 auto;
    padding-inline: 0;
  }

  /* All fields + button in one horizontal row */
  #nights #signup .form-container {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: nowrap;
  }

  #nights #signup .form-group {
    flex: 0 0 170px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  #nights #signup label {
    font-size: 1rem;
    font-weight: 600;
  }

  #nights #signup input {
    padding: 0.45rem 0.7rem;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
  }

  #nights #signup .submit-btn {
    flex: 0 0 auto;
    align-self: flex-end;
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    width: auto;
    margin: 0;
  }

  /* ===========================
     Speaker-header variant (workshop pages)
     =========================== */

  /* Role/title sits on a second line, smaller and muted */
  #nights header section.has-speaker h5:first-child small {
    display: block;
    font-size: 0.75em;
    font-weight: 400;
    color: color-mix(in srgb, currentColor 60%, transparent);
    margin-top: 0.15em;
  }

  /* Venue line — inherits normal colour, not muted */
  #nights header section.has-speaker h5:nth-child(2) {
    font-size: 1.1rem;
    font-weight: 400;
    color: inherit;
    margin: 0;
  }

  /* Date line — muted, same as other pages */
  #nights header section.has-speaker h5:nth-child(3) {
    font-size: 1.1rem;
    font-weight: 400;
    color: color-mix(in srgb, currentColor 60%, transparent);
    margin: 0;
  }

  /* Toast notification styles now live in components/toast.css (shared,
     loaded site-wide) so any page can use window.wdToast(). */

  @media (max-width: 768px) {
    #nights header {
      flex-direction: column;
      align-items: stretch;
    }

    #nights #signup {
      flex: 1 1 auto;
    }

    #nights #signup .form-container {
      flex-wrap: wrap;
    }

    #nights #signup .form-group {
      flex: 1 1 140px;
    }

    #nights > p {
    	width: 100%;
    	margin-block-end: 2em;
    }
  }
}