/* ============================================================
   Homepage layout + widgets
   Wireframe: brand -> events -> [left stack | right stack]
   Left (equal width): Serverstatus, Login, Top Player
   Right (equal width): Highlights, News listing
   Loaded ONLY by index.html, after style.css.
   ============================================================ */

/* ---------- Centered page container ---------- */
.home-layout {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: min(1320px, 100%);
    margin: 0 auto;
    padding: 0 2rem 2.5rem;
}

.home-layout > .home-brand-top { order: 0; }
.home-layout > .events-bar { order: 1; }
.home-layout > .home-main-grid { order: 2; width: 100%; }
.home-layout > * { min-width: 0; }

/* Site brand banner (Kalisto) above the events bar */
.home-brand-top {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 3.25rem 0 1.75rem;
}
.home-brand-top .hero-logo { margin: 0; }
.home-brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.home-brand-link:hover .hero-logo-img,
.home-brand-link:hover .hero-logo {
    filter: drop-shadow(0 10px 38px rgba(var(--primary-rgb, 204, 0, 0), 0.65));
}

/* Clamp fixed pixel widths from admin layout editor */
.home-layout [data-widget]:not(.discord-banner--floating),
.home-layout [data-zone] { max-width: 100% !important; }

/* ---------- Two-column grid (wireframe) ---------- */
.home-main-grid {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
    width: 100%;
    margin-top: 1.75rem;
}

/* Left column: every child same width */
.home-col-left {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
    min-width: 0;
}

.home-col-left > * {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    margin: 0 !important;
}

/* Right column: every child same width */
.home-col-right {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
    min-width: 0;
}

.home-col-right > * {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* ---------- Server status (in-flow, not floating) ---------- */
.home-col-left .server-status-widget,
#serverStatusWidget {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    z-index: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    background: rgba(10, 10, 16, 0.9);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

/* ---------- Login in left column ---------- */
.home-col-left .auth-box {
    display: block;
    width: 100%;
}

.home-col-left .auth-box .glass-panel {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    padding: 1.5rem 1.25rem;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.home-col-left .auth-box .glass-panel:hover {
    border-color: rgba(var(--accent-rgb, 255, 77, 77), 0.3);
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.65),
                0 0 30px rgba(var(--primary-rgb, 204, 0, 0), 0.15);
}

/* ---------- Hero / highlights (right top) ---------- */
.hero-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    min-height: auto;
    gap: 0;
    padding: 0;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: min(720px, 100%);
    height: 360px;
    background: radial-gradient(ellipse at center,
        rgba(var(--primary-rgb, 204, 0, 0), 0.16) 0%,
        rgba(var(--accent-rgb, 255, 77, 77), 0.08) 40%,
        transparent 72%);
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 5;
    display: block;
    width: 100%;
    max-width: 100%;
}

.hero-brand {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 1rem;
}

.hero-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-family: var(--font-headers, 'Inter', sans-serif);
    font-size: clamp(2.6rem, 6vw, 4.4rem);
    font-weight: 800;
    letter-spacing: 2px;
    line-height: 1.1;
    text-align: center;
    overflow-wrap: anywhere;
    filter: drop-shadow(0 8px 34px rgba(var(--primary-rgb, 204, 0, 0), 0.45));
}

.hero-logo-img {
    max-width: min(460px, 82vw);
    max-height: 160px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 34px rgba(var(--primary-rgb, 204, 0, 0), 0.5));
}

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

/* Top 3 news: same .news-card chrome as News & Updates below */
.hero-highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    width: 100%;
}

.hero-highlights .news-card {
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    height: 100%;
}

/* ---------- News listing (right bottom): full-width stacked entries ---------- */
.home-col-right .news-section {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
}

.home-col-right .news-section .section-title {
    margin-bottom: 1rem;
}

.home-col-right .news-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.home-col-right .news-list-item {
    display: flex;
    flex-direction: column;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 280px;
    margin: 0;
    padding: 0 !important;
    overflow: hidden;
}

.home-col-right .news-list-item:hover {
    transform: none;
}

.home-col-right .news-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    background: rgba(255, 255, 255, 0.02);
}

.home-col-right .news-list-head-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
    flex-wrap: wrap;
}

.home-col-right .news-list-icon {
    color: var(--primary, #cc0000);
    font-size: 1.15rem;
    flex-shrink: 0;
}

.home-col-right .news-list-item .news-title {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.35;
}

.home-col-right .news-list-item .news-date {
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 0.78rem;
    font-weight: 600;
}

.home-col-right .news-list-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.5rem 1.5rem 1.6rem;
    flex: 1;
}

.home-col-right .news-list-item .news-excerpt {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.75;
    flex: 1 1 auto;
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
    line-clamp: unset;
}

.home-col-right .news-excerpt--rich p {
    margin: 0 0 0.85rem;
    color: var(--text-muted, #9ca3af);
}

.home-col-right .news-excerpt--rich p:last-child {
    margin-bottom: 0;
}

.home-col-right .news-excerpt--rich ul,
.home-col-right .news-excerpt--rich ol {
    margin: 0 0 0.85rem;
    padding-left: 1.35rem;
    color: var(--text-muted, #9ca3af);
}

.home-col-right .news-excerpt--rich li {
    margin-bottom: 0.35rem;
}

.home-col-right .news-excerpt--rich strong {
    color: var(--text-main, #f3f4f6);
    font-weight: 700;
}

.home-col-right .news-list-item .news-read-more {
    margin-top: auto;
    padding: 0.7rem 1.15rem;
    font-size: 0.9rem;
}

/* ---------- Top players widget ---------- */
.top-players-widget {
    width: 100%;
    background: rgba(10, 10, 16, 0.9);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.top-players-widget:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
    border-color: rgba(var(--accent-rgb, 255, 77, 77), 0.35);
}

.tp-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.95rem;
    padding-bottom: 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
}

.tp-header i { color: var(--accent, #ff4d4d); }

.tp-list { display: flex; flex-direction: column; gap: 0.35rem; }

.tp-loading,
.tp-empty {
    text-align: center;
    color: var(--text-muted, #9ca3af);
    padding: 1.5rem 0;
    font-size: 0.9rem;
}

.tp-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.5rem;
    border-radius: 10px;
    transition: background 0.15s ease;
}

.tp-row:hover { background: rgba(255, 255, 255, 0.04); }

.tp-rank {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.85rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tp-rank.rank-gold { color: #f5c518; border-color: rgba(245, 197, 24, 0.6); box-shadow: 0 0 12px rgba(245, 197, 24, 0.25); }
.tp-rank.rank-silver { color: #d4d4d8; border-color: rgba(212, 212, 216, 0.6); }
.tp-rank.rank-bronze { color: #cd7f32; border-color: rgba(205, 127, 50, 0.6); }

.tp-info { flex: 1; min-width: 0; }

.tp-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-main, #f3f4f6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tp-level { font-size: 0.72rem; color: var(--text-muted, #9ca3af); }

.tp-reward { color: #f5c518; font-size: 1rem; flex-shrink: 0; opacity: 0.85; }

.tp-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, var(--primary, #cc0000), var(--accent, #ff4d4d));
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tp-button:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(var(--primary-rgb, 204, 0, 0), 0.4); }

/* ---------- Discord: subtle floating banner ---------- */
.discord-banner {
    color: #fff;
    background: linear-gradient(135deg, #5865F2, #4048c9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    box-shadow: 0 12px 34px rgba(88, 101, 242, 0.35);
}

.discord-banner--floating {
    position: fixed;
    left: 1.25rem;
    bottom: 1.25rem;
    z-index: 900;
    width: 230px;
    max-width: calc(100vw - 2.5rem);
    padding: 0.8rem 0.95rem;
    opacity: 0.9;
    box-shadow: 0 12px 30px rgba(88, 101, 242, 0.4);
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.discord-banner--floating:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 16px 38px rgba(88, 101, 242, 0.55);
}

.discord-banner .db-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.discord-banner .db-top i { font-size: 1.15rem; }
.discord-banner .db-text { font-size: 0.78rem; opacity: 0.9; line-height: 1.4; margin-bottom: 0.6rem; }

.discord-banner .db-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.82rem;
    transition: background 0.15s ease, transform 0.15s ease;
}

.discord-banner .db-btn:hover { background: rgba(255, 255, 255, 0.28); transform: translateY(-2px); }

/* ---------- Today's events chips ---------- */
.today-events { margin: 0.25rem 0 0; }
.today-events .te-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
    color: var(--accent, #ff4d4d);
    margin-bottom: 0.5rem;
}
.today-events .te-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.today-events .te-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    background: rgba(var(--primary-rgb, 204, 0, 0), 0.14);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12));
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main, #f3f4f6);
}
.today-events .te-icon { color: var(--accent, #ff4d4d); }
.today-events .te-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}
.today-events .te-time { opacity: 0.7; font-weight: 500; font-size: 0.82em; margin-left: 0.15rem; }

.events-bar {
    display: none;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    width: 100%;
    margin: 0;
    padding: 1.35rem 1.6rem;
    background: linear-gradient(135deg, rgba(14, 14, 22, 0.94), rgba(10, 10, 16, 0.9));
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    border-radius: 18px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.events-bar:hover {
    border-color: rgba(var(--accent-rgb, 255, 77, 77), 0.3);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.events-bar .te-label {
    margin-bottom: 0;
    white-space: nowrap;
    font-size: 0.85rem;
    align-self: center;
}
.events-bar .te-list { flex: 0 1 auto; gap: 0.9rem; align-items: center; justify-content: center; }

.events-bar .te-chip {
    padding: 0.7rem 1.2rem;
    gap: 0.85rem;
    border-radius: 16px;
    font-size: 1rem;
    background: rgba(var(--primary-rgb, 204, 0, 0), 0.16);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.events-bar .te-chip:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--accent-rgb, 255, 77, 77), 0.55);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.events-bar .te-img {
    width: 46px;
    height: 46px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}
.events-bar .te-title { font-weight: 700; }
.events-bar .te-time { font-size: 0.85em; }

.today-events .te-live {
    font-size: 0.7em;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
    background: #22c55e;
    padding: 0.12rem 0.5rem;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
}
.events-bar .te-chip-live {
    border-color: rgba(34, 197, 94, 0.6);
    background: rgba(34, 197, 94, 0.14);
}

/* ---------- Decorative characters (hidden; archer stays off) ---------- */
.m2-hero-deco { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .home-layout { padding: 0 1.25rem 2rem; }
    .home-main-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .home-col-left {
        max-width: 420px;
        width: 100%;
        margin: 0 auto;
    }
    .hero-highlights {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .home-layout { padding: 0 1rem 1.5rem; }
    .home-brand-top { margin: 2rem 0 1.25rem; }
    .hero-logo { letter-spacing: 1px; }
    .hero-logo-img { max-height: 120px; }
    .events-bar { padding: 1rem 1.1rem; }
    .home-col-left { max-width: 100%; }
}
