.articles {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 20px 0;
}

/* Grid View Style */
.grid-view .article-item {
  width: calc(25% - 20px); /* Adjust for gaps */
}

/* List View Style */
.list-view .article-item {
  width: 100%;
}

/* Force list view on mobile and hide grid button */
@media (max-width: 1000px) {
  /* Force list view */
  .grid-view .article-item {
    width: 100%;
  }
  
  /* Hide both view toggle buttons on mobile */
  .view-toggle {
    display: none !important;
  }
}

/* Style for the tag and date line */
.article-item .article-meta {
  color: grey; /* Make the tag and date line grey */
  font-size: 14px; /* Adjust the size if needed */
  margin-bottom: 10px; /* Space below the tag/date line */
}

/* Updated style for the title */
.article-item h2 {
  color: #00274d; /* Darker shade of blue for the title */
  margin: 0; /* Remove default margins */
  font-size: 24px; /* Increase font size for larger text */
  font-weight: 400; /* Less bold, but still emphasized */
  line-height: 1.3; /* Adjust line height for readability */
}

/* Remove border and adjust padding for the article item */
.article-item {
  background: #fff;
  padding: 0;
  box-sizing: border-box;
  border: none; /* Remove the border */
}

.article-item a {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.view-toggle {
  margin-bottom: 20px;
}

button {
  cursor: pointer;
}

/* Style for the divider */
.article-divider {
  display: none; /* Hidden by default */
  border: none;
  border-top: 1px solid #ddd; /* Thin grey line */
  margin: 10px 0; /* Space around the divider */
  width: 100%; /* Full width */
}

/* Show the divider for list view */
.list-view .article-divider {
  display: block !important; /* Force visibility in list view */
}
/* --------------------------------

DROPDOWN

-------------------------------- */
/* Style for the dropdowns (select elements) */
#search-filter-form select {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px; /* Rounded corners */
  width: 200px; /* Adjust width if needed */
  background-color: white;
  font-size: 16px;
  appearance: none; /* Hide default dropdown arrow */
  position: relative;
  cursor: pointer;
}

/* Position a wrapper around the select for custom dropdown arrow */
#search-filter-form div {
  position: relative;
  display: inline-block;
}

#search-filter-form div::after {
  content: '▼'; /* Downward pointing triangle */
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  pointer-events: none;
  transition: transform 0.2s ease; /* For smooth animation */
}

/* When select is focused (open), change the triangle to point up */
#search-filter-form select:focus + div::after,
#search-filter-form select:active + div::after {
  content: '▲'; /* Upward pointing triangle */
}

/* Style for the buttons */
#search-filter-form button {
  padding: 10px 15px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 8px; /* Same rounded corners as select */
  cursor: pointer;
  font-size: 16px;
}

#search-filter-form button:hover {
  background-color: #0056b3;
}

/* Ensure consistency in form elements */
#search-filter-form div {
  margin-bottom: 15px;
}

/* Modern press archive refresh */
.press-page {
  display: grid;
  gap: 1.75rem;
}

.press-lede {
  max-width: 720px;
  margin: 0;
  color: var(--color-text-grey);
  font-size: 1.05rem;
}

.press-lede a {
  color: var(--color-accent);
  font-weight: 700;
}

.press-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .78);
  box-shadow: var(--shadow-small);
}

#search-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

#search-filter-form div {
  margin-bottom: 0;
}

#search-filter-form select {
  min-width: 190px;
  width: auto;
  padding: .85rem 2.4rem .85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: .95rem;
}

#search-filter-form div::after {
  content: "\25BE";
  right: .95rem;
  color: var(--color-accent);
}

#search-filter-form select:focus + div::after,
#search-filter-form select:active + div::after {
  content: "\25B4";
}

.view-toggle {
  display: flex;
  gap: .5rem;
  margin-bottom: 0;
}

.view-toggle button,
#search-filter-form button {
  padding: .85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-black);
  color: var(--color-white);
  font-size: .95rem;
  font-weight: 700;
}

.view-toggle button:hover,
#search-filter-form button:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

#list-view-btn {
  display: none;
}

.articles {
  gap: 1rem;
  margin: .5rem 0 0;
}

.grid-view .article-item {
  width: calc(25% - .75rem);
}

.grid-view .article-item.is-pinned {
  width: calc(50% - .5rem);
}

.article-item {
  min-height: 190px;
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: 0 1px 0 rgba(21, 19, 17, .03);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.article-item.is-pinned {
  min-height: 280px;
  padding: 1.4rem;
  overflow: hidden;
  border-color: rgba(182, 109, 45, .34);
  background:
    linear-gradient(135deg, rgba(245, 239, 228, .94), rgba(255, 255, 255, .96) 58%),
    var(--color-surface);
  box-shadow: var(--shadow-small);
}

.article-item:hover {
  border-color: rgba(15, 118, 110, .35);
  box-shadow: var(--shadow-small);
  transform: translateY(-2px);
}

.article-item figure {
  display: grid;
  gap: .85rem;
  height: 100%;
}

.article-item.is-pinned figure {
  grid-template-columns: minmax(0, 1.12fr) minmax(160px, .88fr);
  align-items: stretch;
  gap: 1.25rem;
}

.article-feature-copy {
  display: grid;
  align-content: start;
  gap: .8rem;
}

.article-badge {
  width: max-content;
  padding: .32rem .55rem;
  border: 1px solid rgba(182, 109, 45, .28);
  border-radius: 999px;
  background: rgba(182, 109, 45, .1);
  color: var(--color-accent-2);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}

.article-feature-image {
  min-height: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  background: rgba(21, 19, 17, .06);
}

.article-feature-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
}

.article-item .article-meta {
  margin: 0;
  color: var(--color-accent);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1.35;
  text-transform: uppercase;
}

.article-item h2 {
  color: var(--color-text);
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.18;
}

.article-item.is-pinned h2 {
  max-width: 12ch;
  font-size: clamp(1.65rem, 2.7vw, 2.35rem);
  line-height: 1.04;
}

.article-item .article-summary {
  max-width: 34rem;
  margin: 0;
  color: var(--color-text-grey);
  font-size: .98rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.55;
  text-transform: none;
}

.list-view .article-item {
  min-height: 0;
  width: 100%;
}

.list-view .article-item.is-pinned {
  width: 100%;
}

.list-view .article-item figure {
  grid-template-columns: minmax(150px, 220px) 1fr;
  align-items: start;
}

.list-view .article-item.is-pinned figure {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 320px);
}

.list-view .article-divider {
  border-top-color: var(--color-border);
  margin: .25rem 0;
}

@media (max-width: 1100px) {
  .grid-view .article-item {
    width: calc(50% - .5rem);
  }

  .grid-view .article-item.is-pinned {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .press-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  #search-filter-form,
  #search-filter-form div,
  #search-filter-form select {
    width: 100%;
  }

  .grid-view .article-item,
  .article-item {
    width: 100%;
  }

  .article-item.is-pinned figure,
  .list-view .article-item figure,
  .list-view .article-item.is-pinned figure {
    grid-template-columns: 1fr;
  }

  .article-feature-image {
    order: -1;
  }

  .article-item.is-pinned h2 {
    max-width: none;
  }
}

/* Press archive controls/cards refresh */
.press-toolbar {
  align-items: end;
  gap: 1rem;
  background: rgba(255, 255, 255, .82);
}

.press-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
}

.press-control {
  position: relative;
  display: grid;
  min-width: 190px;
  gap: .34rem;
}

.press-control span {
  color: var(--color-text-grey);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}

#search-filter-form select {
  min-height: 44px;
  width: 100%;
  padding: .72rem 2.35rem .72rem .95rem;
  font-weight: 650;
  line-height: 1.2;
}

#search-filter-form select:focus {
  outline: none;
  border-color: rgba(15, 118, 110, .45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .1);
}

.press-control::after {
  content: "";
  position: absolute;
  right: 1rem;
  bottom: 1.05rem;
  width: .45rem;
  height: .45rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  color: var(--color-accent);
  pointer-events: none;
  transform: rotate(45deg);
}

.view-toggle {
  display: inline-grid;
  grid-auto-flow: column;
  gap: .22rem;
  padding: .24rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.view-toggle #grid-view-btn,
.view-toggle #list-view-btn,
.view-toggle__button {
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--color-text-grey);
  cursor: pointer;
  font-size: 0;
  line-height: 0;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.view-toggle__button::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  color: currentColor;
}

#grid-view-btn::before {
  background:
    linear-gradient(currentColor 0 0) 3px 3px / 5px 5px no-repeat,
    linear-gradient(currentColor 0 0) 10px 3px / 5px 5px no-repeat,
    linear-gradient(currentColor 0 0) 3px 10px / 5px 5px no-repeat,
    linear-gradient(currentColor 0 0) 10px 10px / 5px 5px no-repeat;
}

#list-view-btn::before {
  background:
    linear-gradient(currentColor 0 0) 1px 4px / 16px 2px no-repeat,
    linear-gradient(currentColor 0 0) 1px 8px / 16px 2px no-repeat,
    linear-gradient(currentColor 0 0) 1px 12px / 16px 2px no-repeat;
}

.view-toggle__button:hover,
.view-toggle__button:focus-visible {
  color: var(--color-accent);
  outline: none;
  background: rgba(15, 118, 110, .08);
}

.view-toggle__button[aria-pressed="true"] {
  background: var(--color-black);
  color: var(--color-white);
  box-shadow: 0 8px 20px rgba(21, 19, 17, .12);
}

.press-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.articles {
  align-items: stretch;
}

.article-item {
  min-height: 230px;
}

.article-item figure {
  margin: 0;
}

.article-card-copy,
.article-feature-copy {
  display: grid;
  align-content: start;
  gap: .78rem;
  height: 100%;
}

.article-item:not(.is-pinned) h2 {
  font-size: clamp(1.06rem, 1.15vw, 1.23rem);
}

.article-item .article-summary {
  font-size: .92rem;
  line-height: 1.5;
}

.article-item:not(.is-pinned) .article-summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.article-item.is-pinned .article-summary {
  font-size: .98rem;
  line-height: 1.55;
}

.list-view .article-item {
  padding: 1rem 1.15rem;
}

.list-view .article-item figure {
  grid-template-columns: 1fr;
}

.list-view .article-item:not(.is-pinned) .article-card-copy {
  grid-template-columns: minmax(140px, 210px) minmax(0, 1fr);
  column-gap: 1.3rem;
  row-gap: .45rem;
  align-items: start;
}

.list-view .article-item:not(.is-pinned) .article-meta {
  grid-row: 1 / span 2;
}

.list-view .article-item:not(.is-pinned) .article-summary {
  -webkit-line-clamp: 2;
}

@media (max-width: 1000px) {
  .view-toggle {
    display: none !important;
  }
}

@media (max-width: 760px) {
  .press-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .press-filter-form,
  .press-control,
  #search-filter-form select {
    width: 100%;
  }

  .list-view .article-item:not(.is-pinned) .article-card-copy {
    grid-template-columns: 1fr;
  }

  .list-view .article-item:not(.is-pinned) .article-meta {
    grid-row: auto;
  }
}
