/* =========================================================
   THE SILIGURI TODAY — TST WEB APP
   Stage 2 Editorial UI
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #f5f6f8;
    color: #171717;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}


/* =========================================================
   HEADER
   ========================================================= */

.top {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid #e5e5e5;
    backdrop-filter: blur(12px);
}

.bar {
    width: min(1380px, calc(100% - 40px));
    min-height: 74px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand img {
    width: 54px;
    height: 54px;
    object-fit: contain;
    flex: 0 0 auto;
}

.brand span {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand strong {
    font-size: 18px;
    line-height: 1.1;
    letter-spacing: -0.3px;
}

.brand small {
    margin-top: 4px;
    color: #777;
    font-size: 12px;
}

.menu {
    display: none;
    border: 0;
    background: transparent;
    font-size: 25px;
    cursor: pointer;
}

nav {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 34px;
    border-top: 1px solid #f1f1f1;
}

nav a {
    position: relative;
    padding: 12px 2px;
    color: #555;
    font-size: 14px;
    font-weight: 700;
}

nav a:hover,
nav a.active {
    color: #111;
}

nav a.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    background: #111;
    border-radius: 3px 3px 0 0;
}


/* =========================================================
   HERO
   ========================================================= */

.hero {
    background: #101010;
    color: #fff;
}

.hero > div {
    width: min(1380px, calc(100% - 40px));
    margin: auto;
    padding: 52px 0 48px;
}

.live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding: 7px 11px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    background: rgba(255,255,255,.07);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .6px;
}

.live i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
}

.hero h1 {
    max-width: 720px;
    margin: 0;
    font-size: clamp(36px, 5vw, 66px);
    line-height: .98;
    letter-spacing: -2.5px;
}

.hero p {
    max-width: 650px;
    margin: 18px 0 0;
    color: #c8c8c8;
    font-size: 16px;
    line-height: 1.65;
}


/* =========================================================
   MAIN NEWS SECTION
   ========================================================= */

.section {
    width: min(1380px, calc(100% - 40px));
    margin: 0 auto;
    padding: 38px 0 70px;
}

.sectionhead {
    margin-bottom: 20px;
    padding-bottom: 13px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 2px solid #161616;
}

.sectionhead h2 {
    margin: 0;
    font-size: 26px;
    line-height: 1;
    letter-spacing: -0.7px;
}

.sectionhead span {
    color: #777;
    font-size: 12px;
    font-weight: 700;
}


/* =========================================================
   NEWS GRID
   ========================================================= */

.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
}

.card {
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 12px;
    transition:
        transform .18s ease,
        box-shadow .18s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 9px 25px rgba(0,0,0,.07);
}

.story-link {
    display: block;
}

.media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #ececec;
}

.story-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .3s ease;
}

.card:hover .story-image {
    transform: scale(1.025);
}

.placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
}

.placeholder img {
    width: 80px;
    max-height: 65%;
    object-fit: contain;
    opacity: .65;
}

.badge {
    position: absolute;
    left: 12px;
    bottom: 12px;
    padding: 5px 8px;
    border-radius: 5px;
    background: rgba(0,0,0,.82);
    color: #fff;
    font-size: 9px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .7px;
}

.copy {
    padding: 15px 16px 14px;
}

.copy h3 {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    font-size: 18px;
    line-height: 1.25;
    letter-spacing: -0.35px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.copy p {
    display: -webkit-box;
    overflow: hidden;
    margin: 9px 0 14px;
    color: #656565;
    font-size: 13px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.meta {
    padding-top: 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid #eee;
    color: #888;
    font-size: 10px;
}

.meta span:last-child {
    flex: 0 0 auto;
    color: #222;
    font-weight: 800;
}


/* =========================================================
   LEAD STORY
   ========================================================= */

.card.lead {
    grid-column: span 2;
    grid-row: span 2;
}

.card.lead .media {
    aspect-ratio: 16 / 9;
}

.card.lead .copy {
    padding: 20px 21px 18px;
}

.card.lead .copy h3 {
    font-size: clamp(25px, 2.4vw, 35px);
    line-height: 1.08;
    letter-spacing: -1px;
    -webkit-line-clamp: 3;
}

.card.lead .copy p {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.55;
    -webkit-line-clamp: 3;
}

.card.lead .meta {
    font-size: 11px;
}


/* =========================================================
   DESKTOP EDITORIAL LAYOUT
   ========================================================= */

/* Stories 2–5: supporting news cards */
.card:nth-child(n+2):nth-child(-n+5) .media { aspect-ratio: 16 / 9; }
.card:nth-child(n+2):nth-child(-n+5) .copy h3 { font-size: 16px; line-height: 1.3; -webkit-line-clamp: 2; }
.card:nth-child(n+2):nth-child(-n+5) .copy p { display: none; }

/* Stories 6–10: clean latest-news list */
.card:nth-child(n+6):nth-child(-n+10) { grid-column: span 2; display: block; border: 0; border-radius: 0; background: transparent; box-shadow: none; border-top: 1px solid #dedede; }
.card:nth-child(n+6):nth-child(-n+10):hover { transform: none; box-shadow: none; }
.card:nth-child(n+6):nth-child(-n+10) .story-link { display: grid; grid-template-columns: 125px minmax(0, 1fr); gap: 15px; padding: 14px 0; }
.card:nth-child(n+6):nth-child(-n+10) .media { width: 125px; height: 82px; min-height: 0; aspect-ratio: auto; border-radius: 7px; }
.card:nth-child(n+6):nth-child(-n+10) .badge { display: none; }
.card:nth-child(n+6):nth-child(-n+10) .copy { padding: 0; display: flex; flex-direction: column; justify-content: center; }
.card:nth-child(n+6):nth-child(-n+10) .copy h3 { margin: 0; font-size: 15px; line-height: 1.3; -webkit-line-clamp: 2; }
.card:nth-child(n+6):nth-child(-n+10) .copy p { display: none; }
.card:nth-child(n+6):nth-child(-n+10) .meta { margin-top: 7px; padding: 0; border: 0; font-size: 10px; }
.card:nth-child(n+6):nth-child(-n+10) .meta span:last-child { display: none; }

/* Keep homepage intentionally concise */
.card:nth-child(n+11) { display: none; }

/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    padding: 70px 20px;
    text-align: center;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
}

.empty-state img {
    width: 90px;
    margin-bottom: 15px;
}

.empty-state h3 {
    margin: 0 0 6px;
}

.empty-state p {
    margin: 0;
    color: #777;
}


/* =========================================================
   FOOTER
   ========================================================= */

footer {
    padding: 44px 20px 100px;
    text-align: center;
    background: #111;
    color: #fff;
}

footer img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 10px;
}

footer strong {
    display: block;
    font-size: 16px;
}

footer p {
    margin: 7px 0;
    color: #aaa;
    font-size: 13px;
}

footer small {
    color: #777;
}


/* =========================================================
   MOBILE BOTTOM NAV
   ========================================================= */

.bottom {
    display: none;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1000px) {

    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .card.lead {
        grid-column: span 2;
    }

    .card:nth-child(n+6) {
        grid-column: span 2;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    body {
        padding-bottom: 67px;
    }

    .bar {
        width: calc(100% - 28px);
        min-height: 64px;
    }

    .brand img {
        width: 45px;
        height: 45px;
    }

    .brand strong {
        font-size: 15px;
    }

    .brand small {
        font-size: 10px;
    }

    .menu {
        display: block;
    }

    .top nav {
        display: none;
    }

    .top.open nav {
        display: flex;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        padding: 8px 20px 18px;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: #fff;
        border-top: 1px solid #eee;
        box-shadow: 0 12px 20px rgba(0,0,0,.08);
    }

    .top.open nav a {
        padding: 12px 4px;
        border-bottom: 1px solid #eee;
    }

    .top.open nav a.active::after {
        display: none;
    }

    .hero > div {
        width: calc(100% - 28px);
        padding: 32px 0 30px;
    }

    .hero h1 {
        font-size: 39px;
        letter-spacing: -1.7px;
    }

    .hero p {
        margin-top: 14px;
        font-size: 14px;
    }

    .section {
        width: calc(100% - 24px);
        padding: 27px 0 45px;
    }

    .sectionhead {
        margin-bottom: 14px;
    }

    .sectionhead h2 {
        font-size: 22px;
    }

    .grid {
        display: block;
    }

    .card,
    .card.lead,
    .card:nth-child(n+6) {
        display: grid;
        grid-template-columns: 118px minmax(0, 1fr);
        margin-bottom: 11px;
        border-radius: 9px;
    }

    .card .story-link,
    .card.lead .story-link,
    .card:nth-child(n+6) .story-link {
        display: contents;
    }

    .card .media,
    .card.lead .media,
    .card:nth-child(n+6) .media {
        height: 100%;
        min-height: 118px;
        aspect-ratio: auto;
    }

    .card .copy,
    .card.lead .copy,
    .card:nth-child(n+6) .copy {
        padding: 11px 12px;
    }

    .card .copy h3,
    .card.lead .copy h3,
    .card:nth-child(n+6) .copy h3 {
        font-size: 15px;
        line-height: 1.25;
        letter-spacing: -.2px;
        -webkit-line-clamp: 3;
    }

    .card .copy p,
    .card.lead .copy p,
    .card:nth-child(n+6) .copy p {
        display: none;
    }

    .card .meta,
    .card.lead .meta,
    .card:nth-child(n+6) .meta {
        margin-top: 9px;
        padding-top: 7px;
        font-size: 9px;
    }

    .meta span:first-child {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .badge {
        left: 7px;
        bottom: 7px;
        padding: 4px 6px;
        font-size: 8px;
    }

    .card:nth-child(n+11) {
        display: none;
    }

    footer {
        padding-bottom: 40px;
    }

    .bottom {
        position: fixed;
        z-index: 1500;
        left: 0;
        right: 0;
        bottom: 0;
        height: 64px;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        background: rgba(255,255,255,.97);
        border-top: 1px solid #ddd;
        backdrop-filter: blur(14px);
    }

    .bottom a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        color: #777;
        font-size: 18px;
    }

    .bottom a span {
        font-size: 9px;
        font-weight: 700;
    }

    .bottom a.active {
        color: #111;
    }

}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-width: 390px) {

    .card,
    .card.lead,
    .card:nth-child(n+6) {
        grid-template-columns: 104px minmax(0, 1fr);
    }

    .card .media,
    .card.lead .media,
    .card:nth-child(n+6) .media {
        min-height: 108px;
    }

    .card .copy h3,
    .card.lead .copy h3 {
        font-size: 14px;
    }

    .meta span:last-child {
        display: none;
    }

}

/* Stage 2 desktop-editorial compatibility: preserve compact mobile cards */
@media (max-width: 700px) {
  .card:nth-child(n+6):nth-child(-n+10) { display:grid; grid-template-columns:118px minmax(0,1fr); margin-bottom:11px; border:1px solid #e7e7e7; border-radius:9px; background:#fff; }
  .card:nth-child(n+6):nth-child(-n+10) .story-link { display:contents; padding:0; }
  .card:nth-child(n+6):nth-child(-n+10) .media { width:100%; height:100%; min-height:118px; border-radius:0; }
  .card:nth-child(n+6):nth-child(-n+10) .copy { padding:11px 12px; }
  .card:nth-child(n+6):nth-child(-n+10) .copy h3 { font-size:15px; line-height:1.25; -webkit-line-clamp:3; }
  .card:nth-child(n+6):nth-child(-n+10) .meta { margin-top:9px; padding-top:7px; border-top:1px solid #eee; font-size:9px; }
}

/* =========================================================
   CATEGORY / ARCHIVE PAGES
   ========================================================= */

body.category-page .category-hero > div {
    padding: 38px 0 34px;
}

body.category-page .category-hero h1 {
    font-size: clamp(34px, 4.5vw, 56px);
}

body.category-page .category-hero p {
    max-width: 760px;
}

body.category-page .card:nth-child(n+11) {
    display: block;
}

body.category-page .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.category-page .card {
    grid-column: auto;
    grid-row: auto;
}

body.category-page .card .media {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 0;
}

body.category-page .card .story-link {
    display: block;
    padding: 0;
}

body.category-page .card .copy {
    padding: 15px 16px 14px;
    display: block;
}

body.category-page .card .copy h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.3;
    -webkit-line-clamp: 3;
}

body.category-page .card .copy p {
    display: none;
}

body.category-page .card .meta {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-size: 10px;
}

body.category-page .card .meta span:last-child {
    display: inline;
}

@media (max-width: 1000px) {
    body.category-page .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    body.category-page .category-hero > div {
        padding: 27px 0 25px;
    }

    body.category-page .category-hero h1 {
        font-size: 34px;
    }

    body.category-page .grid {
        display: block;
    }

    body.category-page .card,
    body.category-page .card:nth-child(n+6),
    body.category-page .card:nth-child(n+11) {
        display: grid;
        grid-template-columns: 118px minmax(0, 1fr);
        margin-bottom: 11px;
        border: 1px solid #e7e7e7;
        border-radius: 9px;
        background: #fff;
    }

    body.category-page .card .story-link,
    body.category-page .card:nth-child(n+6) .story-link,
    body.category-page .card:nth-child(n+11) .story-link {
        display: contents;
        padding: 0;
    }

    body.category-page .card .media,
    body.category-page .card:nth-child(n+6) .media,
    body.category-page .card:nth-child(n+11) .media {
        width: 100%;
        height: 100%;
        min-height: 118px;
        aspect-ratio: auto;
        border-radius: 0;
    }

    body.category-page .card .copy,
    body.category-page .card:nth-child(n+6) .copy,
    body.category-page .card:nth-child(n+11) .copy {
        padding: 11px 12px;
    }

    body.category-page .card .copy h3,
    body.category-page .card:nth-child(n+6) .copy h3,
    body.category-page .card:nth-child(n+11) .copy h3 {
        font-size: 15px;
        line-height: 1.25;
        -webkit-line-clamp: 3;
    }

    body.category-page .card .meta,
    body.category-page .card:nth-child(n+6) .meta,
    body.category-page .card:nth-child(n+11) .meta {
        margin-top: 9px;
        padding-top: 7px;
        border-top: 1px solid #eee;
        font-size: 9px;
    }
}



/* =========================================================
   HOMEPAGE — EXPLORE NEWS
   ========================================================= */

.explore-section {
    padding: 0 0 70px;
}

.explore-inner {
    width: min(1380px, calc(100% - 40px));
    margin: 0 auto;
}

.explore-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.explore-card {
    min-width: 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    transition: transform .18s ease, box-shadow .18s ease;
}

.explore-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 9px 25px rgba(0,0,0,.07);
}

.explore-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 17px;
    line-height: 1.2;
}

.explore-card span {
    display: block;
    color: #707070;
    font-size: 12px;
    line-height: 1.5;
}

@media (max-width: 1000px) {
    .explore-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .explore-section {
        padding: 0 0 38px;
    }

    .explore-inner {
        width: calc(100% - 24px);
    }

    .explore-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .explore-card {
        padding: 14px;
        border-radius: 9px;
    }

    .explore-card strong {
        font-size: 14px;
    }

    .explore-card span {
        font-size: 10px;
    }
}



/* =========================================================
   TST CATEGORY PAGINATION
   ========================================================= */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 34px 0 6px;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination a,
.pagination span {
    text-decoration: none;
}

.page-numbers a {
    display: grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 8px;
    border: 1px solid #e1e1e1;
    border-radius: 9px;
    background: #fff;
    color: #222;
    font-size: 13px;
    font-weight: 600;
}

.page-numbers a.active {
    background: #111;
    border-color: #111;
    color: #fff;
}

.page-numbers span {
    padding: 0 2px;
    color: #777;
}

.page-arrow {
    color: #222;
    font-size: 13px;
    font-weight: 600;
}

.page-arrow.disabled {
    color: #aaa;
    cursor: default;
}

@media (max-width: 700px) {
    .pagination {
        gap: 9px;
        margin-top: 25px;
        flex-wrap: wrap;
    }

    .page-numbers {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .page-numbers a {
        min-width: 34px;
        height: 34px;
        font-size: 12px;
    }

    .page-arrow {
        font-size: 12px;
    }
}

/* Desktop homepage: ten stories produce five compact rows; make the final
   (tenth) story fill both halves of the otherwise half-empty final row. */
@media (min-width: 1001px) {
  body:not(.category-page) .grid > .card:nth-child(10) {
    grid-column: 1 / -1;
    width: 100%;
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 12px;
    overflow: hidden;
  }
  body:not(.category-page) .grid > .card:nth-child(10) .story-link {
    display: grid;
    grid-template-columns: minmax(190px, 30%) minmax(0, 1fr);
    gap: 0;
    padding: 0;
    min-height: 180px;
  }
  body:not(.category-page) .grid > .card:nth-child(10) .media {
    width: 100%;
    height: 100%;
    min-height: 180px;
    border-radius: 0;
  }
  body:not(.category-page) .grid > .card:nth-child(10) .copy {
    padding: 19px 23px;
    justify-content: center;
  }
  body:not(.category-page) .grid > .card:nth-child(10) .copy h3 {
    font-size: 21px;
    -webkit-line-clamp: 3;
  }
  body:not(.category-page) .grid > .card:nth-child(10) .copy p {
    display: -webkit-box;
    margin: 10px 0;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  body:not(.category-page) .grid > .card:nth-child(10) .meta {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid #eee;
  }
  body:not(.category-page) .grid > .card:nth-child(10) .meta span:last-child {
    display: inline;
  }
}
