/* ===========================================================================
   Rebuilt homepage — desktop-first Bangla daily layout.

   Structure mirrors how mainstream Bangla dailies (protidinersangbad and
   peers) organise a front page:
     utility bar → logo band → sticky category nav → ticker
     → lead block (big lead + secondary column + latest rail)
     → category blocks (lead card + card row), repeated
     → multimedia + quiz + slider bands
     → multi-column footer

   Container is a fixed 1200px so column maths stay predictable; everything
   collapses to one column below 992px.
   =========================================================================== */

:root {
    --brand:        #c0392b;
    --brand-dark:   #96281b;
    --ink:          #14181f;
    --ink-soft:     #4b5563;
    --ink-faint:    #8b95a3;
    --rule:         #e5e7eb;
    --bg:           #f4f5f7;
    --surface:      #ffffff;
    --wrap:         1200px;
}

/* Scope everything to the rebuilt page so legacy CSS files cannot bleed in. */
.hm-page {
    background: var(--bg);
    color: var(--ink);
    /* Safety net: no section may push the page sideways on small screens.
       Individual rails (nav, ticker) do their own horizontal scrolling. */
    overflow-x: hidden;
}
.hm-page *,
.hm-page *::before,
.hm-page *::after { box-sizing: border-box; }

.hm-wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 16px;
}

/* Section heading: red rule + label, the standard Bangla-daily treatment. */
.hm-sec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 2px solid var(--rule);
    margin: 0 0 16px;
}
.hm-sec-head h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--ink);
    margin: 0;
    padding: 0 0 9px;
    border-bottom: 3px solid var(--brand);
    margin-bottom: -2px;
    line-height: 1.3;
}
.hm-sec-head a {
    font-size: 13px;
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}
.hm-sec-head a:hover { text-decoration: underline; }

.hm-section { padding: 26px 0; }

/* ---------- Header ------------------------------------------------------ */

.hm-utility {
    background: var(--ink);
    color: #cbd5e1;
    font-size: 13px;
}
.hm-utility .hm-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    height: 38px;
}
.hm-utility a { color: #cbd5e1; text-decoration: none; }
.hm-utility a:hover { color: #fff; }
.hm-utility-links { display: flex; gap: 16px; align-items: center; }

.hm-masthead { background: var(--surface); border-bottom: 1px solid var(--rule); }
.hm-masthead .hm-wrap {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
    padding-top: 16px;
    padding-bottom: 16px;
}
.hm-logo img { max-height: 66px; max-width: 100%; width: auto; display: block; }
.hm-masthead-ad { justify-self: end; max-width: 728px; }
.hm-masthead-ad img { max-width: 100%; height: auto; display: block; }

.hm-search { justify-self: center; width: 100%; max-width: 340px; position: relative; }
.hm-search input {
    width: 100%;
    height: 40px;
    padding: 0 40px 0 14px;
    border: 1px solid var(--rule);
    border-radius: 20px;
    font: inherit;
    font-size: 14px;
    background: #f8fafc;
}
.hm-search input:focus { outline: none; border-color: var(--brand); background: #fff; }
.hm-search button {
    position: absolute; right: 4px; top: 4px;
    width: 32px; height: 32px; border: none; border-radius: 50%;
    background: var(--brand); color: #fff; cursor: pointer;
}

/* Sticky category nav */
.hm-nav {
    background: var(--brand);
    position: sticky;
    top: 0;
    z-index: 60;
    box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.hm-nav ul {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.hm-nav ul::-webkit-scrollbar { display: none; }
.hm-nav a {
    display: block;
    padding: 12px 14px;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .18s;
}
.hm-nav a:hover, .hm-nav a.is-active { background: rgba(0,0,0,.18); }

/* Ticker */
.hm-ticker {
    background: var(--surface);
    border-bottom: 1px solid var(--rule);
}
.hm-ticker .hm-wrap { display: flex; align-items: center; height: 44px; gap: 14px; }
.hm-ticker-label {
    background: var(--brand);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 4px;
    flex: 0 0 auto;
}
.hm-ticker-track { overflow: hidden; flex: 1; }
.hm-ticker-move {
    display: inline-flex;
    gap: 34px;
    white-space: nowrap;
    animation: hm-ticker 38s linear infinite;
}
.hm-ticker-move a { color: var(--ink); text-decoration: none; font-size: 15px; }
.hm-ticker-move a:hover { color: var(--brand); }
.hm-ticker:hover .hm-ticker-move { animation-play-state: paused; }
@keyframes hm-ticker {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ---------- Lead block -------------------------------------------------- */

.hm-lead-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
}
.hm-lead-main {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 20px;
    align-items: start;
}

.hm-lead-card { display: block; text-decoration: none; color: inherit; }
.hm-lead-figure {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 6px;
    background: #e9edf2;
}
.hm-lead-figure img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform .5s ease;
}
.hm-lead-card:hover .hm-lead-figure img { transform: scale(1.04); }
.hm-kicker {
    display: inline-block;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 3px;
    margin-bottom: 9px;
}
.hm-lead-title {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.32;
    margin: 10px 0 8px;
    color: var(--ink);
}
.hm-lead-card:hover .hm-lead-title { color: var(--brand); }
.hm-lead-dek {
    font-size: 15px;
    line-height: 1.75;
    color: var(--ink-soft);
    margin: 0;
}

/* Secondary column beside the lead */
.hm-lead-side { display: flex; flex-direction: column; gap: 16px; }
.hm-side-card {
    display: grid;
    grid-template-columns: 104px 1fr;
    gap: 11px;
    text-decoration: none;
    color: inherit;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--rule);
}
.hm-lead-side .hm-side-card:last-child { border-bottom: none; padding-bottom: 0; }
.hm-side-card img {
    width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
    border-radius: 4px; background: #e9edf2; display: block;
}
.hm-side-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    margin: 0;
    color: var(--ink);
}
.hm-side-card:hover .hm-side-title { color: var(--brand); }
.hm-meta { font-size: 12px; color: var(--ink-faint); margin-top: 5px; }

/* ---------- Sidebar ----------------------------------------------------- */

.hm-sidebar { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 60px; }
.hm-panel {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 8px;
    overflow: hidden;
}
.hm-panel-head {
    background: var(--ink);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 11px 14px;
}
.hm-panel-body { padding: 6px 14px 12px; }
.hm-rank {
    display: grid;
    grid-template-columns: 26px 1fr;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--rule);
    text-decoration: none;
    color: inherit;
}
.hm-panel-body .hm-rank:last-child { border-bottom: none; }
.hm-rank-num {
    font-size: 19px; font-weight: 800; color: var(--brand); line-height: 1.2;
}
.hm-rank-title { font-size: 14px; font-weight: 600; line-height: 1.55; margin: 0; }
.hm-rank:hover .hm-rank-title { color: var(--brand); }
.hm-ad-slot img { max-width: 100%; height: auto; display: block; margin: 0 auto; }

/* ---------- Category blocks -------------------------------------------- */

.hm-cat-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 20px;
    align-items: start;
}
.hm-card { text-decoration: none; color: inherit; display: block; }
.hm-card img {
    width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
    border-radius: 5px; background: #e9edf2; display: block;
}
.hm-card-title {
    font-size: 16px; font-weight: 700; line-height: 1.5; margin: 10px 0 0;
}
.hm-card:hover .hm-card-title { color: var(--brand); }
.hm-card-lead .hm-card-title { font-size: 21px; line-height: 1.4; }
.hm-card-dek { font-size: 14px; line-height: 1.7; color: var(--ink-soft); margin: 7px 0 0; }

/* Even 3-up card row (the "সর্বশেষ" strip under the lead). Declared as a class
   rather than an inline style so the breakpoints below can actually override
   it — an inline grid-template-columns wins over any media query. */
.hm-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: start;
}

/* Stacked text list used as the third column of a category block */
.hm-cat-list { display: flex; flex-direction: column; }
.hm-cat-list a {
    padding: 10px 0;
    border-bottom: 1px solid var(--rule);
    text-decoration: none;
    color: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.55;
}
.hm-cat-list a:last-child { border-bottom: none; }
.hm-cat-list a:hover { color: var(--brand); }

/* ---------- Multimedia -------------------------------------------------- */

.hm-media-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.hm-media-card { cursor: pointer; text-decoration: none; color: inherit; display: block; }
.hm-media-thumb { position: relative; border-radius: 6px; overflow: hidden; background: #000; }
.hm-media-thumb img {
    width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; opacity: .92;
}
.hm-media-card:hover .hm-media-thumb img { opacity: 1; }
.hm-play {
    position: absolute; inset: 0; margin: auto;
    width: 46px; height: 46px; border-radius: 50%;
    background: rgba(192,57,43,.92); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.hm-media-title { font-size: 15px; font-weight: 700; line-height: 1.5; margin: 9px 0 0; }

/* On dark bands (video) invert the text colours. */
.hm-band-dark { background: var(--ink); }
.hm-band-dark .hm-sec-head { border-bottom-color: rgba(255,255,255,.15); }
.hm-band-dark .hm-sec-head h2 { color: #fff; }
.hm-band-dark .hm-media-title { color: #fff; }
.hm-band-dark .hm-media-card:hover .hm-media-title { color: #ff8a7a; }

/* ---------- Footer ------------------------------------------------------ */

.hm-footer { background: var(--ink); color: #cbd5e1; padding: 34px 0 0; }
.hm-footer a { color: #cbd5e1; text-decoration: none; }
.hm-footer a:hover { color: #fff; }
.hm-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 30px;
    padding-bottom: 26px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.hm-footer h4 { color: #fff; font-size: 16px; font-weight: 700; margin: 0 0 12px; }
.hm-footer-links { list-style: none; margin: 0; padding: 0; columns: 2; }
.hm-footer-links li { margin-bottom: 8px; font-size: 14px; }
.hm-footer-social { display: flex; gap: 10px; margin-top: 14px; }
.hm-footer-social a {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,.1);
    display: flex; align-items: center; justify-content: center;
}
.hm-footer-social a:hover { background: var(--brand); color: #fff; }
.hm-footer-bottom {
    padding: 16px 0 22px;
    font-size: 13px;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}

/* ---------- Responsive -------------------------------------------------- */

@media (max-width: 1100px) {
    .hm-cat-grid { grid-template-columns: 1.3fr 1fr; }
    .hm-cat-list { grid-column: 1 / -1; }
    .hm-media-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 992px) {
    .hm-lead-grid { grid-template-columns: 1fr; }
    .hm-sidebar { position: static; }
    .hm-masthead .hm-wrap { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .hm-masthead-ad { justify-self: center; }
    .hm-lead-title { font-size: 25px; }
}

@media (max-width: 768px) {
    .hm-lead-main { grid-template-columns: 1fr; }
    .hm-cat-grid { grid-template-columns: 1fr; }
    .hm-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .hm-media-grid { grid-template-columns: repeat(2, 1fr); }
    .hm-footer-grid { grid-template-columns: 1fr; }
    .hm-lead-title { font-size: 22px; }
    .hm-utility .hm-wrap { font-size: 12px; }
    /* The utility bar's link row would otherwise push the page wider. */
    .hm-utility-links { gap: 10px; overflow-x: auto; scrollbar-width: none; }
    .hm-utility-links::-webkit-scrollbar { display: none; }
}

@media (max-width: 520px) {
    .hm-grid-3 { grid-template-columns: 1fr; }
    .hm-media-grid { grid-template-columns: 1fr; }
    .hm-footer-links { columns: 1; }
    .hm-side-card { grid-template-columns: 92px 1fr; }
    .hm-lead-title { font-size: 20px; }
}
