/* Announcements section (home + blog card-grid) — brand palette
   (2026-05-08). Dropdown chrome flips from dark/red to white/mint;
   "View all" button moves to ghost-green outline. The category
   tone-tags (offer/advices/news/cases) are kept as semantic markers
   tied to category enums in `app/Enums/AnnouncementCategory.php` —
   only the empty-state and "advices" blue tone shift to readable
   neighbors; offers stay red because OFFERS is intrinsically a
   warning/promo signal that CSS shouldn't soften. */

.announcements-section {
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px;
}

.announcements-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.announcements-title {
  font-size: 24px;
  flex: 1 1 auto;
  color: #FFFFFF;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.announcements-title span {
  font-weight: 700;
}

.announcements-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 12px;
  position: relative;
}

.announcements-dropdown {
  position: relative;
  width: 220px;
  user-select: none;
}

/* Closed-state dropdown button — restyled to match the
   `.announcements-view-all` ghost-pill so the two filter controls
   ("All Categories" and "View All") visually pair on the row.
   White text on transparent button stands out against the body
   gradient via a soft dark text-shadow. WHITE border keeps the
   pair-feel consistent. */
.announcements-dropdown__button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  background: transparent;
  border: 2px solid var(--brand-orange);
  border-radius: 999px;
  cursor: pointer;
  appearance: none;
  text-align: left;
}

.announcements-dropdown__button:focus-visible {
  outline: 2px solid var(--brand-orange);
  outline-offset: 2px;
}

.announcements-dropdown__arrow {
  width: 20px;
  height: 20px;
  color: #FFFFFF;
  /* The chevron is rendered as <img src="arrow.webp"> (a raster). The
     filter chain inverts the source PNG to white so it pairs with the
     white button label, plus a soft drop-shadow for legibility on the
     charcoal page background. */
  filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.30));
  transition: transform 0.3s;
}

.announcements-dropdown.open .announcements-dropdown__arrow {
  transform: rotate(180deg);
}

.announcements-dropdown__options {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  background: #FFFFFF;
  border: 1px solid #E8EAEE;
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.10);
  padding: 6px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
  z-index: 100;
}

.announcements-dropdown.open .announcements-dropdown__options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.announcements-dropdown__option {
  display: block;
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  padding: 10px 16px;
  font: inherit;
  line-height: 1.2;
  font-weight: 500;
  color: #1A1A1A;
  cursor: pointer;
  appearance: none;
}

.announcements-dropdown__option + .announcements-dropdown__option {
  margin-top: 4px;
}

.announcements-dropdown__option:hover,
.announcements-dropdown__option:focus-visible {
  background: rgba(199, 85, 40, 0.10);
  color: #A6411E;
}

.announcements-dropdown__option:focus-visible {
  outline: none;
}

.announcements-dropdown__option[aria-selected="true"] {
  background: rgba(199, 85, 40, 0.18);   /* soft terracotta tint — less
                                            aggressive than solid orange,
                                            reads as a highlight rather
                                            than a stamp. */
  color: #A6411E;
  font-weight: 700;
}

/* Selectors include :link / :visited explicitly because the site-wide
   reset in header.css declares `a, a:visited { color: inherit }`.
   `a:visited` carries specificity (0,1,1) which OUTRANKS the bare
   class selector (0,1,0) — so on a previously-visited /blog link the
   global :inherit rule was winning and the button text rendered in
   the body's --color-text (#1A1A1A) instead of white. Adding both
   :link and :visited here bumps our specificity to (0,2,1), which
   beats the global rule on every visit state. */
.announcements-view-all,
.announcements-view-all:link,
.announcements-view-all:visited {
  padding: 10px 20px;
  font-size: 16px;
  font-weight: 700;
  border: 2px solid var(--brand-orange);
  border-radius: 999px;
  color: #FFFFFF;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  background: transparent;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.announcements-view-all:hover,
.announcements-view-all:focus {
  background: rgba(199, 85, 40, 0.10);
  color: #FFFFFF;
}

.announcements-posts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}

@media (min-width: 600px) {
  .announcements-posts {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Reusable card skin — used for announcements block AND blog card grids.
   Cards stand on the mint body as elevated white-on-image artifacts;
   the image fills the card, an opaque-bottom gradient overlays it for
   text legibility. */
.announcements-skin .offer-card {
  width: 100%;
  height: 320px;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.10);
  transition: opacity 0.3s, transform 0.2s, box-shadow 0.2s;
  opacity: 0;
  display: none;
}

.announcements-skin .offer-card.visible {
  display: block;
  opacity: 1;
}

.announcements-skin .offer-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

.announcements-skin .offer-card__media-link {
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.announcements-skin .offer-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.announcements-skin .card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.10));
  border-radius: 12px;
  z-index: 1;
}

.announcements-skin .card-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.announcements-skin .card-bottom {
  margin-bottom: 20px;
}

/* Tone tags — kept semantic. Each maps to a category enum value in
   `app/Enums/AnnouncementCategory.php` and intentionally carries a
   distinct hue so users can scan the grid by color. We DON'T flatten
   them all to brand-green — that would erase the affordance. */
.announcements-skin .offer-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.announcements-skin .offer-tag.tone-red,
.announcements-skin .offer-tag.OFFERS,
.announcements-skin .offer-tag--offers {
  background: #b71c1c;
  color: #fff;
}

.announcements-skin .offer-tag.tone-dark,
.announcements-skin .offer-tag.ADVICES,
.announcements-skin .offer-tag--advices {
  background: #2a3eb1;
  color: #fff;
}

.announcements-skin .offer-tag.tone-light,
.announcements-skin .offer-tag.NEWS,
.announcements-skin .offer-tag--news {
  background: #f5c542;
  color: #1A1A1A;
}

.announcements-skin .offer-tag.tone-blue,
.announcements-skin .offer-tag--updates {
  background: #0b63bb;
  color: #fff;
}

.announcements-skin .offer-tag--residential-cases {
  background: #21A038;
  color: #fff;
}

.announcements-skin .offer-tag--automotive-cases {
  background: #0b63bb;
  color: #fff;
}

.announcements-skin .offer-tag--commercial-cases {
  background: #b8871b;
  color: #1A1A1A;
}

.announcements-skin .offer-tag--cleaning-cases {
  background: #0f7a67;
  color: #fff;
}

.announcements-skin .offer-date {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 10px;
}

.announcements-skin .offer-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: #FFFFFF;
}

.announcements-skin .explore-link {
  color: var(--brand-orange);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(199, 85, 40, 0.55);
  font-size: 14px;
}

.announcements-empty-card {
  grid-column: 1 / -1;
  border: 1px dashed #21A038;
  border-radius: 12px;
  padding: 18px;
  color: #1A1A1A;
  background: #FFFFFF;
}

.announcements-empty-card p {
  margin: 0;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .announcements-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .announcements-controls {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
  }

  .announcements-dropdown {
    width: 100%;
  }

  .announcements-view-all.announcements-view-all--mobile {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 16px;
  }

  .announcements-view-all.announcements-view-all--desktop {
    display: none;
  }
}

@media (min-width: 601px) {
  .announcements-view-all.announcements-view-all--mobile {
    display: none;
  }

  .announcements-view-all.announcements-view-all--desktop {
    display: inline-block;
  }
}
