/*
 * Vivid Art Studio Gallery Theme – homepage-additions.css
 *
 * Drop into: larkgallery-theme/assets/css/homepage-additions.css
 *
 * Enqueue from functions.php:
 *   wp_enqueue_style( 'lark-homepage', LARK_THEME_URL . '/assets/css/homepage-additions.css', ['lark-main'], LARK_THEME_VERSION );
 */


/* ── Section chrome ───────────────────────────────────────── */

.lark-home-section {
  /* Break out of any prose max-width the theme or block editor imposes */
  width: 100%;
  max-width: none !important;
  box-sizing: border-box;

  padding: var(--spacing-2xl) var(--spacing-md);
  border-top: 1px solid var(--color-border);

  /* Constrain inner content to site max-width */
  --_inner-max: var(--max-width, 1280px);
  --_side-pad: max(var(--spacing-md), calc((100% - var(--_inner-max)) / 2));
  padding-left:  var(--_side-pad);
  padding-right: var(--_side-pad);
}

/* Clear any float/block behaviour the block editor adds around shortcodes */
.lark-home-section::before,
.lark-home-section::after {
  content: '';
  display: table;
  clear: both;
}

.lark-home-section__header {
  margin-bottom: var(--spacing-lg);
}

.lark-home-section__title {
  font-family:    var(--font-sans);
  font-size:      clamp(1rem, 2vw, 1.15rem);
  font-weight:    800;

  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height:    1.2;
  margin-bottom:  var(--spacing-xs);
}

.lark-home-section__subhead {
  font-size:     0.9rem;
  font-style:    italic;
  color:         var(--color-text);
  line-height:   1.55;
  margin-bottom: 0;
}

.lark-home-section__footer {
  margin-top: var(--spacing-lg);
}


/* ── Badges ───────────────────────────────────────────────── */

.lark-badge {
  position:       absolute;
  top:            var(--spacing-sm);
  left:           var(--spacing-sm);
  padding:        0.2rem 0.55rem;
  border-radius:  3px;
  font-size:      0.7rem;
  font-weight:    700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  line-height:    1.4;
  pointer-events: none;
  z-index:        1;
}
.lark-badge--on-view   { background: var(--color-accent); color: #fff; }
.lark-badge--open-call { background: #166534;             color: #fff; }


/* ── Exhibition card grid ─────────────────────────────────── */

/*
 * Key fix: display:grid on a block-level element inside the_content()
 * sometimes gets collapsed if the element has no explicit width.
 * width:100% + box-sizing:border-box makes it fill the section correctly.
 */
.lark-exhibition-cards {
  display:               grid;
  grid-template-columns: repeat(2, 1fr);   /* 2 columns always on desktop */
  gap:                   var(--grid-gap);
  width:                 100%;
  box-sizing:            border-box;
}

@media (max-width: 640px) {
  .lark-exhibition-cards {
    grid-template-columns: 1fr;   /* stack on mobile */
  }
}

.lark-exhibition-card {
  display:        flex;
  flex-direction: column;
  min-width:      0;   /* prevent grid blowout */
}

.lark-exhibition-card__link {
  display:         flex;
  flex-direction:  column;
  height:          100%;
  text-decoration: none;
}
.lark-exhibition-card__link:hover .lark-exhibition-card__title {
  text-decoration: underline;
}

.lark-exhibition-card__image-wrap {
  position:    relative;
  overflow:    hidden;
  flex-shrink: 0;
}

.lark-exhibition-card__image {
  width:        100%;
  aspect-ratio: 16 / 9;
  object-fit:   cover;
  display:      block;
  transition:   transform 0.35s ease;
}
.lark-exhibition-card__link:hover .lark-exhibition-card__image {
  transform: scale(1.03);
}

.lark-exhibition-card__image--placeholder {
  width:        100%;
  aspect-ratio: 16 / 9;
  background:   var(--color-surface);
}

.lark-exhibition-card__body {
  padding: var(--spacing-sm) 0;
  flex:    1;
}

.lark-exhibition-card__title {
  font-family:   var(--font-serif);
  font-size:     1.05rem;
  line-height:   1.3;
  margin-bottom: var(--spacing-xs);
  color:         var(--color-text);
}

.lark-exhibition-card__dates,
.lark-exhibition-card__location,
.lark-exhibition-card__deadline {
  font-size:     0.82rem;
  color:         var(--color-text-muted);
  margin-bottom: 0;
  line-height:   1.5;
}
.lark-exhibition-card__deadline strong {
  color: var(--color-text);
}


/* ── Featured Artists grid ────────────────────────────────── */

.lark-home-featured-artists {
  background: var(--color-surface);
}

.lark-featured-artist-grid {
  display:               grid;
  grid-template-columns: repeat(4, 1fr);   /* 4 columns on desktop */
  gap:                   var(--grid-gap);
  width:                 100%;
  box-sizing:            border-box;
}

@media (max-width: 800px) {
  .lark-featured-artist-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.lark-featured-artist-card {
  min-width: 0;   /* prevent grid blowout */
}

.lark-featured-artist-card__link {
  display:         block;
  text-decoration: none;
}
.lark-featured-artist-card__link:hover .lark-featured-artist-card__name {
  text-decoration: underline;
}

.lark-featured-artist-card__image-wrap {
  overflow: hidden;
}

.lark-featured-artist-card__image {
  width:        100%;
  aspect-ratio: 1 / 1;
  object-fit:   cover;
  display:      block;
  transition:   transform 0.35s ease;
}
.lark-featured-artist-card__link:hover .lark-featured-artist-card__image {
  transform: scale(1.04);
}

.lark-featured-artist-card__image--placeholder {
  width:        100%;
  aspect-ratio: 1 / 1;
  background:   var(--color-border);
}

.lark-featured-artist-card__info {
  padding-top: var(--spacing-sm);
}

.lark-featured-artist-card__name {
  font-family: var(--font-serif);
  font-size:   0.95rem;
  font-style:  italic;
  font-weight: 400;
  line-height: 1.3;
  margin:      0;
  color:       var(--color-text);
}

li.no-bullet { list-style-type: none; }

/* ── Screen-reader utility ────────────────────────────────── */
.sr-only {
  position:    absolute;
  width:       1px;
  height:      1px;
  padding:     0;
  margin:      -1px;
  overflow:    hidden;
  clip:        rect(0 0 0 0);
  white-space: nowrap;
  border:      0;
}


/* ══════════════════════════════════════════════════════════════
   Opportunity cards  [lark_opportunities]
   Mirrors the exhibition card pattern above.
   ══════════════════════════════════════════════════════════════ */

/* Badge colour variants used by opportunity type / status badges.
   The base .lark-badge rule is already defined above. */
.lark-badge--enquire { background: #dbeafe; color: #1e40af; }   /* magazine / retreat type */
.lark-badge--ok      { background: #dcfce7; color: #166534; }   /* open / approved */
.lark-badge--warn    { background: #fef3c7; color: #92400e; }   /* closed / pending */
.lark-badge--sold    { background: #fee2e2; color: #991b1b; }   /* archived / rejected */
.lark-badge--nfs     { background: #f3f4f6; color: #6b7280; }   /* draft */

/* ── Opportunities ────────────────────────────────────────── */

.lark-opportunity-cards {
  display:               grid;
  grid-template-columns: repeat(2, 1fr);
  gap:                   var(--grid-gap);
  width:                 100%;
  box-sizing:            border-box;
}

@media (max-width: 640px) {
  .lark-opportunity-cards {
    grid-template-columns: 1fr;
  }
}

.lark-opportunity-card {
  display:        flex;
  flex-direction: column;
  min-width:      0;
}

.lark-opportunity-card__image {
  display: block;
  width:   100%;
}

.lark-opportunity-card__img {
  display:    block;
  width:      100%;
  height:     auto;
  object-fit: cover;
}

.lark-opportunity-card__actions {
  margin-top: var(--spacing-sm);
}

