/* ==========================================================================
   Outwest FM Theme — component sizes and spacing
   --------------------------------------------------------------------------
   The base theme (apebox_theme) lays everything out on a terminal grid: a
   1.5rem text row (--row), character-cell paddings (ch), boxed panels with
   the title on the border, and a 1.5 line height everywhere. This file puts
   the same components on the Arizto site's metrics instead: rem spacing
   steps, single-spaced UI text, plain titled blocks.

   The inherited line height stays at 1.5 so unstyled text (descriptions,
   details, lists) remains readable; the components below that the Arizto
   site single-spaces set line-height: var(--leading-none) themselves.

   Only sizes, spacing and structure are set here. Colours come from the
   tokens (tokens.css); selectors mirror the base theme's so these rules win
   by load order, not specificity.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. Base
   --------------------------------------------------------------------------- */
/* Headings keep their top margin even as the first child (the base theme
   removes it). */
h1:first-child,
h2:first-child,
h3:first-child,
h4:first-child,
h5:first-child,
h6:first-child {
  margin-top: var(--space-sm);
}

.node__content :where(ul, ol) {
  font-size: var(--font-size-body);
  line-height: var(--leading-normal);
  margin-block: var(--space-lg);
  padding-inline-start: var(--space-xl);
}

/* ---------------------------------------------------------------------------
   2. Page layout
   --------------------------------------------------------------------------- */
/* Header and footer bands follow the content cap instead of running full
   bleed. */
.site-header .container,
.site-footer .container {
  max-width: var(--max-page-width);
  margin-left: auto;
  margin-right: auto;
}

.site-header {
  line-height: var(--leading-none);
}

.site-header .container {
  gap: 0;
}

/* Main column + first sidebar: the sidebar takes a share of the width
   (30%, then 20% on wide screens) and the divider sits flush between them. */
.layout-content {
  gap: 0;
  max-width: var(--max-page-width);
  margin: 0 auto;
  /* minmax(0, …) stops a wide table from stretching the column past the
     viewport on small screens. */
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 60em) {
  body.layout-sidebar-first .layout-content {
    grid-template-columns: 30% minmax(0, 1fr);
  }

  .layout-content .layout-sidebar-first {
    padding-right: 0;
  }

  body.layout-sidebar-first #lock_main_content {
    padding-left: 1em;
  }
}

@media (min-width: 68.75em) {
  body.layout-sidebar-first .layout-content {
    grid-template-columns: 20% minmax(0, 1fr);
  }
}

/* The base theme adds the sidebar class whenever the region is configured,
   even if its blocks render nothing (anonymous visitors see no menus).
   Give the main column the full width in that case. */
body.layout-sidebar-first:not(:has(.layout-sidebar-first .block)) #lock_main_left {
  display: none;
}

@media (min-width: 60em) {
  body.layout-sidebar-first:not(:has(.layout-sidebar-first .block)) .layout-content {
    grid-template-columns: minmax(0, 1fr);
  }

  body.layout-sidebar-first:not(:has(.layout-sidebar-first .block)) #lock_main_content {
    padding-left: 0;
  }
}

.region-sidebar-first,
.region-sidebar-second {
  padding: var(--space-sm);
}

.layout-content .region-content > .container {
  padding-top: var(--space-md);
  padding-bottom: var(--space-xxl);
}

/* The base theme draws a separator under the hero region. With the video
   hero that region has no height of its own and is centred in the hero
   frame, so the line would cut across the footage. */
.region-hero {
  border-bottom: 0;
}

/* Bands that have no spacing of their own now that .container has no
   vertical padding. */
.region-highlighted > .container,
.region-help > .container {
  padding-top: var(--space-md);
}

.site-navigation .container {
  padding-top: var(--space-xs);
  padding-bottom: var(--space-xs);
}

.region-content-grid,
.region-discover-more {
  padding-top: var(--space-md);
  padding-bottom: var(--space-md);
}

.region-help .container > div {
  padding: var(--space-sm) var(--space-md);
}

/* ---------------------------------------------------------------------------
   3. Block titles
   --------------------------------------------------------------------------- */
.block-title {
  margin: var(--space-sm) 0 var(--space-md);
  font-size: var(--font-size-xl);
}

/* ---------------------------------------------------------------------------
   4. Header menus
   --------------------------------------------------------------------------- */
.region-header nav.block-menu.navigation ul.menu {
  gap: 0;
}

.region-header nav.block-menu.navigation a {
  padding: var(--space-xs);
  border-bottom: 2px solid transparent;
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  color: var(--color-text-primary);
}

@media (min-width: 42.5em) {
  .region-header nav.block-menu.navigation a {
    font-size: var(--font-size-md);
  }
}

.region-header nav.block-menu.navigation a:hover,
.region-header nav.block-menu.navigation a:focus,
.region-header nav.block-menu.navigation a.is-active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  text-decoration: none;
}

.site-header .block-darkmode-toggle {
  padding: 0 var(--space-md);
  text-transform: uppercase;
}

/* Buttons do not inherit text-transform by default. */
.site-header .block-darkmode-toggle button {
  text-transform: inherit;
}

/* ---------------------------------------------------------------------------
   5. Sidebar and footer blocks
   --------------------------------------------------------------------------- */
/* Plain titled blocks instead of the base theme's framed panels. */
.layout-content .layout-sidebar-first .block,
.layout-content .layout-sidebar-second .block,
.site-footer .region-footer .block {
  position: static;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.layout-content .layout-sidebar-first .block:not(:last-child),
.layout-content .layout-sidebar-second .block:not(:last-child) {
  margin-bottom: var(--space-xl);
}

/* The title returns to the flow as a normal h2. */
.layout-content .layout-sidebar-first .block > h2,
.layout-content .layout-sidebar-second .block > h2,
.site-footer .region-footer .block > h2 {
  position: static;
  margin: var(--space-sm) 0 var(--space-md);
  padding: 0;
  background: none;
  font-size: var(--font-size-xl);
  line-height: var(--leading-none);
  color: var(--color-text-primary);
  max-width: none;
  overflow: visible;
  white-space: normal;
}

/* Menu links: upper-case rows with an even inset, highlighted by colour. */
.layout-content .layout-sidebar-first nav.block-menu ul.menu a,
.layout-content .layout-sidebar-second nav.block-menu ul.menu a {
  padding: var(--space-xs);
  border-radius: 0;
  font-size: var(--font-size-md);
  line-height: var(--leading-none);
  text-transform: uppercase;
  color: var(--color-text-primary);
}

.layout-content .layout-sidebar-first nav.block-menu ul.menu a:hover,
.layout-content .layout-sidebar-first nav.block-menu ul.menu a:focus,
.layout-content .layout-sidebar-first nav.block-menu ul.menu a.is-active,
.layout-content .layout-sidebar-second nav.block-menu ul.menu a:hover,
.layout-content .layout-sidebar-second nav.block-menu ul.menu a:focus,
.layout-content .layout-sidebar-second nav.block-menu ul.menu a.is-active {
  background: none;
  color: var(--color-primary);
}

.site-footer {
  margin-top: var(--space-xl);
  padding: var(--space-xl) 0;
}

.site-footer .block ul.menu {
  margin-top: var(--space-lg);
}

.site-footer .block ul.menu a {
  padding: var(--space-xs);
  font-size: var(--font-size-md);
  line-height: var(--leading-none);
  text-transform: uppercase;
  color: var(--color-text-primary);
}

.site-footer .region-footer-bottom > .container {
  padding-top: var(--space-lg);
  padding-bottom: var(--space-lg);
}

/* ---------------------------------------------------------------------------
   6. Breadcrumb
   --------------------------------------------------------------------------- */
.breadcrumb__list,
.breadcrumb ol {
  padding: 1.5em 0;
}

.region-breadcrumb li {
  font-size: var(--font-size-md);
  font-weight: 600;
  line-height: var(--leading-none);
  text-transform: uppercase;
}

/* ---------------------------------------------------------------------------
   7. Tabs, local actions, status messages
   --------------------------------------------------------------------------- */
.block-local-tasks-block {
  padding-bottom: var(--space-sm);
}

.block-local-tasks-block a {
  padding: var(--space-xs) var(--space-md);
  border: 2px solid transparent;
  font-size: var(--font-size-md);
  font-weight: 400;
  line-height: var(--leading-none);
  background-color: transparent;
}

.local-actions {
  gap: var(--space-xs);
  margin: 0 0 var(--space-md);
}

[data-drupal-messages] {
  margin-bottom: var(--space-md);
}

/* An edge bar instead of the base theme's full frame. */
.messages {
  margin: 0 0 var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-width: 0 0 0 4px;
  font-size: var(--font-size-lg);
  font-weight: 600;
  line-height: var(--leading-tight);
}

/* ---------------------------------------------------------------------------
   8. Forms
   --------------------------------------------------------------------------- */
.form-item {
  margin-bottom: var(--space-md);
}

/* The field box holds a small label above the value. */
.form-item-container {
  margin-top: 0;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-lg);
  line-height: var(--leading-none);
}

/* The label sits inside the box again (the base theme lifts it onto the
   border line like a fieldset legend). */
.form-item:not(.form-type-checkbox):not(.form-type-radio) .form-item-container > label {
  position: static;
  display: inline-block;
  margin: 0 0 0.0625rem;
  padding: 0;
  background: none;
  font-size: var(--font-size-sm);
  line-height: var(--leading-none);
  max-width: 100%;
  overflow: visible;
  white-space: normal;
}

input,
select,
textarea {
  line-height: 1.25rem;
}

.form-select,
select {
  -webkit-appearance: none;
  font-size: var(--font-size-md);
}

textarea,
.form-textarea {
  min-height: 6.5625rem;
}

.form-item.form-type-checkbox,
.form-item.form-type-radio {
  margin-bottom: var(--space-xxs);
}

.form-item.form-type-checkbox .form-item-container input,
.form-item.form-type-radio .form-item-container input {
  border-radius: var(--radius-md);
}

.form-type-managed-file .form-item-container input[type="file"]::file-selector-button {
  padding: var(--space-sm) var(--space-lg);
  border-radius: 0.5rem;
}

.vertical-tabs__pane {
  padding: var(--space-md);
}

dialog {
  padding: var(--space-xl);
  border-radius: 1.5rem;
}

/* ---------------------------------------------------------------------------
   9. Buttons
   --------------------------------------------------------------------------- */
/* Padding comes from --button-padding-* (tokens.css). */
.button,
button,
.btn,
input[type="submit"],
input[type="button"],
input[type="reset"] {
  font-weight: 600;
  border-radius: var(--radius-md);
}

.button--small,
.btn-sm {
  height: 2rem;
  padding: 0 var(--space-lg);
}

.button--large,
.btn-lg {
  height: 3rem;
  padding: 0 var(--space-xxl);
}

.button--icon,
.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
}

.button--icon.button--small,
.btn-icon.btn-sm {
  width: 2rem;
  height: 2rem;
}

.button--icon.button--large,
.btn-icon.btn-lg {
  width: 3rem;
  height: 3rem;
}

.button--transparent,
.btn-transparent {
  border-width: 2px;
}

.button-group--attached .button:first-child,
.button-group--attached .btn:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.button-group--attached .button:last-child,
.button-group--attached .btn:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* ---------------------------------------------------------------------------
   10. Tables
   --------------------------------------------------------------------------- */
table {
  border-radius: var(--radius-md);
}

th,
td {
  border: 1px dotted var(--color-border-light);
  line-height: var(--leading-none);
}

th {
  padding: var(--space-sm) var(--space-lg);
}

td {
  padding: var(--space-xs) var(--space-sm);
}

td:first-child,
th:first-child,
tfoot td {
  font-weight: 600;
}

tfoot td {
  padding: var(--space-lg) var(--space-xl);
}

table.table--compact th,
table.table--compact td {
  padding: var(--space-sm) var(--space-md);
}

td.table__actions .button,
td.table__actions .btn {
  margin-left: var(--space-xs);
}

.table__status {
  padding: var(--space-xxs) var(--space-sm);
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.table__empty {
  padding: var(--space-xxl);
}

th.sortable {
  padding-right: var(--space-xxl);
}

th.sortable::after {
  right: var(--space-md);
}

.dropbutton-wrapper.open .dropbutton-widget {
  border-radius: var(--radius-md);
}

/* ---------------------------------------------------------------------------
   11. Pager
   --------------------------------------------------------------------------- */
.pager__items,
.pagination {
  justify-content: flex-start;
  gap: var(--space-xs);
  margin: var(--space-md) 0;
  border-radius: var(--space-sm);
}

.pager__items .pager__item > a,
.pagination .pager__item > a,
.pager__items .pager__item > .pager__item--ellipsis,
.pagination .pager__item > .pager__item--ellipsis,
.pager__items .page-link,
.pagination .page-link {
  padding: var(--space-sm) var(--space-md);
  border-radius: 0.5rem;
}

/* ---------------------------------------------------------------------------
   12. Accordion and off-canvas panel
   --------------------------------------------------------------------------- */
.accordion-title {
  font-weight: 600;
}

.accordion-trigger {
  padding: var(--space-lg);
}

.accordion-chevron {
  margin-left: var(--space-md);
}

.accordion-body {
  padding: var(--space-lg);
  font-size: var(--font-size-body);
}

.offcanvas-content {
  padding: var(--space-lg);
}

.offcanvas-close {
  top: 12px;
  right: 12px;
}
