/* ==========================================================================
   components.css
   Reusable blocks: header, footer, buttons, cards, FAQ, galleries, carousels…
   ========================================================================== */

@layer site {
  .nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
  }

  .nav-links a.nav-link {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    color: #1a1a1a;
  }

  .logo {
    font-weight: 700;
    font-size: 17px;
  }

  .btn {
    display: inline-block;
    background: #1a1a1a;
    color: #f7f7f5;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 13px 24px;
    border: 0;
    cursor: pointer;
  }

  .btn-accent {
    background: #5a5a5a;
    color: #ffffff;
  }

  .chip {
    display: inline-block;
    border: 1px solid #d0d0ce;
    padding: 6px 14px;
    margin: 0 8px 8px 0;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: #f7f7f5;
  }

  .media {
    border: 1px solid #bbbbbb;
    background: #e4e4e2;
    color: #666666;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 12px;
    background-image: linear-gradient(to top right, transparent calc(50% - 0.5px), #cccccc calc(50% - 0.5px), #cccccc calc(50% + 0.5px), transparent calc(50% + 0.5px)), linear-gradient(to bottom right, transparent calc(50% - 0.5px), #cccccc calc(50% - 0.5px), #cccccc calc(50% + 0.5px), transparent calc(50% + 0.5px));
  }

  .media span {
    background: #e4e4e2;
    padding: 2px 8px;
  }

  .faqcols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 64px;
    margin-top: 32px;
  }

  .faq-group {
    margin-bottom: 36px;
  }

  .faq-group .mono {
    display: block;
    color: #5a5a5a;
    margin-bottom: 12px;
  }

  details.faq {
    border-top: 1px solid #d0d0ce;
    padding: 14px 0;
  }

  details.faq summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 15px;
    line-height: 1.35;
  }

  details.faq summary::-webkit-details-marker {
    display: none;
  }

  details.faq summary::after {
    content: "+";
    font-family: var(--mono);
  }

  details.faq[open] summary::after {
    content: "–";
  }

  details.faq p {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.65;
    color: #6a6a6a;
  }

  .footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 84px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    color: #6a6a6a;
  }

  .footer-bar a {
    color: #6a6a6a;
    margin-left: 18px;
  }

  @media (max-width:900px) {
    .cols-2,
    .cols-3,
    .org-split,
    .faqcols {
      grid-template-columns: minmax(0, 1fr);
    }
  }

  .nav-links a.nav-link.is-active {
    border-bottom: 1px solid #1a1a1a;
    padding-bottom: 3px;
  }

  .page-intro {
    padding-top: 72px;
    padding-bottom: 48px;
  }

  .face .name {
    font-size: 15px;
    font-weight: 700;
    margin-top: 10px;
  }

  .face .role {
    display: block;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6a6a6a;
    margin-top: 2px;
  }

  .sub {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #1a1a1a;
    border-top: 1px solid #1a1a1a;
    padding-top: 12px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
  }

  .sub span:last-child {
    color: #6a6a6a;
  }

  @keyframes crs-l {
    from {
      transform: translateX(0);
    }
    to {
      transform: translateX(-50%);
    }
  }

  .brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    flex: none;
  }

  .brand-t {
    font-family: "Maison Neue", "Maison Neue Book", Helvetica, Arial, sans-serif;
    font-size: 7px;
    line-height: 1.2;
    letter-spacing: 0;
    color: #6a6a6a;
    white-space: nowrap;
  }

  .pf-r {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  .pf-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 36px;
  }

  .pf-t {
    cursor: pointer;
    margin: 0 8px 8px 0;
  }

  .pf-t:hover {
    background: #ffffff;
  }

  .pf-grid {
    row-gap: 40px;
  }

  #pf-all:checked ~ .pf-tabs label[for=pf-all] {
    background: #1a1a1a;
    color: #f7f7f5;
    border-color: #1a1a1a;
  }

  #pf-founders:checked ~ .pf-tabs label[for=pf-founders] {
    background: #1a1a1a;
    color: #f7f7f5;
    border-color: #1a1a1a;
  }

  #pf-founders:checked ~ .pf-grid .pf-p:not(.pf-founders) {
    display: none;
  }

  #pf-cofounders:checked ~ .pf-tabs label[for=pf-cofounders] {
    background: #1a1a1a;
    color: #f7f7f5;
    border-color: #1a1a1a;
  }

  #pf-cofounders:checked ~ .pf-grid .pf-p:not(.pf-cofounders) {
    display: none;
  }

  #pf-team:checked ~ .pf-tabs label[for=pf-team] {
    background: #1a1a1a;
    color: #f7f7f5;
    border-color: #1a1a1a;
  }

  #pf-team:checked ~ .pf-grid .pf-p:not(.pf-team) {
    display: none;
  }

  #pf-faculty:checked ~ .pf-tabs label[for=pf-faculty] {
    background: #1a1a1a;
    color: #f7f7f5;
    border-color: #1a1a1a;
  }

  #pf-faculty:checked ~ .pf-grid .pf-p:not(.pf-faculty) {
    display: none;
  }

  #pf-build:checked ~ .pf-tabs label[for=pf-build] {
    background: #1a1a1a;
    color: #f7f7f5;
    border-color: #1a1a1a;
  }

  #pf-build:checked ~ .pf-grid .pf-p:not(.pf-build) {
    display: none;
  }

  #pf-guests:checked ~ .pf-tabs label[for=pf-guests] {
    background: #1a1a1a;
    color: #f7f7f5;
    border-color: #1a1a1a;
  }

  #pf-guests:checked ~ .pf-grid .pf-p:not(.pf-guests) {
    display: none;
  }

  #pf-all:checked ~ .pf-grid .pf-p {
    display: block;
  }

  .nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 59px;
    position: relative;
  }

  body,
  .brand-t {
    font-family: Verdana, Geneva, sans-serif;
  }

  h3,
  h4,
  .card-title,
  .tt,
  .ttl,
  .name,
  .stat .v,
  .step .n,
  .num,
  .tl-d,
  details.faq summary {
    font-family: Verdana, Geneva, sans-serif !important;
  }

  .nav-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
  }

  .nav-burger {
    display: none;
  }

  @media (max-width:900px) {
    .nav-inner {
      display: flex !important;
      justify-content: space-between;
      align-items: center;
      gap: 10px !important;
      min-height: 64px !important;
      padding-top: 8px !important;
      padding-bottom: 8px !important;
    }

    .nav .brand {
      min-width: 0;
    }

    .nav .brand-t {
      white-space: normal !important;
      font-size: 9px !important;
      max-width: 170px;
    }

    .nav .btn {
      margin-left: auto;
      padding: 11px 18px !important;
    }

    .nav-links {
      display: none !important;
    }

    .nav-links a.nav-link {
      display: block !important;
      padding: 15px 0;
      border-top: 1px solid #d0d0ce;
      font-size: 12px !important;
      width: 100%;
    }

    .nav-links a.nav-link:first-child {
      border-top: 0;
    }

    .nav-burger {
      display: flex;
      align-items: center;
      justify-content: center;
      flex: none;
      width: 42px;
      height: 42px;
      border: 1px solid #1a1a1a;
      cursor: pointer;
    }

    .nav-burger span {
      display: block;
      width: 18px;
      height: 2px;
      background: #1a1a1a;
      box-shadow: 0 -6px 0 #1a1a1a, 0 6px 0 #1a1a1a;
    }

    .nav-toggle:checked ~ .container .nav-links {
      display: flex !important;
      flex-direction: column;
      align-items: stretch;
      gap: 0 !important;
      position: absolute;
      left: -20px;
      right: -20px;
      top: 100%;
      background: #f7f7f5;
      border-bottom: 1px solid #d0d0ce;
      padding: 4px 20px 12px;
      justify-self: auto !important;
      box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
    }

    .nav-toggle:checked ~ .container .nav-burger span {
      box-shadow: none;
      transform: rotate(45deg);
    }

    .nav-toggle:checked ~ .container .nav-burger span::after {
      content: "";
      display: block;
      width: 18px;
      height: 2px;
      background: #1a1a1a;
      transform: rotate(90deg);
    }

    /* partner logos: one row filling the whole width on tablets (2 rows of 3 on phones, below) */
    #official-partners .container > div:last-child {
      display: flex !important;
      flex-wrap: nowrap !important;
      justify-content: space-between !important;
      gap: 24px !important;
      width: 100%;
    }

    .footer-bar {
      flex-direction: column;
      align-items: flex-start;
      gap: 12px;
      padding-top: 24px;
      padding-bottom: 24px;
    }

    .footer-bar a {
      margin-left: 0;
      margin-right: 18px;
      display: inline-block;
      margin-top: 6px;
    }

    main h1,
    main h2,
    main h3 {
      max-width: 100%;
    }

    .face .name {
      font-size: 14px !important;
    }
  }

  @media (max-width:600px) {
    #official-partners .container > div:last-child {
      display: grid !important;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      justify-items: center;
      align-items: center;
      gap: 32px 16px !important;
    }
  }

  .nav {
    top: 0;
    z-index: 10;
    background: rgba(247, 247, 245, 0.92);
    position: relative;
    border-bottom: 0;
  }

  main .name,
  main .face .name,
  main .fc .name {
    font-family: "Maison Neue Mono", "Maison Neue Mono Bold", "Maison Neue", ui-monospace, Menlo, Consolas, monospace !important;
    font-weight: 700 !important;
    font-size: 20px !important;
    line-height: 1.25 !important;
  }

  .face {
    border-radius: 14px !important;
    overflow: visible !important;
  }

  .face img {
    border-radius: 14px !important;
  }

  /* Mobile header (every page but the homepage, which has its own in index.css).
     Inside the layer with "site-header" in the selectors: the page files repeat the
     header styles with !important, and only a more specific !important rule in the
     same layer can override them. */
  @media (max-width:900px) {
    /* bar as wide as the text column (20px from the edges) */
    site-header .nav {
      left: 0 !important;
      right: 0 !important;
      margin-left: 20px !important;
      margin-right: 20px !important;
    }

    site-header .nav-burger {
      border: 0 !important;
    }

    /* open menu: same width as the bar, rounded, just below it */
    site-header .nav-inner {
      position: static !important;
    }

    site-header .nav-toggle:checked ~ .container .nav-links {
      left: 0 !important;
      right: 0 !important;
      top: calc(100% + 8px) !important;
      padding: 4px 20px 8px !important;
      background: #ffffff !important;
      border: 0 !important;
      border-radius: 10px !important;
      box-shadow: 0 10px 28px -10px rgba(0, 0, 0, 0.14) !important;
    }

    /* current page: same spacing as the other items, underlined text */
    site-header .nav-links a.nav-link.is-active {
      padding-bottom: 15px !important;
      border-bottom: 0 !important;
      text-decoration: underline !important;
      text-underline-offset: 6px;
    }
  }
}

/* --------------------------------------------------------------------------
   Header & footer (rendered by assets/js/components.js)
   Kept outside the layers on purpose, so they win over the generic
   .nav / .footer-bar rules above (mobile overrides use !important).
   -------------------------------------------------------------------------- */
site-header,
site-footer {
  display: contents;
}

.nav .nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 40px;
  min-height: var(--nav-h, 76px);
  padding-top: var(--nav-pad, 12px);
  padding-bottom: var(--nav-pad, 12px);
}

.nav .brand {
  gap: 6px;
}

.nav .logo {
  display: block;
  flex: none;
  height: var(--logo-h, 40px);
}

.nav .logo img {
  display: block;
  width: auto;
  height: 100%;
}

.nav .brand-t {
  font-size: 10px;
  line-height: 1.2;
}

.nav .nav-links {
  gap: 36px;
  justify-self: center;
}

.nav .nav-links .nav-link {
  font-size: 10px;
}

.nav .btn {
  justify-self: end;
}

/* accent: smaller red call to action */
.nav--accent .btn {
  padding: 12px 26px;
  font-size: 10px;
  background-color: var(--nv-red);
}

/* white: opaque white bar */
.nav--white {
  background-color: var(--nv-white);
}

/* footer */
.site-footer .brand-name,
.site-footer .footer-bar a.footer-mentor {
  color: #1a1a1a;
}

.site-footer--grey {
  background-color: #f5f5f5;
}

.site-footer--grey .footer-bar {
  color: var(--nv-text-black);
}

.site-footer--grey .brand-name {
  font-weight: 400;
}
