@charset "UTF-8";
/* ===========================================================================
   Orlando Chess Club, responsive layer

   The base stylesheet is written fluid-first (clamp, min(), auto-fit grids),
   so this file only handles the structural changes that fluid sizing can't:
   the mobile navigation drawer, table-to-card conversions, and the few
   layouts that need to reorder rather than reflow.

   Breakpoints
     1080px  desktop layout -> condensed
      900px  side-by-side layouts stack; nav becomes a drawer
      620px  small phones: tables become cards, tighter spacing
   ======================================================================== */


/* ===========================================================================
   ≤ 1080px, condensed desktop / large tablet
   ======================================================================== */

@media (max-width: 1080px) {

  .detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-sidebar {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  }

  .hero__grid {
    gap: var(--space-xl);
  }

  .site-footer__top {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-xl);
  }

  .nav__link {
    padding-inline: .6rem;
    font-size: .875rem;
  }
}


/* ===========================================================================
   ≤ 900px, tablet & mobile: drawer nav, stacked layouts
   ======================================================================== */

@media (max-width: 900px) {

  :root {
    --space-2xl: 3.25rem;
    --space-3xl: 4.5rem;
    --space-top: 2rem;
  }

  /* --- Navigation becomes a slide-down drawer --- */

  .nav-toggle { display: grid; }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    z-index: 95;
    display: grid;
    align-content: start;
    gap: var(--space-md);
    max-height: calc(100dvh - var(--header-h));
    padding: var(--space-md) var(--page-pad) var(--space-lg);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    overscroll-behavior: contain;

    /* Hidden by default, revealed by .is-open */
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition:
      opacity var(--dur) var(--ease),
      transform var(--dur) var(--ease-out),
      visibility 0s linear var(--dur);
  }

  .nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0s;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: .15rem;
  }

  .nav__link {
    padding: .85rem 1rem;
    border-radius: var(--radius);
    font-size: 1.0625rem;
    font-weight: 600;
  }

  .nav__link.is-active {
    background: var(--accent-soft);
    color: var(--accent);
  }

  /* The underline marker reads as clutter in a vertical list */
  .nav__link.is-active::after { display: none; }

  .nav__cta {
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border);
  }

  .nav__cta .btn {
    width: 100%;
    padding-block: .85rem;
    font-size: 1rem;
  }

  /* Lock the page behind the open drawer */
  body.nav-open { overflow: hidden; }

  /* --- Layout --- */

  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-xl);
  }

  /* The headline leads on mobile, the board is decorative and follows it,
     so the first screenful is the message and the calls to action. */
  .hero__visual { order: 1; }

  .board {
    --board-size: min(100%, 320px);
    transform: none;
  }

  /* Floating chips overlap awkwardly at this width */
  .hero__chip { display: none; }

  .split { gap: var(--space-xl); }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  /* --- Podium: rank order top to bottom, no staggered heights --- */

  .podium {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-sm);
  }

  .podium__slot,
  .podium__slot--1,
  .podium__slot--2,
  .podium__slot--3 {
    order: 0;
    margin-top: 0;
    grid-template-columns: auto auto minmax(0, 1fr);
    justify-items: start;
    align-items: center;
    text-align: left;
    padding: var(--space-md);
    display: grid;
    gap: var(--space-md);
  }

  .podium__slot--1 { order: -1; }

  .podium__rating {
    margin-left: auto;
    font-size: 1.3rem;
  }

  .podium__name { grid-column: auto; }

  /* --- Profile --- */

  .profile-head { gap: var(--space-md); }

  .profile-head__rating {
    margin-left: 0;
    text-align: left;
    width: 100%;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
  }

  /* --- Filters --- */

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar__group {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: .25rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .filter-chip { flex: 0 0 auto; }

  .search-field { margin-left: 0; }
}


/* ===========================================================================
   ≤ 620px, phones
   ======================================================================== */

@media (max-width: 620px) {

  :root {
    --header-h: 64px;
    --radius-lg: 16px;
    --radius-xl: 20px;
  }

  .brand__tagline { display: none; }
  .brand__name { font-size: 1rem; }

  /* Tap targets stay comfortable */
  .btn { padding: .85rem 1.35rem; }
  .btn-sm { padding: .6rem 1.05rem; }

  .hero__actions .btn,
  .cta-band__actions .btn,
  .page-head__actions .btn { flex: 1 1 100%; }

  .hero__facts { gap: var(--space-sm) var(--space-md); }

  /* --- Rankings table becomes a stack of cards --- */

  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .table-scroll { overflow-x: visible; }

  .table-wrap {
    border: 0;
    background: transparent;
    border-radius: 0;
  }

  .data-table tbody tr {
    position: relative;
    margin-bottom: var(--space-sm);
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
  }

  .data-table tbody tr.is-top { border-color: var(--accent-line); }

  .data-table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: .35rem 0;
    border-bottom: 0;
    text-align: left;
  }

  /* Label each cell from its data-label attribute */
  .data-table tbody td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-family: var(--font-display);
    font-size: var(--fs-tiny);
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .data-table tbody td.num { text-align: right; }

  /* Rank + player promoted to a header row inside the card */
  .data-table tbody td.cell-rank {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: auto;
    padding: 0;
  }

  .data-table tbody td.cell-rank::before { content: "#"; letter-spacing: 0; }

  .data-table tbody td.cell-player {
    padding-bottom: .75rem;
    margin-bottom: .5rem;
    border-bottom: 1px solid var(--border);
    padding-right: 3rem;
  }

  .data-table tbody td.cell-player::before { display: none; }

  /* --- Other tightening --- */

  .stats { grid-template-columns: repeat(2, 1fr); }

  .meet-row {
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--space-sm);
  }

  .meet-row > .badge,
  .meet-row > .meet-row__action {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .event-card__top { flex-direction: column; gap: var(--space-sm); }

  .date-tile {
    flex-direction: row;
    display: flex;
    align-items: baseline;
    gap: .45rem;
    width: fit-content;
    padding: .35rem .7rem;
  }

  .date-tile__day { font-size: 1.15rem; }

  .cta-band__glyph { font-size: 11rem; bottom: -20%; }

  .site-footer__links { grid-template-columns: repeat(2, 1fr); }

  .site-footer__bottom { flex-direction: column; align-items: flex-start; }

  .profile-head__name { font-size: 1.6rem; }

  .player-card__stats { grid-template-columns: repeat(3, 1fr); }

  .prose blockquote { padding-inline: var(--space-md); }
}


/* ===========================================================================
   ≤ 380px, very small phones
   ======================================================================== */

@media (max-width: 380px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .site-footer__links { grid-template-columns: minmax(0, 1fr); }
  .fact-grid { grid-template-columns: minmax(0, 1fr); }
}


/* ===========================================================================
   Pointer & hover capability

   Devices without hover shouldn't keep :hover styles stuck after a tap.
   ======================================================================== */

@media (hover: none) {
  .card--link:hover,
  .meet-row:hover,
  .podium__slot:hover,
  .btn-primary:hover,
  .btn-secondary:hover {
    transform: none;
  }
}


/* ===========================================================================
   Wide screens, let the page breathe rather than stretch
   ======================================================================== */

@media (min-width: 1600px) {
  :root {
    --page-max: 1360px;
    --space-2xl: 5.5rem;
  }
}
