/**
 * Politics & Society Magazine — issue reader, contents index, author blocks.
 * Design tokens come from reskin.css. RTL/Arabic-safe (logical properties,
 * no letter-spacing). Interaction/motion/focus handled globally in reskin.css.
 */

/* ---------- Issue masthead ---------- */
.ps-issue__header {
	margin-bottom: var(--ps-space-4, 2.5rem);
	padding-bottom: var(--ps-space-2, 1rem);
	border-bottom: 4px double var(--ps-rule-strong, #d1d5db);
}

.ps-issue__title {
	margin: .35rem 0 .4rem;
	font-size: var(--ps-step-5, 3rem);
	line-height: 1.1;
	color: var(--ps-navy, currentColor);
}

.ps-issue__meta {
	margin: 0;
	font-family: var(--ps-font-display, inherit);
	font-size: var(--ps-step-0, 1rem);
	color: var(--ps-muted, #6b7280);
}

/* ---------- Stacked reader: flipbook full-width, contents below ---------- */
.ps-issue__layout { display: block; }

.ps-issue__sidebar { margin-top: var(--ps-space-4, 2.5rem); }

/* Under the reader the index becomes a multi-column grid to use the width */
.ps-issue__sidebar .ps-issue-contents__list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: 3rem;
}
@media (max-width: 1100px) {
	.ps-issue__sidebar .ps-issue-contents__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
	.ps-issue__sidebar .ps-issue-contents__list { grid-template-columns: 1fr; }
}

.ps-issue__intro {
	margin-top: var(--ps-space-3, 1.5rem);
	line-height: 1.9;
}

/* ---------- Flipbook frame ---------- */
.ps-flipbook {
	width: 100%;
	min-height: 480px;
	background: #fff;
	border: 1px solid var(--ps-rule-strong, #d1d5db);
	border-radius: var(--ps-radius, 3px);
	box-shadow: 0 18px 48px rgba(22, 41, 63, .14);
	overflow: hidden;
}

.ps-flipbook-fallback object { display: block; border: 0; }

.ps-flipbook-notice {
	display: flex; align-items: center; justify-content: center;
	min-height: 240px; padding: 2rem;
	color: var(--ps-muted, #6b7280); text-align: center;
}

/* Caption strip under the reader */
.ps-flipbook + .ps-flipbook-hint,
.ps-issue__flipbook .ps-flipbook-hint {
	margin-top: .6rem;
	font-size: var(--ps-step--1, .85rem);
	color: var(--ps-muted, #6b7280);
}

/* ---------- Contents index: "في هذا العدد" ---------- */
.ps-issue-contents {
	background: transparent;
	border: 0;
	padding: 0;
}

.ps-issue-contents__title {
	margin: 0 0 var(--ps-space-2, 1rem);
	padding-bottom: .5rem;
	font-family: var(--ps-font-display, inherit);
	font-size: var(--ps-step-2, 1.5rem);
	color: var(--ps-navy, currentColor);
	border-bottom: 4px double var(--ps-rule-strong, #d1d5db);
}

.ps-issue-contents__list { list-style: none; margin: 0; padding: 0; }

.ps-issue-contents__item {
	display: flex;
	align-items: baseline;
	gap: .85rem;
	padding: .8rem .5rem;
	border-bottom: 1px solid var(--ps-rule, #e5e7eb);
	transition: background-color .2s ease;
}
.ps-issue-contents__item:last-child { border-bottom: 0; }
.ps-issue-contents__item:hover { background: var(--ps-paper-2, #f7f7f8); }

/* Page folio */
.ps-issue-contents__page {
	flex: 0 0 auto;
	min-width: 2.25rem;
	text-align: center;
	font-family: var(--ps-font-display, inherit);
	font-size: var(--ps-step-0, 1rem);
	font-weight: 700;
	color: var(--ps-navy, currentColor);
}

.ps-issue-contents__body { flex: 1 1 auto; }

.ps-issue-contents__article-link {
	display: block;
	font-family: var(--ps-font-display, inherit);
	font-size: var(--ps-step-1, 1.2rem);
	font-weight: 700;
	line-height: 1.4;
	text-decoration: none;
	color: var(--ps-ink, currentColor);
	transition: color .2s ease;
}
.ps-issue-contents__article-link:hover { color: var(--ps-accent-dark, currentColor); opacity: .75; }

.ps-issue-contents__authors {
	margin-top: .25rem;
	font-size: var(--ps-step--1, .9rem);
	color: var(--ps-muted, #6b7280);
}

.ps-author-link { color: var(--ps-navy, currentColor); text-decoration: none; }
.ps-author-link:hover { text-decoration: underline; }
.ps-author-external { text-decoration: none; font-size: .85em; color: var(--ps-muted, #6b7280); }

.ps-issue-contents__excerpt {
	margin: .35rem 0 0;
	font-size: var(--ps-step--1, .9rem);
	color: var(--ps-muted, #6b7280);
	line-height: 1.7;
}

.ps-issue-contents--empty { color: var(--ps-muted, #6b7280); }

/* ---------- Author box on articles ---------- */
.ps-author-box {
	margin: var(--ps-space-4, 2.5rem) 0 0;
	padding: var(--ps-space-3, 1.5rem);
	background: var(--ps-paper-2, #f7f7f8);
	border-top: 4px double var(--ps-rule-strong, #d1d5db);
}

.ps-author-box__heading {
	margin: 0 0 var(--ps-space-2, 1rem);
	font-family: var(--ps-font-display, inherit);
	font-size: var(--ps-step-1, 1.25rem);
	color: var(--ps-muted, #6b7280);
}

.ps-author-card { display: flex; gap: 1rem; margin-bottom: 1.25rem; }
.ps-author-card:last-child { margin-bottom: 0; }
.ps-author-card__avatar img {
	width: 76px; height: 76px; object-fit: cover; border-radius: 50%;
}
.ps-author-card__name {
	display: block; font-family: var(--ps-font-display, inherit);
	font-weight: 700; font-size: var(--ps-step-1, 1.2rem);
	text-decoration: none; color: var(--ps-ink, currentColor);
}
.ps-author-card__role {
	display: block; font-size: var(--ps-step--1, .9rem);
	color: var(--ps-muted, #6b7280); margin-bottom: .35rem;
}
.ps-author-card__bio { margin: .25rem 0 .5rem; line-height: 1.8; }
.ps-author-card__link { font-size: var(--ps-step--1, .9rem); color: var(--ps-navy, currentColor); text-decoration: none; }
.ps-author-card__link:hover { text-decoration: underline; }

/* Byline line injected into article content */
.ps-article-byline {
	font-family: var(--ps-font-display, inherit);
	color: var(--ps-muted, #6b7280);
	border-inline-start: 3px solid var(--ps-accent, #d1d5db);
	padding-inline-start: .75rem;
}

/* =====================================================================
 * Magazine landing — [ps_magazine_home]
 * Adaptive: navy hero when the reskin is loaded, neutral panel otherwise
 * so it blends into a host theme (e.g. Jannah on politicsociety.org).
 * =================================================================== */
.ps-home { color: inherit; }

/* ---------- Hero: featured issue ---------- */
.ps-hero {
	background: var(--ps-hero-bg, #f7f7f8);
	color: var(--ps-hero-fg, inherit);
}
.ps-hero__inner {
	max-width: var(--ps-maxw, 1200px);
	margin-inline: auto;
	padding: clamp(2rem, 4vw, 3.5rem) 1.25rem;
	display: grid;
	grid-template-columns: 1fr minmax(0, 32%);
	gap: clamp(1.5rem, 4vw, 3rem);
	align-items: center;
}
@media (max-width: 900px) { .ps-hero__inner { grid-template-columns: 1fr; } }

.ps-hero__kicker {
	display: inline-block;
	font-family: var(--ps-font-display, inherit);
	font-weight: 700;
	color: var(--ps-accent, currentColor);
	margin-bottom: .5rem;
}
.ps-hero__title {
	margin: 0 0 .7rem;
	font-family: var(--ps-font-display, inherit);
	font-size: clamp(1.9rem, 4vw, 3rem);
	line-height: 1.15;
	color: inherit;
}
.ps-hero__title a { color: inherit; text-decoration: none; }
.ps-hero__title a:hover { opacity: .8; }
.ps-hero__deck {
	margin: 0 0 1.3rem;
	font-size: 1.05rem;
	line-height: 1.9;
	color: var(--ps-hero-deck, inherit);
	max-width: 52ch;
}
.ps-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin: 0; }
.ps-hero__link {
	color: inherit; text-decoration: none;
	font-family: var(--ps-font-display, inherit); font-weight: 700;
}
.ps-hero__link:hover { opacity: .8; }
.ps-hero__cover img,
.ps-hero__cover .ps-flipbook {
	display: block; width: 100%; height: auto; border-radius: 3px;
	box-shadow: 0 18px 44px rgba(0, 0, 0, .28);
}

/* ---------- Three columns (RTL: authors | articles | index) ---------- */
.ps-cols {
	display: grid;
	grid-template-columns: 22% 46% 32%;
	max-width: var(--ps-maxw, 1200px);
	margin-inline: auto;
	padding-block: clamp(1.75rem, 3.5vw, 3rem);
}
@media (max-width: 1100px) { .ps-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px)  { .ps-cols { grid-template-columns: 1fr; } }

.ps-col {
	padding-inline: clamp(1rem, 2vw, 2rem);
	border-inline-start: 1px solid var(--ps-rule, #e5e7eb);
}
.ps-col:first-child { border-inline-start: 0; }
@media (max-width: 760px) {
	.ps-col { border-inline-start: 0; border-block-start: 1px solid var(--ps-rule, #e5e7eb); padding-block: 1.5rem; }
	.ps-col:first-child { border-block-start: 0; }
}

.ps-col__head {
	display: flex; align-items: baseline; justify-content: space-between;
	gap: 1rem; margin-bottom: 1.1rem;
}
.ps-col__title {
	margin: 0;
	font-family: var(--ps-font-display, inherit);
	color: var(--ps-navy, currentColor);
	font-size: clamp(1.35rem, 2.4vw, 1.85rem);
	line-height: 1.2;
}
.ps-col__more { font-size: .85rem; color: var(--ps-muted, #6b7280); text-decoration: none; white-space: nowrap; }
.ps-col__more:hover { text-decoration: underline; }

/* Authors */
.ps-authors { list-style: none; margin: 0; padding: 0; }
.ps-author { display: flex; align-items: center; gap: .85rem; padding: .65rem 0; }
.ps-author__photo {
	flex: 0 0 auto; width: 56px; height: 56px; border-radius: 50%; overflow: hidden;
	display: flex; align-items: center; justify-content: center;
	border: 2px solid var(--ps-accent, #d1d5db); background: #fff;
}
.ps-author__photo img { width: 100%; height: 100%; object-fit: cover; }
.ps-author__initial { font-family: var(--ps-font-display, inherit); font-size: 1.35rem; color: var(--ps-navy, currentColor); }
.ps-author__meta { min-width: 0; }
.ps-author__name {
	display: block; font-family: var(--ps-font-display, inherit); font-weight: 700;
	color: var(--ps-navy, currentColor); text-decoration: none; line-height: 1.35;
}
.ps-author__name:hover { text-decoration: underline; }
.ps-author__role { display: block; font-size: .82rem; color: var(--ps-muted, #6b7280); }

/* Articles */
.ps-articles { list-style: none; margin: 0; padding: 0; }
.ps-article { display: flex; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--ps-rule, #e5e7eb); }
.ps-article:last-child { border-bottom: 0; }
.ps-article__body { flex: 1 1 auto; min-width: 0; }
.ps-article__title {
	display: block; font-family: var(--ps-font-display, inherit); font-weight: 700;
	font-size: 1.1rem; line-height: 1.45; color: var(--ps-navy, currentColor); text-decoration: none;
}
.ps-article__title:hover { text-decoration: underline; }
.ps-article__excerpt { margin: .35rem 0 .3rem; font-size: .92rem; line-height: 1.8; }
.ps-article__author { font-size: .85rem; color: var(--ps-muted, #6b7280); }
.ps-article__author a { color: inherit; text-decoration: none; }
.ps-article__author a:hover { text-decoration: underline; }
.ps-article__thumb { flex: 0 0 34%; max-width: 190px; }
.ps-article__thumb img { display: block; width: 100%; height: auto; border-radius: 2px; }

/* Index — numbered circles carry the printed page number */
.ps-index { list-style: none; margin: 0; padding: 0; }
.ps-index__item {
	display: flex; align-items: flex-start; gap: .85rem; padding: .7rem 0;
	border-bottom: 1px solid var(--ps-rule, #e5e7eb);
}
.ps-index__item:last-child { border-bottom: 0; }
.ps-index__num {
	flex: 0 0 auto;
	min-width: 40px; height: 40px;
	padding: 0 .4rem;            /* pill-out so 3-digit pages (132, 173) fit */
	border-radius: 999px;
	display: flex; align-items: center; justify-content: center;
	/* Concrete fallback, never currentColor: as background it would resolve to
	   this element's own colour (#fff) and hide the number. */
	background: var(--ps-navy, #2f3a4a); color: #fff;
	border: 2px solid var(--ps-accent, #d1d5db);
	font-family: var(--ps-font-display, inherit); font-weight: 700; font-size: .9rem;
	line-height: 1;
}
.ps-index__body { min-width: 0; }
.ps-index__title {
	display: block; font-family: var(--ps-font-display, inherit); font-weight: 700;
	line-height: 1.45; color: var(--ps-ink, currentColor); text-decoration: none;
}
.ps-index__title:hover { text-decoration: underline; }
.ps-index__author { display: block; font-size: .82rem; color: var(--ps-muted, #6b7280); margin-top: .2rem; }
.ps-index__author a { color: inherit; text-decoration: none; }

/* Index meta: page label sits beside the article name; circle carries the sequence */
.ps-index__meta,
.ps-article__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .45rem;
	margin-top: .25rem;
	font-size: .82rem;
	color: var(--ps-muted, #6b7280);
}
.ps-index__page,
.ps-article__page {
	display: inline-block;
	padding: .02rem .4rem;
	border: 1px solid var(--ps-rule, #e5e7eb);
	border-radius: 2px;
	white-space: nowrap;
}
.ps-index__meta .ps-index__author,
.ps-article__meta .ps-article__author { margin: 0; font-size: inherit; color: inherit; }
