/* ═══ BELA HOMEPAGE v3 — Production CSS ═══
   Must override main.css rules with same or higher specificity.
   Uses .bela-home-main prefix where needed. */

/* ─── Sections rhythm ─── */
.bela-home-main .bela-section { padding: 52px 0; }
.bela-home-main .bela-section--alt { background: var(--bela-bg-alt, #F5F1EB); }
.bela-dual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }

/* ─── Section headers ─── */
.bela-sh { margin-bottom: 22px; position: relative; }
.bela-sh--center { text-align: center; margin-bottom: 32px; }
.bela-sh__label { display: block; font-size: 12px; font-weight: 700; color: var(--bela-accent, #C4973B); letter-spacing: 2.5px; text-transform: uppercase; margin-bottom: 6px; }
.bela-sh__title { font-family: var(--bela-font-heading); font-size: clamp(24px, 3.2vw, 34px); font-weight: 700; color: var(--bela-primary); margin: 0 0 4px; line-height: 1.15; }
.bela-sh__title::after { content: ''; display: block; width: 40px; height: 3px; background: var(--bela-secondary); border-radius: 2px; margin-top: 10px; }
.bela-sh--center .bela-sh__title::after { margin: 10px auto 0; }
.bela-sh__sub { font-size: 15px; color: var(--bela-text-muted); margin-top: 8px; }
.bela-sh__more { margin-bottom: 18px; }
.bela-sh__more a { font-size: 13px; font-weight: 700; color: var(--bela-secondary); text-decoration: none; padding: 5px 16px; border: 1.5px solid var(--bela-secondary); border-radius: 16px; transition: all .2s; display: inline-block; }
.bela-sh__more a:hover { background: var(--bela-secondary); color: #fff; text-decoration: none; }

/* ─── STATS BAR (floating over hero) ─── */
.bela-stats-bar { max-width: var(--bela-container, 1200px); margin: -44px auto 0; padding: 0 24px; position: relative; z-index: 10; }
.bela-stats-bar__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.bela-stats-bar__item { background: var(--bela-surface, #fff); border-radius: 14px; padding: 18px 16px; box-shadow: 0 4px 20px rgba(0,0,0,.08); display: flex; align-items: center; gap: 12px; }
.bela-stats-bar__icon { font-size: 22px; width: 44px; height: 44px; border-radius: 12px; background: var(--bela-bg-alt); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bela-stats-bar__value { font-family: var(--bela-font-heading); font-size: 19px; font-weight: 800; color: var(--bela-primary); line-height: 1; }
.bela-stats-bar__label { font-size: 11px; color: var(--bela-text-muted); margin-top: 2px; }

/* ─── MODE TABS — exact v3 prototype ─── */
.bela-mode-tabs { display: flex; gap: 12px; justify-content: center; margin-bottom: 32px; }
.bela-mode-tab {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 20px 32px;
    background: var(--bela-bg-alt);
    border-radius: 14px;
    border: 2px solid var(--bela-border);
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
    min-width: 160px;
    outline: none;
    box-shadow: none;
    transform: translateY(0);
}
.bela-mode-tab:hover { border-color: var(--bela-secondary); }
.bela-mode-tab--active {
    background: var(--bela-surface);
    border-color: var(--bela-secondary);
    box-shadow: 0 6px 24px rgba(0,0,0,.08);
    transform: translateY(-2px);
}
.bela-mode-tab__icon { font-size: 28px; }
.bela-mode-tab__title { font-size: 15px; font-weight: 700; color: var(--bela-text); }
.bela-mode-tab--active .bela-mode-tab__title { color: var(--bela-primary); }
.bela-mode-tab__desc { font-size: 12px; color: var(--bela-text-muted); }

/* ─── TILE PANELS ─── */
.bela-tiles-panel { display: none; }
.bela-tiles-panel--active { display: block; animation: belaTileFade .35s ease; }
@keyframes belaTileFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ─── TILES — MUST override main.css .bela-tile ─── */
.bela-home-main .bela-tiles-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.bela-home-main .bela-tile {
    display: flex;
    flex-direction: row;       /* OVERRIDE main.css column */
    align-items: center;       /* OVERRIDE main.css center */
    text-align: left;          /* OVERRIDE main.css center */
    gap: 14px;
    padding: 18px 16px;
    background: var(--bela-surface);
    border-radius: 12px;
    border: 1px solid var(--bela-border);
    text-decoration: none;
    transition: all .25s cubic-bezier(.16,1,.3,1);
    box-shadow: none;
}
.bela-home-main .bela-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,.07);
    border-color: var(--bela-accent);
    text-decoration: none;
}
.bela-home-main .bela-tile__icon {
    width: 46px; height: 46px; min-width: 46px;
    border-radius: 12px;
    background: var(--bela-bg-alt);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    margin-bottom: 0;        /* OVERRIDE main.css */
}
.bela-home-main .bela-tile__body { display: flex; flex-direction: column; min-width: 0; }
.bela-home-main .bela-tile__label { font-size: 14px; font-weight: 700; color: var(--bela-text); line-height: 1.3; }
.bela-home-main .bela-tile__desc { font-size: 12px; color: var(--bela-text-muted); margin-top: 1px; line-height: 1.3; }

/* ─── NEWS LIST ─── */
.bela-news-list { display: flex; flex-direction: column; gap: 12px; }
.bela-news-item { display: block; padding: 18px 20px; background: var(--bela-surface); border-radius: 12px; border-left: 3px solid var(--bela-accent); text-decoration: none; transition: all .15s; }
.bela-news-item--pinned { border-left-color: var(--bela-danger, #9B2C2C); }
.bela-news-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,.06); text-decoration: none; }
.bela-news-item__meta { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.bela-news-item__meta time { font-size: 12px; color: var(--bela-text-muted); font-family: var(--bela-font-mono); }
.bela-news-item__cat { font-size: 11px; font-weight: 700; color: #fff; background: var(--bela-secondary); padding: 2px 10px; border-radius: 4px; }
.bela-news-item__title { font-size: 15px; font-weight: 700; color: var(--bela-text); line-height: 1.35; }

/* ─── EVENTS LIST ─── */
.bela-events-list { display: flex; flex-direction: column; gap: 10px; }
.bela-event-item { display: flex; align-items: center; gap: 16px; padding: 14px 18px; background: var(--bela-surface); border-radius: 12px; border: 1px solid var(--bela-border); text-decoration: none; transition: all .15s; }
.bela-event-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,.06); text-decoration: none; }
.bela-event-item__date { width: 52px; height: 52px; border-radius: 12px; background: var(--bela-secondary); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.bela-event-item__day { font-size: 18px; font-weight: 800; line-height: 1; }
.bela-event-item__dow { font-size: 10px; font-weight: 700; opacity: .8; text-transform: uppercase; }
.bela-event-item__body { flex: 1; min-width: 0; }
.bela-event-item__title { font-size: 15px; font-weight: 700; color: var(--bela-text); }
.bela-event-item__meta { font-size: 12px; color: var(--bela-text-muted); margin-top: 3px; display: flex; gap: 10px; }

/* ─── DOCUMENT LIST (deska + council) ─── */
.bela-doc-list { display: flex; flex-direction: column; gap: 8px; }
.bela-doc-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--bela-surface); border-radius: 10px; border: 1px solid var(--bela-border); text-decoration: none; transition: all .15s; }
.bela-doc-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,.05); text-decoration: none; }
.bela-doc-item__body { flex: 1; min-width: 0; }
.bela-doc-item__title { font-size: 14px; font-weight: 600; color: var(--bela-text); }
.bela-doc-item__meta { font-size: 12px; color: var(--bela-text-muted); margin-top: 2px; }
.bela-doc-item__arrow { font-size: 18px; opacity: .3; flex-shrink: 0; margin-left: 12px; color: var(--bela-text); }

/* ─── BUDGET DASHBOARD ─── */
.bela-budget-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 28px; }
.bela-budget-stat { background: var(--bela-surface); border-radius: 14px; padding: 24px 20px; text-align: center; border: 1px solid var(--bela-border); }
.bela-budget-stat__value { font-family: var(--bela-font-heading); font-size: 32px; font-weight: 800; }
.bela-budget-stat__unit { font-size: 13px; color: var(--bela-text-muted); margin: 4px 0 10px; }
.bela-budget-bar { height: 6px; background: var(--bela-bg-alt); border-radius: 3px; overflow: hidden; }
.bela-budget-bar__fill { height: 100%; border-radius: 3px; transition: width 1.5s ease; }
.bela-budget-cats { background: var(--bela-surface); border-radius: 14px; padding: 24px; border: 1px solid var(--bela-border); }
.bela-budget-cats h4 { font-size: 16px; font-weight: 700; color: var(--bela-primary); margin: 0 0 16px; }
.bela-budget-cat { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.bela-budget-cat__dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.bela-budget-cat__name { width: 120px; font-size: 14px; font-weight: 600; flex-shrink: 0; color: var(--bela-text); }
.bela-budget-cat__bar { flex: 1; height: 8px; background: var(--bela-bg-alt); border-radius: 4px; overflow: hidden; }
.bela-budget-cat__bar > div { height: 100%; border-radius: 4px; transition: width 1.5s ease; }
.bela-budget-cat__val { font-size: 12px; color: var(--bela-text-muted); font-family: var(--bela-font-mono); min-width: 120px; text-align: right; white-space: nowrap; }

/* ─── TIMELINE ─── */
.bela-timeline { display: flex; justify-content: center; position: relative; padding: 20px 0; margin-top: 12px; }
.bela-timeline__line { position: absolute; top: 46px; left: 8%; right: 8%; height: 3px; background: var(--bela-border); }
.bela-timeline__point { display: flex; flex-direction: column; align-items: center; position: relative; z-index: 1; flex: 1; padding: 0 6px; text-align: center; }
.bela-timeline__dot { width: 54px; height: 54px; border-radius: 50%; background: var(--bela-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--bela-font-heading); font-size: 13px; font-weight: 800; box-shadow: 0 4px 12px rgba(0,0,0,.15); margin-bottom: 12px; }
.bela-timeline__point:nth-child(even) .bela-timeline__dot { background: var(--bela-accent); }
.bela-timeline__point:nth-child(3n) .bela-timeline__dot { background: var(--bela-secondary); }
.bela-timeline__label { font-size: 13px; font-weight: 700; color: var(--bela-text); margin-bottom: 4px; }
.bela-timeline__desc { font-size: 11px; color: var(--bela-text-muted); line-height: 1.4; }

/* ─── SPORTS ─── */
.bela-sports-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.bela-sport-card { background: var(--bela-surface); border-radius: 12px; padding: 18px 16px; border: 1px solid var(--bela-border); position: relative; }
.bela-sport-card__time { font-size: 18px; font-weight: 800; color: var(--bela-primary); font-family: var(--bela-font-mono); }
.bela-sport-card__name { font-size: 14px; font-weight: 700; color: var(--bela-text); margin-top: 6px; }
.bela-sport-card__hall { font-size: 12px; color: var(--bela-text-muted); margin-top: 3px; }
.bela-sport-card__free { position: absolute; top: 12px; right: 12px; font-size: 10px; font-weight: 700; color: var(--bela-secondary); background: rgba(45,95,62,.1); padding: 2px 8px; border-radius: 4px; }

/* ─── WEBCAM + CONTACT ─── */
.bela-webcam-frame { background: var(--bela-surface); padding: 10px; border-radius: 14px; box-shadow: 0 4px 20px rgba(0,0,0,.06); border: 1px solid var(--bela-border); }
.bela-webcam-frame__img { width: 100%; border-radius: 8px; display: block; }
.bela-webcam-frame__placeholder { background: var(--bela-bg-alt); border-radius: 8px; height: 220px; display: flex; align-items: center; justify-content: center; color: var(--bela-text-muted); }
.bela-webcam-frame__caption { font-size: 12px; color: var(--bela-text-muted); text-align: center; margin: 8px 0 0; }
.bela-contact-list { display: grid; gap: 10px; }
.bela-contact-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--bela-surface); border-radius: 10px; border: 1px solid var(--bela-border); }
.bela-contact-row__icon { font-size: 18px; width: 40px; height: 40px; background: var(--bela-bg-alt); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bela-contact-row__label { font-size: 11px; font-weight: 700; color: var(--bela-text-muted); text-transform: uppercase; letter-spacing: 1px; }
.bela-contact-row__value { font-size: 14px; font-weight: 600; color: var(--bela-text); }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) { .bela-home-main .bela-tiles-grid { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 768px) {
    .bela-home-main .bela-section { padding: 36px 0; }
    .bela-dual-grid { grid-template-columns: 1fr; gap: 28px; }
    .bela-home-main .bela-tiles-grid { grid-template-columns: repeat(2,1fr); }
    .bela-mode-tabs { flex-direction: column; align-items: stretch; }
    .bela-mode-tab { flex-direction: row; gap: 12px; min-width: 0; padding: 16px 20px; }
    .bela-budget-stats, .bela-stats-bar__grid { grid-template-columns: repeat(2,1fr); }
    .bela-timeline { flex-wrap: wrap; gap: 20px; justify-content: center; }
    .bela-timeline__line { display: none; }
    .bela-sports-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 480px) {
    .bela-home-main .bela-tiles-grid { grid-template-columns: 1fr; }
    .bela-stats-bar__grid { grid-template-columns: 1fr 1fr; }
}

/* ─── PAGE-LOAD ANIMATIONS (above-the-fold, no JS) ─── */
@keyframes belaFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Homepage hero text */
.bela-hero__accent {
    animation: belaFadeUp .5s cubic-bezier(.16,1,.3,1) both;
    animation-delay: .1s;
}
.bela-hero__title {
    animation: belaFadeUp .6s cubic-bezier(.16,1,.3,1) both;
    animation-delay: .18s;
}
.bela-hero__subtitle {
    animation: belaFadeUp .6s cubic-bezier(.16,1,.3,1) both;
    animation-delay: .28s;
}

/* Stats bar items — staggered entrance */
.bela-stats-bar__item {
    animation: belaFadeUp .6s cubic-bezier(.16,1,.3,1) both;
}
.bela-stats-bar__item:nth-child(1) { animation-delay: .15s; }
.bela-stats-bar__item:nth-child(2) { animation-delay: .22s; }
.bela-stats-bar__item:nth-child(3) { animation-delay: .29s; }
.bela-stats-bar__item:nth-child(4) { animation-delay: .36s; }

/* Hero CTA buttons — staggered after title */
.bela-hero__btn {
    animation: belaFadeUp .5s cubic-bezier(.16,1,.3,1) both;
}
.bela-hero__btn:nth-child(1) { animation-delay: .3s; }
.bela-hero__btn:nth-child(2) { animation-delay: .38s; }
.bela-hero__btn:nth-child(3) { animation-delay: .46s; }

/* Mode tabs — staggered */
.bela-mode-tab {
    animation: belaFadeUp .5s cubic-bezier(.16,1,.3,1) both;
}
.bela-mode-tab:nth-child(1) { animation-delay: .2s; }
.bela-mode-tab:nth-child(2) { animation-delay: .28s; }
.bela-mode-tab:nth-child(3) { animation-delay: .36s; }

@media (prefers-reduced-motion: reduce) {
    .bela-hero__accent,
    .bela-hero__title,
    .bela-hero__subtitle,
    .bela-stats-bar__item,
    .bela-hero__btn,
    .bela-mode-tab { animation: none; }
}
