/* ==========================================================================
   Accessible color tokens. Every text color below meets WCAG AA (4.5:1 for normal text) on the
   background it is used on. Change a color here and everywhere it is used updates; the dark-mode
   values are set on .dark-mode (the <body> class the theme toggle uses).
   ========================================================================== */
:root {
  --lc-text-muted: #5c5c5c;            /* secondary text such as card dates, on white: 6.7:1 */
  --lc-text-on-tint: #5c5c5c;          /* body text on the pale teal panels (#deeaed): 5.4:1 */
  --lc-nav-link: #e0e0e0;              /* header links on the translucent dark header (#4d4d4d): 6.4:1 */
  --lc-breadcrumb-current: #5f5b6c;    /* current page in a breadcrumb, on white: 6.6:1 */
  --lc-btn-primary-bg: #2c7790;        /* primary button background with white text: 5.1:1 */
  --lc-btn-primary-hover-fg: #236378;  /* primary button text and border on hover (transparent button on the pale panel): 5.5:1 */
}
.dark-mode {
  --lc-text-muted: #bbbbbb;            /* on the dark cards (#1d3038): 7.1:1 */
  --lc-breadcrumb-current: #a9a5b6;    /* on the dark page (#182930): 6.3:1 */
  --lc-btn-primary-hover-fg: #8fcbe0;  /* on the dark panel (#154757): 5.7:1 */
}

/* Where the tokens are used */
.card-date {
  color: var(--lc-text-muted);
}
.section-header .navbar {
  --bs-navbar-color: var(--lc-nav-link);
}
.breadcrumb,
.breadcrumb-style-2,
.section-article-hero-wrapper .breadcrumb {
  --bs-breadcrumb-item-active-color: var(--lc-breadcrumb-current);
}
.btn-primary {
  --bs-btn-bg: var(--lc-btn-primary-bg);
  --bs-btn-border-color: var(--lc-btn-primary-bg);
  --bs-btn-hover-color: var(--lc-btn-primary-hover-fg);
  --bs-btn-active-color: var(--lc-btn-primary-hover-fg);
  --bs-btn-hover-border-color: var(--lc-btn-primary-hover-fg);
  --bs-btn-active-border-color: var(--lc-btn-primary-hover-fg);
  border-color: var(--lc-btn-primary-bg);
}
.btn-primary:hover,
.btn-primary:active {
  border-color: var(--lc-btn-primary-hover-fg);
}
.light-mode .dropdown-text,
.quote,
.quote p {
  color: var(--lc-text-on-tint);
}

/* Navbar */
.section-header.header-1:not(.sticky):not(.no-banner) {
  background: linear-gradient(to bottom, rgba(var(--bs-black-rgb), .8), rgba(var(--bs-black-rgb), 0));
}

.navbar-brand img {
  width: 150px;
  height: 48px;
}

@media (min-width: 768px) {
  .navbar-brand img {
    width: auto;
    height: auto;
  }
}

/* blog hero */
.section-article-hero-wrapper {
  display: flex;
  flex-direction: column;
}
.section-article-hero-wrapper .breadcrumb-card {
  position: static;
  transform: none;
  order: 2;
  width: 100%;
}
.section-article-hero-wrapper .section-article-hero-bg {
  order: 1;
}

@media (min-width: 768px) {
  .section-article-hero-wrapper {
    display: block;
  }
  .section-article-hero-wrapper .breadcrumb-card {
    position: absolute;
    left: 0;
    width: 42%;
    transform: translateY(-50%);
    order: initial;
  }
  .section-article-hero-wrapper .section-article-hero-bg {
    order: initial;
  }
}

/* Hide mini-card slider arrows when there is nothing to scroll (Swiper adds .swiper-button-lock) */
.mini-card-slider .swiper-button-lock {
  display: none;
}

/* The hover "circle" overlay (z-index: 2) sits above the card link and swallows the pointer
   for the 0.75s animation, delaying the pointer cursor and blocking clicks. Let events pass through. */
.image-hover-effect-2::before {
  pointer-events: none;
}

/* "Images" layout of blog/list (display_style 2): one grid, cards in threes (1 large + 2 small).
   Mobile first: one column. From md up: two columns, so there are no gaps in any row. */
.images-grid {
  --images-gap: 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--images-gap);
}
.images-grid .card-style-14 {
  margin-bottom: 0;
  max-width: none;
}
.images-grid .images-item-small .card-image-wrapper {
  height: 300px;
}
.images-grid .images-item-large .card-image-wrapper {
  height: 460px;
}
@media (min-width: 768px) {
  /* large card = 2 rows tall in column 1, the two small cards stack in column 2 */
  .images-grid {
    --images-gap: 3rem;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 300px;
  }
  .images-grid .card-style-14 .card-image-wrapper {
    height: 100%;
  }
  .images-grid .images-item-large {
    grid-column: 1;
    grid-row: span 2;
  }
  .images-grid .images-item-small {
    grid-column: 2;
  }
  /* last row: lone large card -> full width, 2 rows tall (same height as the other large cards) */
  .images-grid .images-item-large:last-child {
    grid-column: 1 / -1;
    grid-row: span 2;
  }
  /* last row: large + one small -> small card spans both rows so the pair is two equal halves */
  .images-grid .images-item-small:last-child:nth-child(3n + 2) {
    grid-column: 2;
    grid-row: span 2;
  }
}

/* .blog-title paints its text with a background-clip gradient, so its visible color comes from
   --bs-link-color (default: dark heading gray), not .text-white. Use the logo's "Malena's" gold. */
.images-grid .blog-title {
  --bs-link-color: #C9A24B;
  --bs-link-color-rgb: 201, 162, 75;
}

/* "Cards" + "Masonry" layout of blog/list: staggered 2-column masonry using CSS columns.
   Images keep their natural aspect ratio so card heights follow image + text. Mobile first: 1 column.
   Note: CSS columns flow top to bottom within each column. */
.cards-masonry {
  column-count: 1;
  column-gap: 2.5rem;
}
.cards-masonry-item {
  break-inside: avoid;
  margin-bottom: 1.25rem;
}
.cards-masonry .card-image-wrapper,
.cards-masonry .card-image-wrapper-style-3 {
  height: auto;
  max-height: none;
}
.cards-masonry .card-img-top {
  height: auto;
}
@media (min-width: 768px) {
  .cards-masonry {
    column-count: 2;
  }
  .cards-masonry-item {
    margin-bottom: 2.5rem;
  }
}

/* "Images" + "Even grid" layout of blog/list: same .images-grid as the masonry, every card the same size (taller than the masonry's small cards). */
.images-grid-even .card-image-wrapper {
  height: 400px;
}
@media (min-width: 768px) {
  .images-grid-even {
    grid-auto-rows: 500px;
  }
  /* odd number of posts: the last card spans the row so there is no empty cell */
  .images-grid-even .images-item-even:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

/* The header is position:absolute, so a breadcrumb at the very top of a page was hidden under it.
   script.js sets --header-height from the real header; 5.5rem is the fallback without JS. */
.section-breadcrumb {
  padding-top: var(--header-height, 5.5rem);
}

/* Blog post: the hero's large top padding only existed to clear the absolute header. When a breadcrumb section sits
   above the hero (it already clears the header), keep just a small gap. */
.section-breadcrumb + .section-article-hero .section-article-hero-wrapper {
  padding-top: 1.25rem;
}

/* 404 page (pages/404): clear the absolute header, then center the logo, message and button. */
.error-page {
  padding: calc(var(--header-height, 5.5rem) + 2.5rem) 0 4rem;
}
.error-page .error-page-logo img {
  width: min(320px, 80vw);
  height: auto;
}
@media (min-width: 768px) {
  .error-page {
    padding-bottom: 7rem;
  }
}

/* "Back to the homepage" button on the 404 page, shaped like the door hanger in the logo icon: a gold pill with a hole
   punched near the top. Proportions are copied from the logo SVG (a 16 x 30 pill, corner radius 7.5, hole radius 2.7
   centered 7 down), scaled by --u (one logo unit). The pill is a ::before with a real transparent hole so it works on
   both the light and the dark page, and the text sits below the hole. */
.door-hanger-btn {
  --u: 8px;
  --hanger-gold: #C9A24B;
  --hanger-ink: #22314F;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: calc(var(--u) * 16);
  min-height: calc(var(--u) * 30);
  padding: calc(var(--u) * 10) calc(var(--u) * 1.75) calc(var(--u) * 2.5);
  border-radius: calc(var(--u) * 7.5);
  color: var(--hanger-ink);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transform-origin: 50% calc(var(--u) * 7);
  filter: drop-shadow(0 6px 10px rgba(34, 49, 79, 0.2));
}
.door-hanger-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--hanger-gold);
  -webkit-mask: radial-gradient(circle at 50% calc(var(--u) * 7), transparent calc(var(--u) * 2.7), #000 calc(var(--u) * 2.7 + 0.5px));
  mask: radial-gradient(circle at 50% calc(var(--u) * 7), transparent calc(var(--u) * 2.7), #000 calc(var(--u) * 2.7 + 0.5px));
}
/* one flex item; text-wrap: balance gives evenly sized lines */
.door-hanger-label {
  display: block;
  text-wrap: balance;
}
.door-hanger-btn:hover,
.door-hanger-btn:focus-visible {
  color: var(--hanger-ink);
}
.door-hanger-btn:focus-visible {
  outline: 3px solid var(--hanger-ink);
  outline-offset: 6px;
}
.dark-mode .door-hanger-btn:focus-visible {
  outline-color: var(--hanger-gold);
}
@media (prefers-reduced-motion: no-preference) {
  .door-hanger-btn {
    transition: transform 0.4s ease;
  }
  /* swings a little from the hole, like a hanger on a doorknob */
  .door-hanger-btn:hover,
  .door-hanger-btn:focus-visible {
    transform: rotate(4deg);
  }
}

/* Big "404" above the "Page not found" heading on the 404 page. Navy on the light page and gold on the dark page (gold on
   white is too low-contrast for text); it follows the same light/dark swap as the logo. */
.error-page .error-page-code {
  margin-bottom: 0.5rem;
  color: #22314F;
  font-size: clamp(4.5rem, 14vw, 7.5rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}
.dark-mode .error-page .error-page-code {
  color: #C9A24B;
}

