/* ===================================
   Index v4 - BBC-style editorial layout
   Zero cards. Zero rounded corners.
   Borders, bars, typography.
   =================================== */

.body-v4 {
  background: #fff;
}

/* ===================================
   Header bar
   =================================== */
.v4-header__bar {
  background: var(--clr-primary-dark);
}

.v4-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
  gap: 16px;
}

.v4-header__logo {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.3px;
}

.v4-header__logo:hover {
  color: #fff;
}

.v4-header__logo i {
  font-size: 1.15rem;
}

/* Mobile menu toggle - hidden on desktop */
.v4-header__menu-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.v4-header__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.v4-header__btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, .85);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  transition: color var(--transition);
}

.v4-header__btn:hover {
  color: #fff;
}

/* ===================================
   Navigation (inline with header)
   =================================== */
.v4-nav {
  display: flex;
  align-items: center;
  gap: 0;
}

.v4-nav__link {
  padding: 6px 12px;
  font-size: .82rem;
  font-weight: 500;
  color: rgba(255, 255, 255, .65);
  white-space: nowrap;
  transition: all var(--transition);
}

.v4-nav__link:hover {
  color: #fff;
}

.v4-nav__link--active {
  color: #fff;
  font-weight: 700;
}

.v4-nav__dropdown {
  position: relative;
}
.v4-nav__dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  background: #1a1f2e;
  border-radius: .4rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  padding: .35rem 0;
  z-index: 999;
}
.v4-nav__dropdown:hover .v4-nav__dropdown-menu {
  display: block;
}
.v4-nav__dropdown-item {
  display: block;
  padding: .45rem 1rem;
  font-size: .8rem;
  font-weight: 500;
  color: rgba(255,255,255,.7);
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.v4-nav__dropdown-item:hover,
.v4-nav__dropdown-item.v4-nav__link--active {
  color: #fff;
  background: rgba(255,255,255,.07);
}

/* ===================================
   Main area
   =================================== */
.v4-main {
  padding-top: 0;
  padding-bottom: 40px;
}

/* ===================================
   Meta line
   =================================== */
.v4-meta {
  font-size: .75rem;
  color: var(--clr-text-muted);
  margin-top: 6px;
}

.v4-meta__sep {
  margin: 0 4px;
}

/* ===================================
   Top stories
   =================================== */
.v4-top {
  border-bottom: none;
  padding: 20px 0;
}

.v4-top__lead {
  padding-right: 24px;
  border-right: 1px solid var(--clr-border);
}

.v4-top__aside {
  padding-left: 24px;
}

/* Lead story */
.v4-lead {
  display: block;
  color: var(--clr-text);
}

.v4-lead:hover {
  color: var(--clr-text);
}

.v4-lead__img {
  margin-bottom: 14px;
  line-height: 0;
}

.v4-lead__img img {
  width: 100%;
  height: auto;
}

.v4-lead__title {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 10px;
  letter-spacing: -.3px;
}

.v4-lead:hover .v4-lead__title {
  text-decoration: underline;
}

.v4-lead__summary {
  font-size: .92rem;
  color: var(--clr-text-muted);
  line-height: 1.55;
  margin: 0;
}

/* Aside items */
.v4-aside-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--clr-border);
  color: var(--clr-text);
}

.v4-aside-item:first-child {
  padding-top: 0;
}

.v4-aside-item--no-border {
  border-bottom: none;
}

.v4-aside-item:hover {
  color: var(--clr-text);
}

.v4-aside-item__img {
  width: 120px;
  flex-shrink: 0;
  line-height: 0;
}

.v4-aside-item__img img {
  width: 100%;
  height: 80px;
  object-fit: cover;
}

.v4-aside-item__text {
  flex: 1;
  min-width: 0;
}

.v4-aside-item__text h3 {
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}

.v4-aside-item:hover h3 {
  text-decoration: underline;
}

.v4-aside-item__text p {
  font-size: .78rem;
  color: var(--clr-text-muted);
  line-height: 1.45;
  margin: 4px 0 0;
}

/* ===================================
   Section
   =================================== */
.v4-section {
  padding: 24px 0;
  border-bottom: none;
}

/* Color bar */
.v4-bar {
  width: 100%;
  height: 1px;
  background: var(--clr-primary);
  margin-top: 16px;
  margin-bottom: 16px;
  opacity: .35;
}

.v4-bar--accent {
  background: var(--clr-accent);
}

.v4-bar--science {
  background: #0d9488;
}

.v4-bar--sport {
  background: #eab308;
}

.v4-bar--culture {
  background: #a855f7;
}

.v4-bar--opinion {
  background: var(--clr-primary-dark);
}

.v4-section__title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--clr-text);
  letter-spacing: -.2px;
}

.v4-section__subtitle {
  font-size: .8rem;
  color: var(--clr-text-muted);
  margin-bottom: 16px;
}

/* ===================================
   Column border (vertical divider)
   =================================== */
.v4-col-border {
  border-left: none;
  padding-left: 0 !important;
}

/* ===================================
   Most read
   =================================== */
.v4-most-read {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: rank;
  columns: 2;
  column-gap: 32px;
}

.v4-most-read li {
  counter-increment: rank;
  padding: 10px 0;
  border-bottom: 1px solid var(--clr-border);
  break-inside: avoid;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.v4-most-read li:nth-child(3),
.v4-most-read li:last-child {
  border-bottom: none;
}

.v4-most-read li::before {
  content: counter(rank);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--clr-accent);
  flex-shrink: 0;
  line-height: 1;
  width: 28px;
  text-align: right;
}

.v4-most-read li a {
  font-size: .88rem;
  font-weight: 600;
  color: var(--clr-text);
  line-height: 1.35;
}

.v4-most-read li a:hover {
  text-decoration: underline;
  color: var(--clr-text);
}

/* ===================================
   Story with image (3-col grid items)
   =================================== */
.v4-story-img {
  display: block;
  color: var(--clr-text);
  padding-right: 20px;
}

.v4-story-img:hover {
  color: var(--clr-text);
}

.v4-story-img__pic {
  margin-bottom: 10px;
  line-height: 0;
}

.v4-story-img__pic img {
  width: 100%;
  height: auto;
}

.v4-story-img h3 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
}

.v4-story-img:hover h3 {
  text-decoration: underline;
}

.v4-story-img p {
  font-size: .84rem;
  color: var(--clr-text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Small story (4-col) */
.v4-story-sm {
  display: block;
  color: var(--clr-text);
  padding-right: 16px;
}

.v4-story-sm:hover {
  color: var(--clr-text);
}

.v4-story-sm__pic {
  margin-bottom: 10px;
  line-height: 0;
}

.v4-story-sm__pic img {
  width: 100%;
  height: auto;
}

.v4-story-sm h4 {
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.v4-story-sm:hover h4 {
  text-decoration: underline;
}

/* ===================================
   Feature (large image + text)
   =================================== */
.v4-feature {
  display: block;
  color: var(--clr-text);
  padding-right: 24px;
}

.v4-feature:hover {
  color: var(--clr-text);
}

.v4-feature__img {
  margin-bottom: 14px;
  line-height: 0;
}

.v4-feature__img img {
  width: 100%;
  height: auto;
}

.v4-feature h3 {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 8px;
}

.v4-feature:hover h3 {
  text-decoration: underline;
}

.v4-feature p {
  font-size: .88rem;
  color: var(--clr-text-muted);
  line-height: 1.5;
  margin: 0;
}

/* ===================================
   Text-only story (list in sidebar)
   =================================== */
.v4-text-story {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--clr-border);
  color: var(--clr-text);
}

.v4-text-story:first-child {
  padding-top: 0;
}

.v4-text-story--no-border {
  border-bottom: none;
}

.v4-text-story:hover {
  color: var(--clr-text);
}

.v4-text-story h4 {
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}

.v4-text-story:hover h4 {
  text-decoration: underline;
}

.v4-text-story__desc {
  font-size: .78rem;
  color: var(--clr-text-muted);
  line-height: 1.45;
  margin: 4px 0 0;
}

/* ===================================
   Opinion
   =================================== */
.v4-opinion {
  display: block;
  padding: 0 20px 0 0;
  color: var(--clr-text);
}

.v4-opinion:hover {
  color: var(--clr-text);
}

.v4-opinion__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 10px;
}

.v4-opinion__author {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--clr-text-muted);
  margin-bottom: 6px;
}

.v4-opinion h4 {
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  font-style: italic;
}

.v4-opinion:hover h4 {
  text-decoration: underline;
}

/* ===================================
   Footer
   =================================== */
.v4-footer {
  background: var(--clr-primary-dark);
  color: rgba(255, 255, 255, .7);
  padding: 48px 0 0;
  margin-top: 0;
}

.v4-footer__heading {
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: 16px;
}

.v4-footer__top {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (min-width: 992px) {
  .v4-footer__top {
    flex-direction: row;
    gap: 48px;
  }

  .v4-footer__brand {
    flex: 0 0 400px;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
  }

  .v4-footer__columns {
    flex: 1;
  }
}

.v4-footer__columns {
  display: flex;
  gap: 24px;
}

.v4-footer__col {
  flex: 1;
}

.v4-footer__brand {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

@media (min-width: 992px) {
  .v4-footer__brand {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
  }
}

.v4-footer__tagline {
  font-size: .82rem;
  font-style: italic;
  color: rgba(255, 255, 255, .7);
  margin: 0 0 .5rem;
  letter-spacing: .02em;
}

.v4-footer__desc {
  font-size: .85rem;
  color: rgba(255, 255, 255, .5);
  line-height: 1.55;
}

.v4-footer__links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.v4-footer__links li {
  margin-bottom: 8px;
}

.v4-footer__links a {
  font-size: .85rem;
  color: rgba(255, 255, 255, .55);
}

.v4-footer__links a:hover {
  color: #fff;
  text-decoration: underline;
}

.v4-footer__social {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.v4-footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .55);
  font-size: .9rem;
  transition: all var(--transition);
}

.v4-footer__social a:hover {
  background: rgba(255, 255, 255, .15);
  color: #fff;
}

.v4-footer__bottom {
  display: flex;
  justify-content: center;
  font-size: .75rem;
  color: rgba(255, 255, 255, .35);
  padding: 16px 0;
  margin-top: 36px;
}

.v4-footer__bottom a {
  color: rgba(255, 255, 255, .35);
}

.v4-footer__bottom a:hover {
  color: rgba(255, 255, 255, .7);
}

/* ===================================
   Off-canvas drawer
   =================================== */
.v4-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 1050;
}

.v4-drawer-backdrop--visible {
  display: block;
}

.v4-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  max-width: 85vw;
  background: var(--clr-primary-dark);
  color: #fff;
  z-index: 1060;
  transform: translateX(100%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.v4-drawer--open {
  transform: translateX(0);
}

.v4-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.v4-drawer__title {
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.v4-drawer__close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, .7);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
}

.v4-drawer__close:hover {
  color: #fff;
}

.v4-drawer__nav {
  list-style: none;
  padding: 12px 0;
  margin: 0;
  flex: 1;
}

.v4-drawer__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: rgba(255, 255, 255, .75);
  font-size: .9rem;
  font-weight: 500;
  transition: all var(--transition);
}

.v4-drawer__link i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.v4-drawer__link:hover {
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

.v4-drawer__link--active {
  color: #fff;
  background: rgba(255, 255, 255, .08);
  border-left: 3px solid var(--clr-primary-light);
  font-weight: 700;
}

.v4-drawer__footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
}

.v4-drawer__footer-link {
  font-size: .78rem;
  color: rgba(255, 255, 255, .4);
}

.v4-drawer__footer-link:hover {
  color: rgba(255, 255, 255, .7);
}

/* ===================================
   Responsive - tablet (lg down)
   =================================== */
@media (max-width: 991.98px) {
  .v4-top__lead {
    padding-right: 0;
    border-right: none;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--clr-border);
    margin-bottom: 16px;
  }

  .v4-top__aside {
    padding-left: 0;
  }

  .v4-lead__title {
    font-size: 1.35rem;
  }

  /* Remove vertical column borders on tablet */
  .v4-col-border {
    border-left: none;
    padding-left: 0 !important;
  }

  /* Add top borders instead for separation */
  .v4-col-border::before {
    content: '';
    display: block;
    border-top: 1px solid var(--clr-border);
    margin-bottom: 16px;
    padding-top: 4px;
  }

  .v4-feature {
    padding-right: 0;
    margin-bottom: 20px;
  }

  .v4-most-read {
    columns: 1;
  }

  .v4-story-img,
  .v4-story-sm,
  .v4-opinion {
    padding-right: 0;
    margin-bottom: 20px;
  }

  /* 4-col grids become 2-col on tablet - col-md-6 handles this,
     but adjust left border to top border for every 2nd col-md-6 */
  .v4-section .col-md-6.v4-col-border {
    border-left: none;
    padding-left: 0 !important;
  }
}

/* ===================================
   Responsive - mobile (md down)
   =================================== */
@media (max-width: 767.98px) {
  /* Show burger, hide inline nav */
  .v4-header__menu-btn {
    display: inline-flex;
  }

  .v4-nav {
    display: none !important;
  }

  .v4-header__btn {
    padding: 6px 6px;
    font-size: .78rem;
  }

  /* Hide desktop nav on mobile - use drawer instead */
  .v4-nav {
    display: none;
  }

  /* Typography scale down */
  .v4-lead__title {
    font-size: 1.2rem;
  }

  .v4-lead__summary {
    font-size: .84rem;
  }

  .v4-feature h3 {
    font-size: 1.05rem;
  }

  .v4-section__title {
    font-size: 1rem;
  }

  /* Aside items: stack image on top on narrow screens */
  .v4-aside-item {
    gap: 10px;
  }

  .v4-aside-item__img {
    width: 100px;
  }

  .v4-aside-item__img img {
    height: 66px;
  }

  .v4-aside-item__text h3 {
    font-size: .84rem;
  }

  /* Story cards on mobile: full width */
  .v4-story-img h3 {
    font-size: .92rem;
  }

  .v4-story-img p {
    font-size: .8rem;
  }

  .v4-story-sm h4 {
    font-size: .84rem;
  }

  .v4-text-story h4 {
    font-size: .84rem;
  }

  /* Opinion - mobile: avatar left, author+title right */
  .v4-opinion {
    padding: 16px 0;
    margin-bottom: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0 14px;
    align-items: center;
    border-bottom: 1px solid var(--clr-border);
  }

  .v4-opinion__avatar {
    width: 48px;
    height: 48px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .v4-opinion__author {
    width: calc(100% - 62px);
    margin-bottom: 0;
  }

  .v4-opinion h4 {
    width: 100%;
    margin-top: 8px;
    font-size: .86rem;
  }

  /* Footer - keep row layout on mobile */

  .v4-footer__bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* ===================================
   Responsive - small mobile (sm down)
   =================================== */
@media (max-width: 575.98px) {
  .v4-main {
    padding-bottom: 24px;
  }

  .v4-top {
    padding: 14px 0;
  }

  .v4-section {
    padding: 18px 0;
  }

  .v4-lead__title {
    font-size: 1.1rem;
  }

  .v4-feature h3 {
    font-size: .95rem;
  }

  .v4-header__row {
    height: 44px;
  }

  .v4-header__logo-box {
    width: 28px;
    height: 28px;
    font-size: .82rem;
  }

  .v4-header__logo span:last-child {
    font-size: .95rem;
  }

  /* Most read: tighter */
  .v4-most-read li {
    padding: 8px 0;
  }

  .v4-most-read li::before {
    font-size: 1.3rem;
    width: 22px;
  }

  .v4-most-read li a {
    font-size: .82rem;
  }

  /* 2-col grids on mobile */
  .v4-section .col-md-6 {
    margin-bottom: 4px;
  }
}

/* -- Search overlay -- */
.v4-search {
  max-height: 0;
  overflow: hidden;
  background: var(--clr-primary-dark);
  transition: max-height .3s ease, padding .3s ease;
  padding: 0;
}
.v4-search--open {
  max-height: 80px;
  padding: .75rem 0;
}
.v4-search__form {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.1);
  border-radius: 4px;
  padding: .4rem .75rem;
}
.v4-search__icon {
  color: rgba(255,255,255,.5);
  font-size: 1rem;
}
.v4-search__input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: .95rem;
  padding: .25rem 0;
}
.v4-search__input::placeholder {
  color: rgba(255,255,255,.4);
}
.v4-search__close {
  background: none;
  border: none;
  color: rgba(255,255,255,.6);
  font-size: 1.1rem;
  cursor: pointer;
  padding: .25rem;
  line-height: 1;
  transition: color .2s;
}
.v4-search__close:hover {
  color: #fff;
}

/* ===================================
   Empty state (no articles)
   =================================== */
.v4-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 96px 24px;
  color: var(--clr-text-muted, #9ca3af);
}

.v4-empty-state__icon {
  font-size: 1.6em;
  opacity: .35;
  margin-right: .35em;
  vertical-align: middle;
}

.v4-empty-state__title {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--clr-text, #1e293b);
  margin-bottom: 10px;
}

.v4-empty-state__text {
  font-size: .95rem;
  max-width: 420px;
  line-height: 1.6;
}

/* ===================================
   Category chips (subcategory nav)
   =================================== */
.v4-cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.v4-cat-chip {
  display: inline-block;
  padding: .3rem .85rem;
  border: 1px solid var(--clr-border, #e2e8f0);
  font-size: .82rem;
  font-weight: 500;
  color: var(--clr-text, #1e293b);
  text-decoration: none;
  transition: background .15s, border-color .15s;
}

.v4-cat-chip:hover {
  background: var(--clr-primary, #0f172a);
  border-color: var(--clr-primary, #0f172a);
  color: #fff;
}

/* ===================================
   Footer sublinks (subcategory list)
   =================================== */
.v4-footer__sublinks {
  list-style: none;
  padding: 0;
  margin: 2px 0 4px 10px;
}

.v4-footer__sublinks li a {
  font-size: .8rem;
  opacity: .7;
}

.v4-footer__sublinks li a:hover {
  opacity: 1;
}
