/* CONTAINERS */
.container {
  width: min(100% - 2rem, 1200px);
  margin-inline: auto;
}

.container-fluid {
  width: 100%;
  margin-inline: 0;
  padding-inline: 1rem;
}

.container-narrow {
  width: min(100% - 2rem, 800px);
  margin-inline: auto;
}

.form-narrow {
  max-width: 640px;
}

/* SECTIONS */
.section,
.section-alt,
.section-elevated {
  padding: var(--space-5) var(--space-3);
}

.section {
  background: var(--surface);
  color: var(--on-surface);
}

.section-alt {
  background: var(--surface-container);
  color: var(--on-surface);
}

.section-elevated {
  background: var(--surface-container-high);
  color: var(--on-surface);
  border-radius: 1rem;
  box-shadow: var(--elev-1);
}

/* SECTION RHYTHM */
.section,
.section-alt,
.section-elevated {
  scroll-margin-top: calc(var(--header-height, 64px) + var(--space-3));
}

.section + .section,
.section + .section-alt,
.section + .section-elevated,
.section-alt + .section,
.section-alt + .section-alt,
.section-alt + .section-elevated,
.section-elevated + .section,
.section-elevated + .section-alt,
.section-elevated + .section-elevated {
  margin-top: var(--space-5);
}


@media (min-width: 600px) {
  .section,
  .section-alt,
  .section-elevated {
    padding-block: calc(var(--space-5) * 1.5);
  }

  .section .container,
  .section-alt .container,
  .section-elevated .container {
    width: min(100% - 3rem, 1200px);
  }
}

/* COLUMNS/ROWS */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: -0.75rem;
  margin-right: -0.75rem;
}

[class^="col-"],
[class*=" col-"] {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  flex: 0 0 100%;
  max-width: 100%;
}

@media (min-width: 600px) {
  .col-1  { flex-basis: 8.3333%;  max-width: 8.3333%; }
  .col-2  { flex-basis: 16.6667%; max-width: 16.6667%; }
  .col-3  { flex-basis: 25%;      max-width: 25%; }
  .col-4  { flex-basis: 33.3333%; max-width: 33.3333%; }
  .col-5  { flex-basis: 41.6667%; max-width: 41.6667%; }
  .col-6  { flex-basis: 50%;      max-width: 50%; }
  .col-7  { flex-basis: 58.3333%; max-width: 58.3333%; }
  .col-8  { flex-basis: 66.6667%; max-width: 66.6667%; }
  .col-9  { flex-basis: 75%;      max-width: 75%; }
  .col-10 { flex-basis: 83.3333%; max-width: 83.3333%; }
  .col-11 { flex-basis: 91.6667%; max-width: 91.6667%; }
  .col-12 { flex-basis: 100%;     max-width: 100%; }
}

.row-center  { justify-content: center; }
.row-between { justify-content: space-between; }
.row-around  { justify-content: space-around; }

.row-middle { align-items: center; }
.row-top    { align-items: flex-start; }
.row-bottom { align-items: flex-end; }

@media (min-width: 600px) {
  .col-sm-1  { flex-basis: 8.3333%;  max-width: 8.3333%; }
  .col-sm-2  { flex-basis: 16.6667%; max-width: 16.6667%; }
  .col-sm-3  { flex-basis: 25%;      max-width: 25%; }
  .col-sm-4  { flex-basis: 33.3333%; max-width: 33.3333%; }
  .col-sm-5  { flex-basis: 41.6667%; max-width: 41.6667%; }
  .col-sm-6  { flex-basis: 50%;      max-width: 50%; }
  .col-sm-7  { flex-basis: 58.3333%; max-width: 58.3333%; }
  .col-sm-8  { flex-basis: 66.6667%; max-width: 66.6667%; }
  .col-sm-9  { flex-basis: 75%;      max-width: 75%; }
  .col-sm-10 { flex-basis: 83.3333%; max-width: 83.3333%; }
  .col-sm-11 { flex-basis: 91.6667%; max-width: 91.6667%; }
  .col-sm-12 { flex-basis: 100%;     max-width: 100%; }
}

@media (min-width: 900px) {
  .col-md-1  { flex-basis: 8.3333%;  max-width: 8.3333%; }
  .col-md-2  { flex-basis: 16.6667%; max-width: 16.6667%; }
  .col-md-3  { flex-basis: 25%;      max-width: 25%; }
  .col-md-4  { flex-basis: 33.3333%; max-width: 33.3333%; }
  .col-md-5  { flex-basis: 41.6667%; max-width: 41.6667%; }
  .col-md-6  { flex-basis: 50%;      max-width: 50%; }
  .col-md-7  { flex-basis: 58.3333%; max-width: 58.3333%; }
  .col-md-8  { flex-basis: 66.6667%; max-width: 66.6667%; }
  .col-md-9  { flex-basis: 75%;      max-width: 75%; }
  .col-md-10 { flex-basis: 83.3333%; max-width: 83.3333%; }
  .col-md-11 { flex-basis: 91.6667%; max-width: 91.6667%; }
  .col-md-12 { flex-basis: 100%;     max-width: 100%; }
}

@media (min-width: 1200px) {
  .col-lg-1  { flex-basis: 8.3333%;  max-width: 8.3333%; }
  .col-lg-2  { flex-basis: 16.6667%; max-width: 16.6667%; }
  .col-lg-3  { flex-basis: 25%;      max-width: 25%; }
  .col-lg-4  { flex-basis: 33.3333%; max-width: 33.3333%; }
  .col-lg-5  { flex-basis: 41.6667%; max-width: 41.6667%; }
  .col-lg-6  { flex-basis: 50%;      max-width: 50%; }
  .col-lg-7  { flex-basis: 58.3333%; max-width: 58.3333%; }
  .col-lg-8  { flex-basis: 66.6667%; max-width: 66.6667%; }
  .col-lg-9  { flex-basis: 75%;      max-width: 75%; }
  .col-lg-10 { flex-basis: 83.3333%; max-width: 83.3333%; }
  .col-lg-11 { flex-basis: 91.6667%; max-width: 91.6667%; }
  .col-lg-12 { flex-basis: 100%;     max-width: 100%; }
}

/* GRID */
.card-grid,
.grid {
  gap: var(--space-4);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid {
  display: grid;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

@media (max-width: 600px) {
  .card-grid,
  .grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr !important;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .card-grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* DIVIDER */
.divider {
  width: 100%;
  height: 1px;
  background: var(--outline-variant);
  margin-block: 1rem;
}

/* STACK / CLUSTER */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap, var(--space-3));
}

.stack-lg {
  --stack-gap: 1.25rem;
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--cluster-gap, 0.75rem);
  align-items: center;
}

.cluster-sm {
  --cluster-gap: 0.5rem;
}

/* WRAPPERS */
.layout-with-sidebar {
  display: flex;
  min-height: calc(100vh - 64px);
  width: 100%;
}

@media (min-width: 900px) {
  .layout-with-sidebar main {
    width: 100%;
    padding: 1.5rem 1rem;
  }
}

@media (min-width: 900px) {
  .layout-with-sidebar {
    min-height: 100vh;
  }

  .layout-with-sidebar main.page-content {
    flex: 1 1 auto;
    min-width: 0;
    padding: 1.75rem 2rem;
    margin-left: 260px;
  }
}

/* SIDEBAR */

.site-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  max-width: 100vw;
  background: var(--surface-container-high);
  box-shadow: 4px 0 18px rgba(0,0,0,0.4);
  transform: translateX(-100%);
  transition: transform .3s ease;
  padding: 1.25rem 1.5rem 1.75rem;
  padding-top:var(--header-height,64px);
  z-index: 40;
  overflow-y: auto;
}

.site-sidebar.active {
  transform: translateX(0);
}

@media (min-width: 900px) {
  .site-sidebar {
    transform: translateX(0);
    position: fixed;
  }

  .layout-with-sidebar main.page-content {
    margin-left: 260px;
  }
}

@media (max-width: 899px) {
  .site-sidebar {
    transform: translateX(-100%);
    position: fixed;
  }

  .site-sidebar[data-open="true"] {
    transform: translateX(0);
  }

  .site-sidebar.active {
    transform: translateX(-100%);
  }
}

/* SIDEBAR NAV */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-nav h2 {
  font-size: calc(var(--type-scale-base) * 0.75);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-surface-variant, var(--on-surface));
  margin-bottom: 0.25rem;
}

.sidebar-nav p {
  font-size: calc(var(--type-scale-base) * 0.9);
  color: var(--on-surface-variant, var(--on-surface));
  margin-bottom: 0.75rem;
}

.sidebar-nav .btn.btn-text {
  justify-content: space-between;
  border-radius: 999px;
  padding-block: 0.35rem;
  padding-inline: 0.75rem 0.5rem;
  font-size: calc(var(--type-scale-base) * 0.9);
}

/* SUBMENUS */
.submenu {
  list-style: none;
  margin-top: 0.25rem;
  padding: 0.35rem 0.5rem;
  display: none;
  flex-direction: column;
  gap: 0.15rem;
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--surface-container) 90%, var(--surface) 10%);
  border: 1px solid color-mix(in srgb, var(--outline-variant) 50%, transparent);
  font-size: calc(var(--type-scale-base) * 0.85);
}

.submenu.open {
  display: flex;
}

.submenu a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-inline: 0.5rem;
}

.submenu a::before {
  content: "chevron_right";
  font-family: "Material Symbols Outlined";
  font-size: 18px;
  line-height: 1;
  color: var(--on-surface-variant);
  opacity: 0.9;
}

.submenu a:hover {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.submenu-icon {
  font-size: 16px;
  margin-left: 4px;
  transition: transform .25s ease;
}

.submenu-icon.rotated {
  transform: rotate(90deg);
}


/* MOBILE FIXES */
@media (max-width: 899px) {
  .layout-with-sidebar { display: block; }

  .layout-with-sidebar main.page-content { margin-left: 0; padding: 1rem; }
}

@media (max-width: 600px) {
  .row { margin-left: 0; margin-right: 0; }
  [class^="col-"],
  [class*=" col-"] { padding-left: 0; padding-right: 0; }

  .section,
  .section-alt,
  .section-elevated { padding: var(--space-4) var(--space-3); }
}
