/*
 * usha-core.css — UshaKiranam chrome & content CSS (v1)
 *
 * Source of truth: docs/design-handoff/ushakiranam-homepage-v1/CSS_IMPLEMENTATION.md
 * Sections 1-12 are kept in the same order with their original headings so
 * a future reviewer can diff this file against the handoff line-for-line.
 *
 * Tokens come from usha-tokens.css (must be loaded first).
 */

/* ====================================================================
 * 1. Base reset
 * ================================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ====================================================================
 * 2. Logo — mobile + desktop
 * ================================================================ */
.logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

/* MOBILE — header */
.header-logo-img {
  width: clamp(220px, 68vw, 285px);
  max-height: 60px;
  object-fit: contain;
  object-position: center;
  display: block;
}
@media (max-width: 359px) {
  .header-logo-img {
    width: clamp(205px, 66vw, 260px);
    max-height: 56px;
  }
}
@media (min-width: 390px) and (max-width: 767px) {
  .header-logo-img {
    width: clamp(245px, 70vw, 310px);
    max-height: 62px;
  }
}

/* DESKTOP — masthead */
.desktop-logo-img {
  width: clamp(420px, 34vw, 560px);
  max-height: 96px;
  object-fit: contain;
  object-position: center;
  display: block;
}
@media (min-width: 768px) and (max-width: 1023px) {
  .desktop-logo-img {
    width: clamp(340px, 42vw, 420px);
    max-height: 84px;
  }
}

/* FOOTER */
.footer-logo-img {
  max-height: 64px;
  width: auto;
  object-fit: contain;
}

/* ====================================================================
 * 3. Mobile header
 * ================================================================ */
.utility-bar {
  height: var(--header-mobile-utility-height);
  background: var(--color-navy);
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: var(--fs-micro);
  letter-spacing: 0.1px;
}
.utility-bar .dot {
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--color-gold);
  margin: 0 6px;
}
.utility-bar a { color: inherit; }

.main-header {
  height: var(--header-mobile-main-height);
  display: grid;
  grid-template-columns: 48px 1fr 80px;
  align-items: center;
  padding: 0 12px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-logo-link {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}
.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none;
  border-radius: var(--radius);
  color: var(--color-navy);
}
.icon-btn:hover { background: var(--color-surface); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.main-header__actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

/* ====================================================================
 * 4. Desktop masthead
 * ================================================================ */
.desktop-utility-bar {
  height: var(--header-desktop-utility-height);
  background: var(--color-navy);
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  font-size: var(--fs-time);
}
.desktop-utility-bar a { color: inherit; }

.desktop-masthead {
  height: var(--header-desktop-masthead-height);
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  align-items: center;
  padding: 0 48px;
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-navy);
}
.desktop-logo-wrap {
  grid-column: 2;
  display: flex;
  justify-content: center;
  align-items: center;
}
.desktop-actions {
  grid-column: 3;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.category-nav {
  background: var(--color-navy);
  color: #fff;
  height: var(--nav-desktop-height);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 0 40px;
  font-family: var(--font-display);
  font-size: 14.5px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.category-nav .item { color: #fff; opacity: 0.92; }
.category-nav .item:hover { opacity: 1; }
.category-nav .item.active { color: var(--color-gold); opacity: 1; }
.category-nav .latest {
  margin-left: auto;
  color: var(--color-gold);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ====================================================================
 * 5. Breaking strip
 * ================================================================ */
.breaking-strip {
  height: var(--breaking-strip-height);
  background: var(--color-red);
  color: #fff;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.breaking-strip .tag {
  background: #fff;
  color: var(--color-red);
  font-weight: 700;
  font-size: 11px;
  padding: 4px 9px;
  margin: 0 10px 0 14px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.breaking-strip .tag::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-red);
  animation: breaking-pulse 1.6s infinite;
}
@keyframes breaking-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}
.breaking-strip .ticker {
  flex: 1;
  display: flex;
  gap: 26px;
  white-space: nowrap;
  overflow: hidden;
  padding-right: 16px;
  font-weight: 500;
  font-size: 13.5px;
}
.breaking-strip .ticker a { color: inherit; }
.breaking-strip .ticker .sep {
  align-self: center;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
}

/* ====================================================================
 * 6. Top stories grid
 * ================================================================ */
.top-stories {
  padding: 14px 16px 0;
}

.lead-story {
  background: var(--color-pink-soft);
  border: 1px solid var(--color-pink-deep);
  border-radius: var(--radius-lg);
  padding: 14px;
}
.lead-story__img {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: var(--color-surface);
  overflow: hidden;
}
.lead-story__img img { width: 100%; height: 100%; object-fit: cover; }
.lead-story__meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px;
}
.lead-story__headline {
  font-family: var(--font-display);
  font-size: var(--fs-h1-mobile);
  line-height: var(--lh-h1);
  color: var(--color-text);
  margin: 8px 0 6px;
  letter-spacing: var(--tracking-h1);
}
.lead-story__summary {
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--color-text-soft);
}

@media (min-width: 1024px) {
  .top-stories {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    padding: 0;
  }
  .lead-story__headline {
    font-size: var(--fs-h1-desktop);
    line-height: 1.22;
  }
  .top-stories__secondary {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
}

/* ====================================================================
 * 7. Story card — horizontal (lists)
 * ================================================================ */
.card-horiz {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--divider);
  align-items: flex-start;
}
.card-horiz:last-child,
.card-horiz--noborder { border-bottom: none; }
.card-horiz__img {
  width: 120px; height: 84px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  overflow: hidden;
}
.card-horiz__img img { width: 100%; height: 100%; object-fit: cover; }
.card-horiz__body {
  display: flex; flex-direction: column;
  gap: 6px; min-width: 0;
}
.card-horiz__headline {
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  line-height: var(--lh-tight);
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-horiz__meta {
  display: flex; align-items: center;
  gap: 6px;
  margin-top: auto;
  font-size: var(--fs-time);
  color: var(--color-muted);
}

/* Compact variant — image-on-top for desktop hero secondary slots / trending */
.card-compact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--divider);
}
.card-compact:last-child { border-bottom: none; }
.card-compact__img {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: var(--color-surface);
  overflow: hidden;
}
.card-compact__img img { width: 100%; height: 100%; object-fit: cover; }
.card-compact__headline {
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  line-height: var(--lh-tight);
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-compact__meta {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-time);
  color: var(--color-muted);
}

/* ====================================================================
 * 8. Pill (category badge)
 * ================================================================ */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-meta);
  font-weight: 500;
  letter-spacing: 0.1px;
  white-space: nowrap;
  background: var(--color-pink);
  color: var(--color-red-deep);
}
.pill--navy   { background: var(--color-navy);  color: #fff; }
.pill--cherry { background: var(--color-red);   color: #fff; }
.pill--ghost  { background: transparent; padding-left: 0; color: var(--color-red-deep); }
.pill--outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-soft);
}

/* ====================================================================
 * 9. Section header
 * ================================================================ */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 18px 16px 10px;
  border-bottom: 2px solid var(--color-navy);
  margin: 8px 0 12px;
}
.section-head__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-navy);
  letter-spacing: -0.2px;
  display: inline-flex; align-items: center; gap: 8px;
}
.section-head__title::before {
  content: '';
  width: 4px; height: 16px;
  background: var(--color-red);
  border-radius: 1px;
  display: inline-block;
}
.section-head__more {
  font-size: var(--fs-time);
  font-weight: 500;
  color: var(--color-red-deep);
}

/* ====================================================================
 * 10. Article body
 * ================================================================ */
.article-body p {
  font-family: var(--font-body);
  font-size: var(--fs-article-body-mobile);
  line-height: var(--lh-body);
  color: var(--color-text);
  margin: 0 0 18px;
  text-wrap: pretty;
}
@media (min-width: 768px) {
  .article-body p { font-size: var(--fs-article-body-desktop); }
}
.article-body p:first-of-type::first-letter { font-weight: 700; }
.article-body h2 {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.4;
  color: var(--color-navy);
  margin: 24px 0 10px;
}

.key-points {
  background: var(--color-pink-soft);
  border-left: 3px solid var(--color-red);
  padding: 14px 14px 14px 16px;
  margin: 18px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.key-points__label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-navy);
  letter-spacing: 0.2px;
  margin-bottom: 8px;
}
.key-points ul { margin: 0; padding-left: 18px; list-style: none; }
.key-points li {
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--color-text);
  margin-bottom: 6px;
  position: relative;
  padding-left: 4px;
}
.key-points li::before {
  content: '\25CF';                       /* ● */
  color: var(--color-red);
  position: absolute;
  left: -16px;
  top: 1px;
  font-size: 10px;
}

/* ====================================================================
 * 11. Recommended articles
 * ================================================================ */
.recommended {
  margin-top: 24px;
}
.recommended__head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent, var(--color-red));
  margin-bottom: 12px;
}
.recommended__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--color-navy);
}
.recommended__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.recommended--related   { --accent: var(--color-navy); }
.recommended--for-you   { --accent: var(--color-red); }
.recommended--also-read { --accent: var(--color-gold); }
.recommended--top-news  { --accent: var(--color-red-deep); }

/* ====================================================================
 * 12. Wrappers (content + article)
 * ================================================================ */
.content-wrap {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 16px 16px 28px;
}
@media (min-width: 1024px) {
  .content-wrap {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 36px;
    padding: 28px 40px 36px;
  }
}

.article-wrap {
  max-width: var(--article-max-width);
  margin: 0 auto;
  padding: 28px 16px;
}
@media (min-width: 1024px) {
  .article-wrap { padding: 28px 40px; }
}

/* ====================================================================
 * Section blocks (homepage "ఆంధ్రప్రదేశ్", "తెలంగాణ" etc.)
 * Not formally in CSS_IMPLEMENTATION.md but specified by ROUTE_IMPLEMENTATION.md
 * and the reference desktop HTML; uses section-head + card-horiz primitives.
 * ================================================================ */
.section-block {
  margin: 16px 0 0;
  padding: 0 16px;
}
.section-block__list { display: flex; flex-direction: column; }
@media (min-width: 768px) {
  .section-block { padding: 0; }
  .section-block--mini-grid .section-block__list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
  }
}

/* 60-second rail — horizontal scroll on mobile, grid on desktop */
.sixty-rail {
  margin-top: 12px;
}
.sixty-rail__head {
  padding: 14px 16px 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.sixty-rail__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--color-navy);
}
.sixty-rail__list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 16px 18px;
  -webkit-overflow-scrolling: touch;
}
.sixty-rail__list::-webkit-scrollbar { display: none; }
.sixty-rail__card {
  flex: 0 0 78%;
  scroll-snap-align: start;
  background: var(--color-bg-warm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
}
.sixty-rail__num {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
  color: var(--color-red);
}
.sixty-rail__body { min-width: 0; }
.sixty-rail__headline {
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  color: var(--color-text);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sixty-rail__summary {
  font-size: var(--fs-meta);
  color: var(--color-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (min-width: 1024px) {
  .sixty-rail__list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    overflow: visible;
    padding: 4px 0 18px;
  }
  .sixty-rail__card { flex: 1 1 auto; }
}

/* ====================================================================
 * Footer (navy)
 * ================================================================ */
.site-footer {
  background: var(--color-navy);
  color: rgba(255, 255, 255, 0.86);
  padding: 28px 16px 24px;
  margin-top: 32px;
  font-size: var(--fs-body);
}
.site-footer a { color: inherit; }
.site-footer a:hover { color: var(--color-gold); }

.site-footer__logo-tile {
  background: #fff;
  border-radius: var(--radius);
  padding: 10px 14px;
  display: inline-block;
  margin-bottom: 16px;
}
.site-footer__logo-tile img { display: block; }
.site-footer__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
  margin-bottom: 18px;
}
.site-footer__col-title {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--color-gold);
  letter-spacing: 0.4px;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.site-footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--fs-meta);
}
.site-footer__legal {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 14px;
  font-size: var(--fs-time);
  color: rgba(255, 255, 255, 0.72);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
@media (min-width: 1024px) {
  .site-footer {
    padding: 36px 40px 28px;
  }
  .site-footer__inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
  }
  .site-footer__cols {
    grid-template-columns: 320px 1fr 1fr 1fr;
    gap: 40px;
  }
  .site-footer__legal {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* ====================================================================
 * Bottom nav (mobile sticky)
 * ================================================================ */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--bottom-nav-height);
  background: #fff;
  border-top: 1px solid var(--color-border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 20;
}
.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--color-muted);
  font-size: var(--fs-micro);
  font-family: var(--font-ui);
  text-decoration: none;
}
.bottom-nav__item.active { color: var(--color-red); }
.bottom-nav__icon {
  width: 20px; height: 20px;
  display: inline-block;
}
body.has-bottom-nav { padding-bottom: var(--bottom-nav-height); }
@media (min-width: 768px) {
  .bottom-nav { display: none; }
  body.has-bottom-nav { padding-bottom: 0; }
}

/* ====================================================================
 * Article page additional pieces (hero figure, subhead, byline, sticky bar)
 * ================================================================ */
.article-pill-row {
  display: flex; align-items: center; gap: 10px;
  font-size: var(--fs-meta);
  color: var(--color-muted);
  margin-bottom: 10px;
}
.article-title {
  font-family: var(--font-display);
  font-size: var(--fs-h1-mobile);
  line-height: var(--lh-h1);
  color: var(--color-text);
  letter-spacing: var(--tracking-h1);
  margin: 0 0 8px;
}
@media (min-width: 768px) {
  .article-title { font-size: var(--fs-h1-desktop); }
}
.article-subhead {
  font-family: var(--font-body);
  font-size: var(--fs-h4);
  color: var(--color-text-soft);
  line-height: 1.5;
  margin: 0 0 14px;
}
.article-byline-row {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-time);
  color: var(--color-muted);
  border-bottom: 1px solid var(--divider);
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.article-hero figure { margin: 0 0 18px; }
.article-hero img {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--color-surface);
}
.article-hero figcaption {
  margin-top: 8px;
  font-size: var(--fs-time);
  color: var(--color-muted);
  font-style: italic;
}

.sixty-block {
  background: var(--color-navy);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin: 16px 0 22px;
}
.sixty-block__label {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 6px;
}
.sixty-block__body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
}

.article-action-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border-top: 1px solid var(--color-border);
  padding: 6px 0;
  z-index: 20;
}
.article-action-bar__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--color-text-soft);
  font-size: var(--fs-micro);
  background: transparent;
  border: none;
}
@media (min-width: 768px) {
  .article-action-bar { display: none; }
}

/* ====================================================================
 * Visually hidden (accessibility) — used for hidden H1 on homepage etc.
 * ================================================================ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
