/* Category archive + search results list */

/* ==========================================================================
   FINANCIAL TIMES CATEGORY PAGE STYLES (مجلة التجارة)
   ========================================================================== */

.category-main-wrapper {
  /* Same top inset as .hero-section (home) and .issues-page-header (issues). */
  padding-top: 24px;
  padding-bottom: 60px;
}

/* 1. Category Header */
.category-header-wrap {
  margin-bottom: 24px;
}

.category-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.category-title-main {
  font-size: 24px;
  font-weight: 800;
  color: #262A33;
  letter-spacing: -0.5px;
  margin: 0;
  line-height: 1.2;
}

.btn-follow-cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: transparent;
  border: 1.5px solid var(--color-brand, #1897B8);
  color: var(--color-brand, #1897B8);
  border-radius: 24px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-follow-cat:hover {
  background: var(--color-brand, #1897B8);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(24, 151, 184, 0.2);
}

.btn-follow-cat.is-following {
  background: #262A33;
  border-color: #262A33;
  color: #ffffff;
}

/* Sub-category Filter Pills */
.category-subnav-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
  border-bottom: 1px solid #ebd9c8;
  padding-bottom: 14px;
}

.category-subnav-pills::-webkit-scrollbar {
  display: none;
}

.cat-sub-pill {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  color: #555555;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.cat-sub-pill:hover {
  color: var(--color-brand, #1897B8);
  background: rgba(24, 151, 184, 0.06);
}

.cat-sub-pill.active {
  background: #262A33;
  color: #ffffff;
  font-weight: 700;
}

/* 2. Top Grid: Hero (Latest Article) + Recommended
   Hero height matches the 3-item sidebar band; same height when sidebar is hidden. */
.cat-top-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  margin-top: 24px;
  margin-bottom: 40px;
}

/* First module: page padding already supplies the 24px top inset. */
.category-main-wrapper > .altijara-block:first-of-type > .cat-top-grid,
.category-main-wrapper > .cat-top-grid:first-child {
  margin-top: 0;
}

/* Recommended lives inside the hero card, so the outer grid is a single column. */
.cat-top-grid:not(.is-hero-full):not(.is-hero-solo):has(.cat-recommended-col) {
  grid-template-columns: 1fr;
}

.cat-top-grid.is-hero-full,
.cat-top-grid.is-hero-solo,
.cat-top-grid:not(:has(.cat-recommended-col)) {
  grid-template-columns: 1fr;
}

.cat-top-grid.is-hero-full .cat-recommended-col,
.cat-top-grid.is-hero-solo .cat-recommended-col {
  display: none;
}

.cat-top-grid.is-hero-full .cat-hero-card,
.cat-top-grid.is-hero-solo .cat-hero-card,
.cat-top-grid:not(:has(.cat-recommended-col)) .cat-hero-card {
  width: 100%;
  max-width: 100%;
  grid-column: 1 / -1;
  /* Same photo width as the three-column hero; the title takes the side-column space. */
  grid-template-columns: minmax(0, 1fr) minmax(0, 44%);
  gap: 0 100px;
}

.cat-top-grid.is-hero-full .cat-hero-headline,
.cat-top-grid.is-hero-solo .cat-hero-headline,
.cat-top-grid:not(:has(.cat-recommended-col)) .cat-hero-headline {
  font-size: 22px;
}

/* Hero Box (Latest Article - Editorial Card).
   Full-width and with-recommended use this same card. The side column is the only extra track. */
.cat-hero-card {
  background: #F2DFCE;
  border: 1px solid #ebd9c8;
  border-radius: 6px;
  padding-block: 16px;
  padding-inline: 20px;
  display: grid;
  /* Text, then image. The recommended column adds a third track on the same card. */
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.5fr);
  gap: 0 20px;
  align-items: center;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cat-hero-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  border-color: rgba(24, 151, 184, 0.35);
}

.cat-hero-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 0;
  min-width: 0;
}

.cat-kicker-tag {
  font-size: 12px;
  font-weight: 800;
  color: var(--color-brand, #1897B8);
  letter-spacing: 0.2px;
  margin-bottom: 8px;
  display: inline-block;
}

.cat-hero-headline {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  color: #262A33;
  margin: 0 0 12px;
}

.cat-hero-headline a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  max-height: calc(1.35em * 3);
}

.cat-hero-headline a:hover {
  color: var(--color-brand, #1897B8);
}

.cat-hero-synopsis {
  font-size: 13.5px;
  color: #555555;
  line-height: 1.6;
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
}

.cat-hero-meta {
  font-size: 11.5px;
  font-weight: 700;
  color: #888888;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 0;
}

.cat-hero-meta span.lead-time {
  letter-spacing: 0.5px;
}

.cat-hero-img-wrap {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  min-height: 0;
  align-self: start;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  background: #e2e8f0;
}

.cat-hero-img-wrap a {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  height: 100%;
  position: relative;
}

.cat-hero-img-wrap a,
.cat-hero-img-wrap img {
  min-height: 0;
}

.cat-hero-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.35s ease;
}

.cat-hero-card:hover .cat-hero-img-wrap img {
  transform: scale(1.03);
}

/* Recommended column inside the hero card.
   Title is the first flex item, so it sits on the right in RTL and on the left in LTR. */
.cat-top-grid:not(.is-hero-full):not(.is-hero-solo) .cat-hero-card:has(.cat-recommended-col) {
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.5fr) minmax(280px, 32%);
  align-items: stretch;
}

.cat-top-grid:not(.is-hero-full):not(.is-hero-solo) .cat-hero-card:has(.cat-recommended-col) .cat-hero-info {
  align-self: center;
  padding-block: 4px;
}

.cat-top-grid:not(.is-hero-full):not(.is-hero-solo) .cat-hero-card:has(.cat-recommended-col) .cat-hero-img-wrap {
  /* Same box on every category. Source aspect ratio must not stretch the hero. */
  height: auto;
  aspect-ratio: 3 / 2;
  min-height: 0;
  align-self: start;
  margin-block: 0;
}

.cat-top-grid:not(.is-hero-full):not(.is-hero-solo) .cat-hero-card:has(.cat-recommended-col) .cat-recommended-col {
  align-self: stretch;
  height: 0;
  min-height: 100%;
  overflow: hidden;
  margin: 0;
  border-radius: 4px;
}

.cat-recommended-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  background: #FFF7EF;
  padding: 16px 16px 12px;
  border-radius: 4px;
}

.cat-rec-header {
  border-top: 1px solid rgba(38, 42, 51, 0.16);
  padding-top: 10px;
  margin-bottom: 16px;
}

.cat-rec-title {
  font-size: 16px;
  font-weight: 800;
  color: #262A33;
  margin: 0;
}

.cat-rec-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cat-rec-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid #ebd9c8;
}

.cat-rec-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cat-rec-img {
  width: 85px;
  height: 85px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: #e2e8f0;
}

.cat-rec-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: start;
}

.cat-rec-kicker {
  font-size: 11px;
  font-weight: 800;
  color: var(--color-brand, #1897B8);
  margin-bottom: 4px;
}

.cat-rec-headline {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: #262A33;
  margin: 0 0 6px;
}

.cat-rec-headline a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-height: calc(1.4em * 2);
}

.cat-rec-headline a:hover {
  color: var(--color-brand, #1897B8);
}

.cat-rec-time {
  font-size: 11px;
  font-weight: 600;
  color: #888888;
}

/* 3. Featured 4-Column Cards Row (FT Reference Style) */
.cat-featured-row-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 30px 0 36px;
  padding: 0;
  border: none;
  text-align: start;
  font-family: var(--font-main);
}

.cat-featured-card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-card);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 6px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

.cat-featured-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.cat-featured-img-link {
  display: block;
  text-decoration: none;
}

.cat-featured-img-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 4px;
  overflow: hidden;
  background: #e2e8f0;
  margin-bottom: 12px;
  position: relative;
}

.cat-featured-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.cat-featured-card:hover .cat-featured-img-wrap img {
  transform: scale(1.04);
}

.cat-featured-body {
  display: flex;
  flex-direction: column;
}

.cat-featured-tag {
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 700;
  color: #0d7696;
  margin-bottom: 8px;
  display: inline-block;
  line-height: 1.2;
}

.cat-featured-tag.tag-accent {
  color: #b02a37;
}

.cat-featured-title {
  font-family: var(--font-main);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.35;
  color: #262A33;
  margin: 0;
  text-align: start;
}

.cat-featured-title a {
  color: #262A33;
  text-decoration: none;
  transition: color 0.15s ease;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-height: calc(1.35em * 2);
}

.cat-featured-title a:hover {
  color: #0d7696;
}

.cat-featured-date {
  display: block;
  margin-top: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #888888;
}

.cat-quote-mark {
  color: #0d7696;
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 800;
  margin-inline-end: 4px;
  line-height: 1;
  display: inline-block;
}

.cat-big-read-prefix {
  font-weight: 800;
  color: #262A33;
  margin-inline-end: 4px;
}

/* 4. Lower Section: News List + Sidebar Column
   Same 4-col track + gap as .cat-featured-row-4col so sidebar
   shares the start/end edges of the 4th featured card */
.cat-editorial-lower-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  margin-top: 40px;
}

.cat-news-col {
  grid-column: span 3;
  min-width: 0;
}

.cat-editorial-lower-grid.is-sidebar-hidden .cat-news-col {
  grid-column: 1 / -1;
}

.cat-opinion-col {
  grid-column: span 1;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: stretch;
}

/* Line above the ad shares the same top edge as the line above أحدث الأخبار.
   The space under that line matches the 28px gap under the ad. */
.cat-opinion-col:has(> .cat-sidebar-ad-widget:first-child) {
  border-top: 1px solid rgba(38, 42, 51, 0.16);
  padding-top: 28px;
}

/* News List Column */
.cat-section-bar {
  border-top: 1px solid rgba(38, 42, 51, 0.16);
  padding-top: 8px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cat-section-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--ink-black);
  margin: 0;
}

.cat-news-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cat-news-item {
  display: flex;
  gap: 20px;
  padding: 28px 0;
  border-bottom: 1px solid #ebd9c8;
  align-items: flex-start;
  transition: background 0.15s ease;
}

.cat-news-item:hover {
  background: rgba(0, 0, 0, 0.015);
}

.cat-news-img-wrap {
  width: 140px;
  height: 95px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #e2e8f0;
}

.cat-news-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.cat-news-item:hover .cat-news-img-wrap img {
  transform: scale(1.04);
}

.cat-news-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cat-news-kicker {
  display: none;
}

.cat-news-headline {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
  color: #262A33;
  margin: 0 0 6px;
  width: 68%;
  margin-inline-end: auto;
}

.cat-news-headline a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
  display: block;
  text-align: start;
}

.cat-news-headline a:hover {
  color: var(--color-brand, #1897B8);
}

.cat-news-excerpt {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  margin: 0 0 10px;
  max-width: 72%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cat-news-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cat-news-tags-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-badge-updated {
  display: none;
}

.cat-news-time {
  font-size: 11px;
  font-weight: 600;
  color: #888888;
}

.btn-cat-save {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  margin-inline-end: 36px;
  border-radius: 4px;
  transition: all 0.15s;
}

.btn-cat-save:hover {
  color: var(--color-brand, #1897B8);
  background: rgba(24, 151, 184, 0.08);
}

.btn-cat-save.saved {
  color: var(--color-brand, #1897B8);
}

/* Category Pagination (AJAX, design: < 3 2 1 >) */
.cat-pagination-wrap[hidden] {
  display: none !important;
}

.cat-pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 32px 0 10px;
  flex-wrap: wrap;
  direction: ltr;
}

.cat-page-numbers {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  flex-direction: row-reverse;
}

.cat-page-btn,
.cat-page-num {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #262A33;
  font-size: 14px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  text-decoration: none;
}

.cat-page-btn[aria-disabled="true"] {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
  background: #f8fafc;
}

.cat-page-btn:hover:not(:disabled),
.cat-page-num:hover:not(.is-active) {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.cat-page-num.is-active {
  background: #262A33;
  border-color: #262A33;
  color: #ffffff;
  cursor: default;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.cat-page-btn:disabled,
.cat-page-btn[aria-disabled="true"] {
  opacity: 0.35;
  cursor: default;
  background: #f8fafc;
  box-shadow: none;
}

.cat-pagination-wrap.is-loading {
  pointer-events: none;
}

.cat-page-ellipsis {
  min-width: 24px;
  text-align: center;
  color: #94a3b8;
  font-weight: 700;
  font-size: 13px;
  user-select: none;
}

/* News list skeleton while AJAX paging */
.cat-news-list.is-loading {
  min-height: 280px;
}

.cat-news-skel .cat-news-content {
  gap: 10px;
}

.cat-news-skel .sk-thumb,
.cat-news-skel .sk-line {
  display: block;
  background: linear-gradient(90deg, #efe6dc 25%, #f7f1ea 50%, #efe6dc 75%);
  background-size: 200% 100%;
  animation: altijara-skel 1.1s ease-in-out infinite;
  border-radius: 4px;
}

.cat-news-skel .sk-thumb {
  width: 100%;
  height: 100%;
}

.cat-news-skel .sk-line {
  height: 12px;
  width: 92%;
}

.cat-news-skel .sk-line--title {
  height: 16px;
  width: 70%;
}

.cat-news-skel .sk-line--short {
  width: 55%;
}

.cat-news-skel .sk-line--meta {
  width: 28%;
  height: 10px;
  margin-top: 4px;
}

@keyframes altijara-skel {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Legacy load-more (kept for other pages that reuse the class) */
.cat-load-more-wrap {
  text-align: center;
  margin: 32px 0 10px;
}

.btn-cat-load-more {
  padding: 10px 28px;
  background: transparent;
  border: 1.5px solid #262A33;
  color: #262A33;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}

.btn-cat-load-more:hover {
  background: #262A33;
  color: #ffffff;
}

/* Sidebar Column */
.cat-opinion-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cat-opinion-card {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid #ebd9c8;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease;
}

.cat-opinion-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.cat-author-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.cat-author-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--color-brand, #1897B8);
}

.cat-author-info {
  display: flex;
  flex-direction: column;
}

.cat-author-name {
  font-size: 13px;
  font-weight: 800;
  color: #262A33;
}

.cat-author-role {
  font-size: 11px;
  color: #888888;
}

.cat-opinion-headline {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.45;
  color: #262A33;
  margin: 0 0 8px;
}

.cat-opinion-headline a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

.cat-opinion-headline a:hover {
  color: var(--color-brand, #1897B8);
}

.cat-opinion-excerpt {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.5;
  margin: 0;
}

/* Magazine Reader Widget (Flipbook style matching reference) */
.mag-reader-widget {
  background: transparent;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  border: none;
  width: 100%;
  max-width: none;
  margin: 0;
}

.mag-reader-header {
  background: transparent;
  padding: 8px 0 0;
  text-align: start;
  border-top: 1px solid rgba(38, 42, 51, 0.16);
  border-bottom: none;
  margin-bottom: 8px;
}

.mag-reader-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink-black);
  letter-spacing: 0;
}

.mag-reader-body {
  display: block;
  background: transparent;
  padding: 0;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  border-radius: 0;
}

.mag-reader-viewport {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mag-cover-frame {
  position: relative;
  width: 82%;
  max-width: 235px;
  aspect-ratio: 1043 / 1280;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-card);
}

.mag-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.mag-reader-body:hover .mag-cover-img {
  transform: scale(1.02);
}

.mag-expand-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.mag-expand-box {
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.78);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, background 0.2s ease;
}

.mag-reader-body:hover .mag-expand-box {
  transform: scale(1.08);
  background: rgba(24, 151, 184, 0.95);
}

.mag-reader-arrow {
  position: absolute;
  inset-inline-start: 2px;
  top: 50%;
  transform: translateY(-50%);
  color: #262A33;
  opacity: 0.55;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.mag-reader-body:hover .mag-reader-arrow {
  color: var(--color-brand, #1897B8);
  opacity: 1;
  transform: translateY(-50%) translateX(2px);
}

html:not([dir="rtl"]) .mag-reader-body:hover .mag-reader-arrow {
  transform: translateY(-50%) translateX(-2px);
}

.mag-reader-qr {
  position: absolute;
  inset-inline-start: 4px;
  bottom: -4px;
  color: #262A33;
  opacity: 0.5;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.mag-reader-body:hover .mag-reader-qr {
  color: var(--color-brand, #1897B8);
  opacity: 0.9;
}

/* Commercial Sidebar Ad Widgets (Natural Image Ratio) */
.cat-sidebar-ad-widget {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  margin: 0;
  background: var(--bg-card);
  border: 1px solid #ebd9c8;
  border-radius: 6px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cat-sidebar-ad-widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  border-color: rgba(24, 151, 184, 0.3);
}

.cat-sidebar-ad-label {
  font-size: 11px;
  font-weight: 700;
  color: #888888;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 2px;
}

.cat-sidebar-ad-badge {
  font-size: 9.5px;
  font-weight: 600;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.2px;
}

.cat-sidebar-ad-link {
  display: block;
  width: 100%;
  border-radius: 4px;
  overflow: hidden;
  line-height: 0;
}

.cat-sidebar-ad-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 4px;
  transition: transform 0.3s ease;
}

.cat-sidebar-ad-link:hover .cat-sidebar-ad-img {
  transform: scale(1.02);
}

.cat-sidebar-ad-shortcode {
  width: 100%;
  line-height: 0;
}

.cat-sidebar-ad-shortcode > * {
  max-width: 100%;
  height: auto;
}

.cat-sidebar-ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  width: 100%;
  border-radius: 4px;
  background: repeating-linear-gradient(
    -45deg,
    #f3ebe3,
    #f3ebe3 8px,
    #ebe0d4 8px,
    #ebe0d4 16px
  );
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.cat-new-issue-widget {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.cat-new-issue-bar {
  border-top: 1px solid rgba(38, 42, 51, 0.16);
  padding-top: 10px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.cat-new-issue-bar .cat-section-title {
  color: var(--ink-black);
  font-size: 16px;
  font-weight: 800;
  margin: 0;
}

.cat-new-issue-arrows {
  display: flex;
  align-items: center;
  gap: 8px;
  direction: ltr;
  flex-shrink: 0;
}

.cat-new-issue-arrow {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #fff;
  border: 1.5px solid #d4d4d8;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.cat-new-issue-arrow i,
.cat-new-issue-arrow svg {
  font-size: 13px;
  line-height: 1;
  pointer-events: none;
  display: block;
}

.cat-new-issue-arrow:hover,
.cat-new-issue-arrow.is-accent {
  border-color: var(--color-brand, #1897B8);
  color: var(--color-brand, #1897B8);
}

.cat-new-issue-arrow:disabled {
  opacity: 0.4;
  cursor: default;
}

.cat-new-issue-list {
  width: 100%;
}

/* Shared shimmer (magazine cover + other placeholders) */
.sk {
  display: block;
  background: linear-gradient(90deg, #efe4d6 25%, #f7efe6 50%, #efe4d6 75%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.2s ease-in-out infinite;
  border-radius: 6px;
}

@keyframes sk-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.sk-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 4px;
}

.cat-new-issue-cover {
  display: block;
  position: relative;
  width: 100%;
  margin-inline: auto;
  border-radius: 4px;
  overflow: hidden;
  line-height: 0;
  background: transparent;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.cat-new-issue-cover .sk-cover {
  position: relative;
  z-index: 1;
  opacity: 1;
  transition: none;
}

.cat-new-issue-cover.is-ready .sk-cover {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.cat-new-issue-cover img {
  position: relative;
  width: 100%;
  height: auto;
  display: block;
  opacity: 0;
  transition: none;
}

.cat-new-issue-cover.is-ready img {
  opacity: 1;
  transition: opacity 0.28s ease;
}

/* Instant skeleton while next cover loads (no fade-in delay) */
.cat-new-issue-cover.is-switching {
  min-height: 0;
}

.cat-new-issue-cover.is-switching .sk-cover {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 1;
  transition: none;
  pointer-events: none;
}

.cat-new-issue-cover.is-switching img {
  opacity: 0;
  transition: none;
}

/* Most Read Section (Financial Times Style matching reference) */
.cat-most-read-widget {
  width: 100%;
  max-width: none;
  margin: 0;
}

.cat-mr-bar {
  border-top: 1px solid rgba(38, 42, 51, 0.16);
  padding-top: 8px;
  margin-bottom: 6px;
}

.cat-most-read-widget .cat-mr-empty {
  width: 100%;
  margin-top: 12px;
}

.cat-mr-list[hidden] {
  display: none !important;
}

.cat-mr-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.cat-mr-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #ebd9c8;
}

.cat-mr-item:last-child {
  border-bottom: 1px solid #ebd9c8;
}

.cat-mr-num {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-size: 26px;
  font-weight: 700;
  color: #00000085;
  line-height: 1.1;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.cat-mr-content {
  flex: 1;
}

.cat-mr-headline {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.45;
  margin: 0;
}

.cat-mr-headline a {
  color: #1e293b;
  text-decoration: none;
  transition: color 0.2s ease;
}

.cat-mr-headline a:hover {
  color: var(--color-brand, #1897B8);
}

.cat-mr-quote-icon {
  color: var(--color-brand, #1897B8);
  font-family: var(--font-serif, Georgia, serif);
  font-size: 22px;
  font-weight: 800;
  margin-inline-end: 4px;
  display: inline-block;
  vertical-align: top;
  line-height: 1;
}

.cat-mr-author {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-top: 4px;
}

/* Selected Reads (قراءات مختارة) */
.cat-selected-reads-widget {
  width: 100%;
  max-width: none;
  margin: 0;
}

.cat-sel-bar {
  border-top: 1px solid rgba(38, 42, 51, 0.16);
  padding-top: 10px;
  margin-bottom: 16px;
}

.cat-sel-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.cat-sel-card {
  display: flex;
  flex-direction: column;
}

.cat-sel-thumb-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
  background-color: #ede3d7;
  position: relative;
}

.cat-sel-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.cat-sel-card:hover .cat-sel-thumb-wrap img {
  transform: scale(1.04);
}

.cat-hero-img-wrap a > *,
.cat-featured-img-wrap > *,
.cat-sel-thumb-wrap > *,
.chamber-item-thumb > *,
.bottom-card-img-wrap > * {
  grid-area: 1 / 1;
  min-width: 0;
  min-height: 0;
}

/* .cat-video-play-badge base styles live in base.css */

.chamber-item-thumb,
.bottom-card-img-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  position: relative;
}

.cat-sel-card:hover .cat-video-play-badge {
  background: var(--color-brand, #1897B8);
  transform: scale(1.1);
}

.cat-sel-content {
  display: flex;
  flex-direction: column;
}

.cat-sel-kicker {
  font-size: 11.5px;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 4px;
}

.cat-sel-kicker-opinion {
  color: #c53030;
}

.cat-sel-kicker-video {
  color: #c53030;
}

.cat-sel-kicker-interview {
  color: var(--color-brand, #1897B8);
}

.cat-sel-meta-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.cat-sel-duration {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.cat-sel-headline {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.45;
  margin: 0;
  color: #1e293b;
}

.cat-sel-headline a {
  color: #1e293b;
  text-decoration: none;
  transition: color 0.15s ease;
}

.cat-sel-headline a:hover {
  color: var(--color-brand, #1897B8);
}

/* Category & Home Responsive Breakpoints */
@media (max-width: 1024px) {
  .cat-hero-card,
  .cat-top-grid.is-hero-full .cat-hero-card,
  .cat-top-grid.is-hero-solo .cat-hero-card,
  .cat-top-grid:not(.is-hero-full):not(.is-hero-solo) .cat-hero-card:has(.cat-recommended-col) {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
  .cat-hero-info,
  .cat-top-grid:not(.is-hero-full):not(.is-hero-solo) .cat-hero-card:has(.cat-recommended-col) .cat-hero-info {
    padding-block: 0;
  }
  .cat-hero-img-wrap,
  .cat-top-grid.is-hero-full .cat-hero-img-wrap,
  .cat-top-grid.is-hero-solo .cat-hero-img-wrap,
  .cat-top-grid:not(.is-hero-full):not(.is-hero-solo) .cat-hero-card:has(.cat-recommended-col) .cat-hero-img-wrap {
    order: -1;
    height: 270px;
    aspect-ratio: auto;
    min-height: 0;
    margin-block: 0;
  }
  .cat-top-grid:not(.is-hero-full):not(.is-hero-solo) .cat-hero-card:has(.cat-recommended-col) .cat-recommended-col {
    border-radius: 4px;
    margin: 0;
    height: auto;
    min-height: 0;
  }
}

@media (max-width: 960px) {
  .cat-top-grid,
  .cat-editorial-lower-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .cat-news-col,
  .cat-opinion-col {
    grid-column: span 1;
  }
  .cat-hero-card,
  .cat-top-grid.is-hero-full .cat-hero-card,
  .cat-top-grid.is-hero-solo .cat-hero-card {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    gap: 20px;
  }
  .cat-hero-img-wrap,
  .cat-top-grid.is-hero-full .cat-hero-img-wrap {
    order: -1;
    height: 270px;
  }
  .home-split-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .sector-col,
  .sector-col:first-child,
  .sector-col:last-child {
    padding-inline: 0;
    border-inline-end: none;
  }
  .sector-col:first-child:not(:only-child) {
    border-bottom: 1px dashed rgba(0, 0, 0, 0.22);
    padding-bottom: 24px;
  }
  .dossier-cards-4col {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
  .dossier-card-item {
    border-inline-end: none;
    padding-inline-end: 0;
  }
  .cat-featured-row-4col {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 24px 0 30px;
  }
}

@media (max-width: 640px) {
  .home-split-sectors-section {
    padding: 18px 16px;
  }
  .sector-lead-card {
    flex-direction: column;
    gap: 12px;
  }
  .sector-lead-img-wrap {
    width: 100%;
    aspect-ratio: 16 / 9.5;
  }
  .sector-sub-thumb {
    width: 88px;
    height: 60px;
  }
  .category-title-main {
    font-size: 24px;
  }
  .cat-hero-headline {
    font-size: 16px;
  }
  .cat-featured-row-4col {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .cat-news-item {
    flex-direction: column;
  }
  .cat-news-img-wrap {
    width: 100%;
    height: 170px;
  }
  .cat-news-excerpt {
    max-width: 100%;
  }
  .dossier-cards-4col {
    grid-template-columns: 1fr;
  }
}



/* ---- Search archive (category-style list + live search) ---- */
.search-archive-wrapper {
  padding-top: 12px;
  padding-bottom: 48px;
}

.search-archive-header {
  margin-bottom: 8px;
}

.search-archive-title {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 800;
  color: var(--ink-black, #262A33);
  margin: 0 0 16px;
  line-height: 1.35;
}

.search-archive-form {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  max-width: none;
  margin: 4px 0 0;
  background: #fff;
  border: 1px solid rgba(38, 42, 51, 0.14);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(38, 42, 51, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-archive-form:focus-within {
  border-color: var(--color-brand, #1897B8);
  box-shadow: 0 0 0 3px rgba(24, 151, 184, 0.12);
}

.search-archive-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 14px 16px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink-black, #262A33);
  outline: none;
}

.search-archive-input::placeholder {
  color: #94a3b8;
}

.search-archive-submit {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  border: 0;
  background: var(--color-brand, #1897B8);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-archive-submit:hover,
.search-archive-submit:focus-visible {
  background: #147a96;
}

.search-archive-meta {
  margin: 12px 0 16px;
  font-size: 13px;
  color: #64748b;
}

.search-archive-empty {
  margin: 24px 0;
  padding: 20px 0;
  color: #64748b;
  font-size: 15px;
}

.search-archive-wrapper .cat-editorial-lower-grid {
  margin-top: 12px;
}

.search-archive-wrapper .cat-news-list {
  margin-top: 4px;
}

@media (max-width: 640px) {
  .search-archive-form {
    max-width: none;
  }

  .search-archive-wrapper .cat-news-item {
    flex-direction: column;
    gap: 12px;
  }

  .search-archive-wrapper .cat-news-img-wrap {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
  }
}

/* ==========================================================================
   Author profile archive
   ========================================================================== */

.author-archive-wrapper .author-profile-header {
  margin-bottom: 28px;
  padding: 22px 24px;
  background: var(--bg-card, #F2DFCE);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
}

.author-profile-identity {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.author-profile-avatar-wrap {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--color-brand, #1897B8);
  background: #1F2937;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.author-profile-avatar-wrap .author-profile-avatar,
.author-profile-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.author-profile-meta {
  min-width: 0;
  flex: 1;
}

.author-profile-name {
  margin: 0 0 8px;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.25;
  color: #262A33;
  letter-spacing: -0.02em;
}

.author-archive-wrapper .author-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(24, 151, 184, 0.12);
  color: var(--color-brand, #1897B8);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
}

.author-archive-wrapper .author-verified-badge__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.author-profile-bio {
  margin: 0;
  max-width: 42em;
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.7;
  color: #4A5568;
}

.author-archive-wrapper .cat-editorial-lower-grid {
  margin-top: 8px;
}

@media (max-width: 640px) {
  .author-archive-wrapper .author-profile-header {
    padding: 18px 16px;
  }

  .author-profile-identity {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .author-profile-avatar-wrap {
    width: 96px;
    height: 96px;
  }

  .author-profile-name {
    font-size: 1.35rem;
  }

  .author-profile-bio {
    margin-inline: auto;
  }

  .author-archive-wrapper .cat-news-item {
    flex-direction: column;
    gap: 12px;
  }

  .author-archive-wrapper .cat-news-img-wrap {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
  }
}

