/*
 * widgets-base.css — shared utility tokens and patterns for all widget templates.
 * Loaded globally in base.html. Eliminates ~15x repeated cover-fill and overlay
 * gradient CSS from individual widget <style> blocks.
 */

/* ── CSS variables ─────────────────────────────────────────────────────────── */
:root {
  --w-shadow-base: 0 0.2rem 0.75rem rgba(0, 0, 0, 0.10);
  --w-radius: 0.375rem;
}

/* ── Cover-fill image ─────────────────────────────────────────────────────── */
/*
 * Replaces ~15 repeated instances of:
 *   position: absolute; left/top/right/bottom: 0; width/height: 100%;
 *   object-fit: cover; object-position: center;
 * Usage: add class="w-img-fill" to the <img> inside a position:relative container.
 */
.w-img-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  margin: 0;
}

/* ── Gradient overlays ────────────────────────────────────────────────────── */
/*
 * Replaces ~10 repeated gradient overlay definitions.
 * Usage: add class="w-overlay-bottom" or "w-overlay-top" to the overlay element.
 * Keep widget-specific font-size / padding in the widget's own CSS class.
 */
.w-overlay-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.4) 75%, rgba(0, 0, 0, 0) 100%);
  color: #fff;
}

.w-overlay-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.25) 70%, rgba(0, 0, 0, 0) 100%);
  color: #fff;
}

/* ── DQF (Description-Quiz-Fact) base ────────────────────────────────────── */
/*
 * Moved here from widget_museum_description_and_fact.html to resolve the
 * .widget-dqf class conflict when artist/artwork/museum DQF widgets coexist
 * on the same page. Each widget file now only defines its own --widget-dqf-accent
 * and element-level rules, not the shared background/shadow/radius base.
 */
.widget-dqf {
  background: #fff;
  box-shadow: var(--w-shadow-base);
  border-radius: var(--w-radius);
}

/* ── Featured-artist-with-fact responsive column dividers ─────────────────── */
/*
 * Moved here from widget_featured_artist_with_fact.html which was the only
 * widget using a raw @media query in an inline <style> block.
 */
.widget-faf__cell {
  border-bottom: 1px solid #000;
  padding: 0.9rem 0.85rem;
}

@media (min-width: 768px) {
  .widget-faf__cell {
    border-bottom: 0;
    border-right: 1px solid #000;
  }

  .widget-faf__cell--last {
    border-right: 0;
  }
}

/* ── Swiper slider inner container reset ──────────────────────────────────── */
/*
 * Eliminates the repeated inline style="border:none;padding-top:0;margin-bottom:0;"
 * that appears on every .parent_slid_box across all slider widgets.
 */
.parent_slid_box {
  border: none !important;
  padding-top: 0;
  margin-bottom: 0;
}

/* ── Small translated field widget (widget-stf) ───────────────────────────── */
.widget-stf {
  --stf-bg: #dcd3bf;
  --stf-title: #3e342a;
  --stf-label: #875d2a;
  font-family: var(--font-body, inherit);
  background: var(--stf-bg);
  padding: 1.25rem 1rem 1rem;
  margin-bottom: 1rem;
}
@media (min-width: 768px) {
  .widget-stf { padding: 1.5rem 1.25rem 1.25rem; }
}
.widget-stf__title {
  font-family: var(--font-title, inherit);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 400;
  line-height: 1.25;
  color: var(--stf-title);
  text-align: center;
  text-transform: uppercase;
  text-wrap: balance;
  margin: 0 0 1rem;
  letter-spacing: 0.02em;
}
.widget-stf__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1rem;
}
.widget-stf__item {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.widget-stf__media {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #d4cbb8;
}
.widget-stf__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.widget-stf__label {
  margin: 0.5rem 0 0;
  padding: 0;
  font-family: var(--font-body, inherit);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}
.widget-stf__label a { color: var(--stf-label); }
.widget-stf__label a::before,
.widget-stf__label a::after { content: none; }
.widget-stf__label a:hover {
  color: #6b4822;
  text-decoration: underline;
}

/* Homepagetest row: equal widget size, title centered, artworks bottom-aligned */
.homepage-homepagetest-widgets .widget-stf-row > .col-lg-4 {
  display: flex;
  flex-direction: column;
}
.homepage-homepagetest-widgets .widget-stf-row > .col-lg-4 > .widget-stf {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}
.homepage-homepagetest-widgets .widget-stf-row .widget-stf__grid {
  flex: 0 0 auto;
  margin-top: auto;
  width: 100%;
  align-items: stretch;
  grid-auto-rows: 1fr;
}
.homepage-homepagetest-widgets .widget-stf-row .widget-stf__item {
  display: grid;
  grid-template-rows: 1fr auto auto;
  min-height: 100%;
}
.homepage-homepagetest-widgets .widget-stf-row .widget-stf__media {
  grid-row: 2;
  align-self: end;
}
.homepage-homepagetest-widgets .widget-stf-row .widget-stf__label {
  grid-row: 3;
}
.homepage-homepagetest-widgets .widget-stf-row .widget-stf__title {
  flex: 1 1 auto;
  min-height: 4.5rem;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
