/* Hub Views (Policy Hub, Guide Hub) — Mobile-First */
/* Shared by both hubs: the .policy-hub__* component classes below are a
   reusable hub-layout vocabulary, not Policy-Hub-specific — Guide Hub markup
   reuses them directly (see views-view--guides-hub.html.twig) so both hubs
   stay on one set of rules and one set of JS behavior (policy-hub.js). Only
   the root scope class differs per hub (.policy-hub vs .guides-hub); anywhere
   that distinction matters, both are listed explicitly. This file loads
   sitewide, so new selectors must stay scoped under one of those two roots. */

.policy-hub,
.guides-hub {
  display: block;
  width: 100%;
  max-width: 100%;
}

/* Banner uses .county-document-banner styles from node-county-document.css */

/* Mobile: Filter Toggle Button (visible by default) */
.policy-hub__filter-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #063047;
  color: white;
  border: none;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  transition: background-color 0.2s ease;
  max-width: 100%;
}

.policy-hub__filter-toggle:hover {
  background-color: #0b4558;
}

.policy-hub__filter-toggle-icon {
  font-size: 18px;
  line-height: 1;
}

/* Mobile: Filter Panel (flyout drawer) */
.policy-hub__sidebar {
  position: fixed;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  transition: left 0.3s ease;
  overflow: hidden;
}

.policy-hub__sidebar.is-open {
  left: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Prevent body scroll when sidebar is open */
body.policy-hub-menu-open {
  overflow: hidden;
  height: 100vh;
}

.policy-hub__filters-wrapper {
  background-color: white;
  width: 85%;
  max-width: 320px;
  height: 100%;
  padding: 20px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.policy-hub__close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background-color: transparent;
  border: none;
  font-size: 24px;
  color: #063047;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.policy-hub__close-btn:hover {
  color: #135B64;
}

.policy-hub__filters-wrapper {
  position: relative;
  padding-top: 50px;
}

.policy-hub__filters-wrapper form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.policy-hub__filters-wrapper .views-exposed-form > * {
  margin-bottom: 0;
}

.policy-hub__filters-wrapper .form-item {
  margin-bottom: 16px;
}

.policy-hub__filters-wrapper label {
  display: block;
  font-weight: 600;
  color: #063047;
  margin-bottom: 6px;
  font-size: 14px;
}

.policy-hub__filters-wrapper select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  background-color: white;
  cursor: pointer;
}

.policy-hub__filters-wrapper .form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.policy-hub__filters-wrapper button {
  flex: 1;
  min-width: 100px;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #063047;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.policy-hub__filters-wrapper button[type="submit"] {
  background-color: #135B64;
  color: white;
  border-color: #135B64;
}

.policy-hub__filters-wrapper button[type="submit"]:hover {
  background-color: #0d3f46;
}

.policy-hub__filters-wrapper button[type="reset"] {
  background-color: white;
  color: #063047;
  border-color: #ccc;
}

.policy-hub__filters-wrapper button[type="reset"]:hover {
  background-color: #f5f5f5;
}

/* Mobile: Main Content Area */
.policy-hub__main {
  background-color: white;
  padding: 20px;
  width: 100%;
  margin: 0;
}

.policy-hub__filter-toggle + .policy-hub__sidebar + .policy-hub__main {
  margin-top: 0;
}

.policy-hub__results {
  margin-bottom: 24px;
}

/* Bootstrap grid: restore gutters that sitewide overrides
   (#main .row gutter 0, .row > * padding 0) zero out. */
#main .policy-hub__results .row {
  --bs-gutter-x: 24px;
  --bs-gutter-y: 24px;
}

.policy-hub__results .row > * {
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  margin-top: var(--bs-gutter-y);
}

/* Teaser Card Styling */
.policy-hub__results .views-row article {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 16px;
  background-color: #fafafa;
  height: 100%;
  transition: all 0.2s ease;
}

.policy-hub__results .views-row article:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-color: #135B64;
}

.policy-hub__results h2 {
  margin: 0 0 8px 0;
  font-size: 20px;
  line-height: 1.3;
  color: #063047;
}

.policy-hub__results h2 a {
  color: #135B64;
  text-decoration: none;
}

.policy-hub__results h2 a:hover {
  text-decoration: underline;
}

/* Card description (body summary, or body trimmed per teaser display config) */
.policy-hub__results .field--name-body {
  font-size: 14px;
  color: #444;
  line-height: 1.5;
  margin: 8px 0;
}

/* Read more link: strip nav padding so it left-aligns with card content */
.policy-hub__results .inline__links .nav-link,
.policy-hub__results .links.inline {
  padding: 0;
  margin: 0;
}

/* Document Type label: plain text with teal accent bar (not button-like) */
.policy-hub .field--name-field-doc-type,
.guides-hub .field--name-field-doc-type {
  display: inline-block;
  border-left: 3px solid #135B64;
  padding-left: 8px;
  color: #063047;
  font-size: 13px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.policy-hub__pager {
  text-align: center;
  padding: 20px 0;
}

.policy-hub .view-empty,
.guides-hub .view-empty {
  padding: 40px 20px;
  text-align: center;
  color: #666;
}

/* Tablet (768px and up) */
@media screen and (min-width: 768px) {
  .policy-hub__layout {
    display: grid;
    grid-template-columns: 25% minmax(0, 75%);
    width: 100%;
  }

  .policy-hub__filter-toggle {
    display: none;
  }

  .policy-hub__sidebar {
    position: static;
    width: auto;
    height: auto;
    background-color: transparent;
    z-index: auto;
    left: auto;
    top: auto;
    padding: 0;
    overflow: visible;
  }

  body.policy-hub-menu-open {
    overflow: auto;
    height: auto;
  }

  .policy-hub__close-btn {
    display: none;
  }

  .policy-hub__filters-wrapper {
    width: 100%;
    max-width: none;
    height: auto;
    padding: 30px 20px;
    box-shadow: none;
    background-color: #f8f8f8;
    border-right: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    overflow: visible;
  }

  .policy-hub__main {
    padding: 40px;
    background-color: white;
  }
}

/* Desktop (1024px and up) */
@media screen and (min-width: 1024px) {
  .policy-hub__filters-wrapper {
    padding: 40px 30px;
  }

  .policy-hub__main {
    padding: 50px;
  }
}
