/* ================================================================
   Gurdwara Management – News Public Styles
   Two-panel banner + grid + featured layouts
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Shared base (grid + featured) ──────────────────────────────── */
.gm-news-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background: #fff;
    color: #333;
    line-height: 1.5;
    box-sizing: border-box;
}
.gm-news-container * { box-sizing: border-box; }

.gm-news-card { display: flex; flex-direction: column; background: #fff; overflow: hidden; }

.gm-news-image-area { position: relative; width: 100%; height: 250px; background: #f5f5f5; }
.gm-news-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gm-news-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #f0f0f0; color: #888; }
.gm-news-placeholder-text { font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

.gm-news-content-area { padding: 24px; display: flex; flex-direction: column; flex-grow: 1; }

.gm-news-headline { font-size: 18px; font-weight: 600; margin: 0 0 12px; color: #111; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gm-news-headline-large { font-size: 28px; }
.gm-news-event-date-meta { font-size: 13px; margin-bottom: 12px; color: #444; }
.gm-news-description { font-size: 14px; font-weight: 400; line-height: 1.7; color: #555; margin-bottom: 24px; }

.gm-news-badge-wrap { margin-bottom: 16px; }
.gm-news-badge { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; padding: 4px 12px; border-radius: 20px; color: #fff; }
.gm-news-badge-news       { background: #1976d2; }
.gm-news-badge-newsletter { background: #2e7d32; }
.gm-news-badge-event      { background: #e67e22; }

.gm-news-footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding-top: 15px; border-top: 1px solid #eee; }
.gm-news-date { font-size: 12px; font-weight: 400; color: #888; }
.gm-news-action { font-size: 13px; font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; }
.gm-news-action-news       { color: #1976d2; }
.gm-news-action-newsletter { color: #2e7d32; }
.gm-news-action-event      { color: #e67e22; }
.gm-news-arrow { margin-left: 5px; transition: transform 0.2s ease; }
.gm-news-action:hover .gm-news-arrow { transform: translateX(4px); }

/* ── Grid layout ─────────────────────────────────────────────────── */
.gm-news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 24px 0; }
.gm-news-card-grid { border: 1px solid #f0f0f0; }

/* ── Featured layout ─────────────────────────────────────────────── */
.gm-news-card-featured { flex-direction: row; min-height: 450px; border: 1px solid #f0f0f0; }
.gm-news-card-featured .gm-news-image-area { width: 50%; height: auto; }
.gm-news-card-featured .gm-news-content-area { width: 50%; padding: 60px; justify-content: center; }

/* ================================================================
   GM News Banner — Professional Two-Panel Layout
   60% image | ~35% scrollable list | ~5% vertical ticker
   ================================================================ */

.gm-banner {
    display: flex;
    width: 100%;
    height: 300px;
    max-height: 300px;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.14);
    line-height: 1.4;
    color: #1a2744;
}
.gm-banner * { box-sizing: border-box; }

/* ── Image panel (60%) ───────────────────────────────────────────── */
.gm-banner__img-panel {
    position: relative;
    width: 60%;
    height: 100%;
    flex-shrink: 0;
    overflow: hidden;
    background: #0d1b35;
}

/* Background image — cross-fades via opacity */
.gm-banner__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    transition: opacity 0.55s ease;
    will-change: opacity;
}
.gm-banner__bg.is-out { opacity: 0; }

.gm-banner__bg-fallback {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0d1b35 0%, #1a2744 50%, #2c3e5f 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Gradient overlay — covers bottom 65% of image */
.gm-banner__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(5, 10, 22, 0.96)  0%,
        rgba(5, 10, 22, 0.78) 28%,
        rgba(5, 10, 22, 0.35) 55%,
        transparent            100%
    );
    display: flex;
    align-items: flex-end;
    pointer-events: none;
}

.gm-banner__overlay-body {
    width: 100%;
    padding: 0 22px 92px; /* leaves room above 3-line caption bar */
}

/* Type badge on the image overlay */
.gm-banner__over-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    padding: 3px 12px;
    border-radius: 2px;
    color: #fff;
    margin-bottom: 10px;
}

/* Title on the image */
.gm-banner__over-title {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.22;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
    transition: opacity 0.35s ease;
}

/* Caption / description bar — pinned to very bottom */
.gm-banner__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 84px;
    background: rgba(5, 10, 22, 0.90);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 11px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    z-index: 3;
}

.gm-banner__caption-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.82);
    margin: 0;
    line-height: 1.55;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: opacity 0.35s ease;
}

.gm-banner__caption-cta {
    font-size: 12px;
    font-weight: 600;
    color: #c9a84c;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    transition: color 0.2s;
}
.gm-banner__caption-cta:hover { color: #e8c66d; }
.gm-banner__cta-arrow { transition: transform 0.2s; display: inline-block; }
.gm-banner__caption-cta:hover .gm-banner__cta-arrow { transform: translateX(3px); }

/* Progress line — sits between overlay and caption */
.gm-banner__progress-track {
    position: absolute;
    bottom: 84px;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.12);
    z-index: 4;
}
.gm-banner__progress-bar {
    height: 100%;
    background: #c9a84c;
    width: 0%;
    will-change: width;
}

/* Slide counter */
.gm-banner__counter {
    position: absolute;
    top: 14px;
    left: 18px;
    background: rgba(0, 0, 0, 0.52);
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 4px 11px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    z-index: 5;
}
.gm-banner__counter-sep { margin: 0 3px; opacity: 0.55; }

/* Prev / Next buttons */
.gm-banner__ctrl {
    position: absolute;
    top: 50%;
    transform: translateY(calc(-50% - 30px)); /* shift up, away from caption */
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.22s, transform 0.22s;
    backdrop-filter: blur(4px);
    z-index: 5;
    padding: 0;
}
.gm-banner__ctrl:hover { background: rgba(255, 255, 255, 0.28); }
.gm-banner__ctrl--prev { left: 14px; }
.gm-banner__ctrl--next { right: 14px; }
.gm-banner__ctrl--prev:hover { transform: translateY(calc(-50% - 30px)) translateX(-2px); }
.gm-banner__ctrl--next:hover { transform: translateY(calc(-50% - 30px)) translateX(2px); }

/* ── Right panel (40%) ───────────────────────────────────────────── */
.gm-banner__right {
    display: flex;
    width: 40%;
    height: 100%;
    background: #fff;
    border-left: 1px solid #e4e7ec;
    overflow: hidden;
}

/* ── Scrollable news list ────────────────────────────────────────── */
.gm-banner__list-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* List header */
.gm-banner__list-head {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 13px 14px 11px;
    border-bottom: 1px solid #edf0f4;
    background: #f8f9fb;
    flex-shrink: 0;
}
.gm-banner__list-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    color: #1a2744;
    flex: 1;
}
.gm-banner__list-count {
    font-size: 10px;
    color: #9ea6b4;
    font-weight: 500;
}

/* Live pulsing dot */
.gm-banner__live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e53935;
    flex-shrink: 0;
    animation: gmLivePulse 1.6s ease-in-out infinite;
}
@keyframes gmLivePulse {
    0%, 100% { opacity: 1;   transform: scale(1);    }
    50%       { opacity: 0.4; transform: scale(0.72); }
}

/* Scrollable list */
.gm-banner__list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #dde1e9 transparent;
}
.gm-banner__list::-webkit-scrollbar         { width: 4px; }
.gm-banner__list::-webkit-scrollbar-track   { background: transparent; }
.gm-banner__list::-webkit-scrollbar-thumb   { background: #dde1e9; border-radius: 2px; }

/* Individual list item */
.gm-banner__item {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #f0f2f6;
    cursor: pointer;
    transition: background 0.16s;
    position: relative;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
.gm-banner__item:last-child   { border-bottom: none; }
.gm-banner__item:hover        { background: #f5f7fb; }
.gm-banner__item.is-active    { background: #eef2fa; }
.gm-banner__item:focus-visible { box-shadow: inset 0 0 0 2px #1976d2; }

/* Active accent bar on left */
.gm-banner__item-accent {
    width: 3px;
    align-self: stretch;
    background: transparent;
    flex-shrink: 0;
    transition: background 0.2s;
    border-radius: 0 2px 2px 0;
}
.gm-banner__item.is-active .gm-banner__item-accent { background: #1a2744; }

/* Item body */
.gm-banner__item-body {
    flex: 1;
    padding: 11px 8px 11px 11px;
    min-width: 0;
}
.gm-banner__item-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}
.gm-banner__item-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    padding: 2px 7px;
    border-radius: 2px;
    color: #fff;
    flex-shrink: 0;
    line-height: 1.5;
}
.gm-banner__item-date {
    font-size: 10px;
    color: #9ea6b4;
    font-weight: 500;
}
.gm-banner__item-date--event {
    color: #e67e22;
    font-weight: 600;
}
.gm-banner__item-title {
    font-size: 12.5px;
    font-weight: 600;
    color: #1a2744;
    margin: 0 0 4px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.15s;
}
.gm-banner__item.is-active .gm-banner__item-title { color: #1565c0; }
.gm-banner__item-desc {
    font-size: 11px;
    color: #6b7585;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Chevron on right of each item */
.gm-banner__item-chevron {
    padding: 0 11px 0 5px;
    display: flex;
    align-items: center;
    color: #c8cdd8;
    flex-shrink: 0;
    transition: color 0.18s, transform 0.18s;
}
.gm-banner__item.is-active .gm-banner__item-chevron,
.gm-banner__item:hover .gm-banner__item-chevron {
    color: #1a2744;
    transform: translateX(2px);
}

/* ── Type badge colours — shared across banner and list ─────────── */
.gm-banner__badge--news       { background: #1976d2; }
.gm-banner__badge--newsletter { background: #2e7d32; }
.gm-banner__badge--event      { background: #e67e22; }

/* ── Vertical ticker strip — hidden ──────────────────────────────── */
.gm-banner__ticker {
    display: none;
}

/* "NEWS" label at the top — vertical, upright text */
.gm-banner__ticker-head {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 3px;
    color: #c9a84c;
    padding: 14px 0 10px;
    text-align: center;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

/* Scrolling viewport */
.gm-banner__ticker-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* The track scrolls upward; duplicated items create seamless loop */
.gm-banner__ticker-track {
    display: flex;
    flex-direction: column;
    animation: gmTickerUp 28s linear infinite;
    will-change: transform;
}
.gm-banner__ticker-track:hover { animation-play-state: paused; }

@keyframes gmTickerUp {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

/* Each headline in the ticker */
.gm-banner__ticker-item {
    display: block;
    writing-mode: vertical-rl;
    transform: rotate(180deg);   /* reads bottom → top */
    white-space: nowrap;
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.72);
    padding: 16px 13px;
    line-height: 1;
    cursor: default;
    transition: color 0.2s;
}
.gm-banner__ticker-item:hover { color: rgba(255, 255, 255, 0.95); }

.gm-banner__ticker-dot {
    font-size: 7px;
    margin-bottom: 7px;
    display: block;
}
.gm-banner__tdot--news       { color: #64b5f6; }
.gm-banner__tdot--newsletter { color: #81c784; }
.gm-banner__tdot--event      { color: #ffb74d; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 960px) {
    .gm-banner {
        flex-direction: column;
        height: auto;
        max-height: none;
    }
    .gm-banner__img-panel {
        width: 100%;
        height: 200px;
    }
    .gm-banner__right {
        width: 100%;
        height: 200px;
    }
    .gm-banner__over-title { font-size: 17px; }
    .gm-banner__overlay-body { padding-bottom: 60px; }

    /* Grid */
    .gm-news-grid { grid-template-columns: repeat(2, 1fr); }
    /* Featured */
    .gm-news-card-featured { flex-direction: column; min-height: auto; }
    .gm-news-card-featured .gm-news-image-area,
    .gm-news-card-featured .gm-news-content-area { width: 100%; }
    .gm-news-card-featured .gm-news-image-area { height: 220px; }
    .gm-news-card-featured .gm-news-content-area { padding: 24px; }
}

@media (max-width: 640px) {
    .gm-banner__img-panel { height: 170px; }
    .gm-banner__right     { height: 180px; }

    .gm-banner__over-title { font-size: 14px; -webkit-line-clamp: 2; }
    .gm-banner__caption { padding: 8px 14px; min-height: 60px; }
    .gm-banner__caption-text { font-size: 11px; -webkit-line-clamp: 2; }
    .gm-banner__caption-cta  { display: none; }
    .gm-banner__overlay-body { padding: 0 14px 68px; }

    .gm-news-grid { grid-template-columns: 1fr; }
}
