/*
 * Front page layout (loaded on the front page only).
 *
 * Top zone: CSS grid with four named areas.
 *   Mobile:  lead → meet → news → links
 *   Desktop: lead | meet
 *            news | meet   (news starts right under the lead, even when
 *            news | links   the meetings card is taller than the lead)
 * When there are no meetings (.front-top--no-meet) the links column moves up
 * beside the lead.
 *
 * No hover lifts or animations, per the project brief.
 */

/* ---------- Top zone grid ---------- */
.front-top {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "lead"
    "meet"
    "news"
    "links";
}

.front-top__lead  { grid-area: lead; }
.front-top__meet  { grid-area: meet; }
.front-top__news  { grid-area: news; }
.front-top__links { grid-area: links; }

@media (min-width: 992px) {
  .front-top {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    grid-template-areas:
      "lead meet"
      "news meet"
      "news links";
    grid-template-rows: auto auto 1fr;
    column-gap: 2.5rem;
    row-gap: 2.5rem;
    align-items: start;
  }

  .front-top--no-meet {
    grid-template-areas:
      "lead links"
      "news links";
    grid-template-rows: auto 1fr;
  }
}

/* ---------- Lead message ---------- */
.lead-kicker {
  color: var(--color-primary);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lead-title {
  font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.75rem);
  line-height: 1.15;
}

.lead-title a:hover,
.lead-title a:focus {
  color: var(--color-primary) !important;
}

.lead-text {
  font-size: 1.125rem;
  max-width: 38rem;
}

/* Mini-hero: image is the background of the whole lead block. */
.lead-block--image {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
  min-height: 260px;
  display: flex;
  align-items: center;
}

.lead-block__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Scrim: strong behind the text (left), fading out to the right. */
.lead-block--image::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.lead-block--image .lead-block__body {
  position: relative;
  z-index: 2;
  padding: 2rem 1.5rem;
}

/* Dark image → light text. */
.lead-block--dark {
  background-color: #10233f;
}

.lead-block--dark::before {
  background: linear-gradient(90deg, rgba(10, 24, 46, 0.88) 0%, rgba(10, 24, 46, 0.65) 55%, rgba(10, 24, 46, 0.2) 100%);
}

.lead-block--dark .lead-kicker {
  color: rgba(255, 255, 255, 0.85);
}

.lead-block--dark .lead-title,
.lead-block--dark .lead-text {
  color: #fff;
}

.lead-block--dark .lead-title a:hover,
.lead-block--dark .lead-title a:focus {
  color: #fff !important;
  text-decoration: underline !important;
}

/* Light image → dark text (default colours). */
.lead-block--light {
  background-color: #f6f8fb;
}

.lead-block--light::before {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.72) 55%, rgba(255, 255, 255, 0.2) 100%);
}

@media (min-width: 768px) {
  .lead-block--image {
    min-height: 300px;
  }

  .lead-block--image .lead-block__body {
    max-width: 70%;
    padding: 2.5rem;
  }
}

/* Phones: text spans the full width, so use an even scrim. */
@media (max-width: 767.98px) {
  .lead-block--dark::before {
    background: rgba(10, 24, 46, 0.72);
  }

  .lead-block--light::before {
    background: rgba(255, 255, 255, 0.8);
  }
}

/* ---------- Section headings ---------- */
.section-head {
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 0.5rem;
}

/* ---------- News ---------- */
.news-item__image {
  width: 96px;
  height: 72px;
  object-fit: cover;
}

.news-item h3 a:hover {
  color: var(--color-primary) !important;
  text-decoration: underline !important;
}

/* ---------- Sidebar cards ---------- */
.side-card {
  background: #fff;
  border: 1px solid #dfe5ee;
  border-radius: var(--border-radius);
  padding: 1.25rem;
}

/* Meetings */
.meeting-list .meeting:last-child {
  border-bottom: 0 !important;
}

.meeting-date {
  /* `flex: 0 0 <width>` (not just `width`) so the column is a genuinely
     fixed size: a flex item's default `min-width: auto` otherwise lets it
     grow past a plain `width` to fit whichever row's weekday name is
     longest (5-9 characters), which is what caused every row's title to
     start at a different x-position before this. */
  flex: 0 0 5rem;
  width: 5rem;
  padding: 0.3rem 0;
  background: #f1f5fb;
  border: 1px solid #d6e0ee;
  border-radius: 0.375rem;
  line-height: 1.1;
}

.meeting-date__full {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primary);
}

.meeting-date__weekday {
  display: block;
  font-size: 0.7rem;
  color: #6c757d;
}

.meeting-title {
  line-height: 1.3;
}

/* Uued Uudised */
.uu-card__logo {
  max-height: 40px;
  width: auto;
}

.uu-card__wordmark {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.uu-card__list li:last-child {
  border-bottom: 0 !important;
}

.uu-card__list a:hover {
  color: var(--color-primary) !important;
  text-decoration: underline !important;
}

/* E-shop */
.shop-card {
  color: inherit;
}

.shop-card:hover,
.shop-card:focus {
  border-color: var(--color-primary);
}

.shop-card__image {
  width: 64px;
  height: 64px;
  object-fit: cover;
}

/* ---------- Full-width sections ---------- */
.front-section {
  padding: 3rem 0;
}

.front-section--muted {
  background: #f6f8fb;
}

.priority-card {
  position: relative;
  background: #fff;
  border: 1px solid #dfe5ee;
  border-left: 4px solid var(--color-primary);
  border-radius: var(--border-radius);
  padding: 1.25rem;
}

.priority-card:hover {
  border-color: var(--color-primary);
}

.person-card {
  position: relative;
}

.person-card__photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
}

.person-card__photo--empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dfe5ee;
  color: #fff;
  font-size: 2.5rem;
}

.person-card--chair .person-card__photo {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.person-card a:hover {
  color: var(--color-primary) !important;
}

/* Join band */
.join-band {
  padding: 3rem 0;
}

.join-band__bank {
  font-variant-numeric: tabular-nums;
}

.join-band .member-count {
  font-variant-numeric: tabular-nums;
  min-height: 1em;
  /* display-6 is 2.5rem by default; ~30% smaller */
  font-size: 1.75rem;
}
