/* ─────────────────────────────────────────────────────────────────────────────
   Mishpacha — Magazine Archive (/magazine/, /magazine/{pub}/)
   Prefix: ar-
───────────────────────────────────────────────────────────────────────────── */
#page-archive {
    --ar-red:   var(--red);
    --ar-redd:  var(--red-dark);
    --ar-ink:   var(--ink);
    --ar-off:   #1c1c1c;
    --ar-gm:    #6b6b6b;
    --ar-g-1:   #4a4a4a;
    --ar-gl:    #e4e4e4;
    --ar-cream: #faf9f5;
    --ar-serif: var(--font-body);
    background: var(--paper);
    color: var(--ar-ink);
    font-size: 15px;
    line-height: 1.5;
}
#page-archive * { box-sizing: border-box; }
#page-archive a { text-decoration: none; color: inherit; }
#page-archive img { display: block; max-width: 100%; }
.ar-wrap { max-width: 1440px; margin: 0 auto; padding: 0 38px; }

/* HERO */
.ar-hero { background: var(--ar-ink); color: #fff; padding: 56px 0 48px; }
.ar-hero-in { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: flex-end; }
.ar-hero-eye { font-size: 14px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--ar-red); margin-bottom: 14px; }
.ar-hero-title { font-family: var(--ar-serif); font-size: clamp(40px, 5vw, 64px); font-weight: 700; line-height: 1; letter-spacing: -.02em; margin-bottom: 14px; }
.ar-hero-desc { font-size: 15px; color: rgba(255,255,255,.6); line-height: 1.6; max-width: 540px; }
.ar-hero-stats { display: flex; gap: 36px; }
.ar-hs-n { font-family: var(--ar-serif); font-size: 36px; font-weight: 700; line-height: 1; }
.ar-hs-l { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.45); margin-top: 6px; }

/* PUBLICATION TABS */
.ar-pub-bar { border-bottom: 1px solid var(--ar-gl); background: #fff; position: sticky; top: 0; z-index: 50; }
.ar-pub-bar-in { display: flex; gap: 4px; overflow-x: auto; padding: 0; scrollbar-width: thin; }
.ar-pub-bar-in::-webkit-scrollbar { height: 4px; }
.ar-ptab {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 18px 6px;
    margin-right: 24px;
    font-size: 14px; font-weight: 600;
    color: var(--ar-gm);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color .15s, border-color .15s;
}
.ar-ptab:hover { color: var(--ar-ink); }
.ar-ptab.active { color: var(--ar-ink); border-bottom-color: var(--ar-red); }
.ar-ptab-n {
    font-size: 11px; font-weight: 600;
    background: var(--ar-gl); color: var(--ar-gm);
    padding: 2px 7px; border-radius: 999px;
    transition: background .15s, color .15s;
}
.ar-ptab.active .ar-ptab-n { background: var(--ar-red); color: #fff; }

/* CONTROLS (search + year scroll + view) */
.ar-controls { background: #fff; border-bottom: 1px solid var(--ar-gl); padding: 16px 0; position: sticky; top: 53px; z-index: 49; }
.ar-controls-in { display: flex; align-items: center; gap: 16px; }
.ar-search {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--ar-cream);
    border: 1.5px solid var(--ar-gl);
    border-radius: 999px;
    padding: 8px 14px;
    flex: 0 0 280px;
    transition: border-color .15s;
}
.ar-search:focus-within { border-color: var(--ar-ink); }
.ar-search-inp { flex: 1; border: none; background: transparent; outline: none; font-size: 13px; color: var(--ar-ink); font-family: inherit; }
.ar-divider { width: 1px; height: 28px; background: var(--ar-gl); }
.ar-year-scroll { display: flex; gap: 6px; overflow-x: auto; flex: 1; min-width: 0; padding: 2px 0; }
.ar-year-scroll::-webkit-scrollbar { height: 4px; }
.ar-yr-btn {
    background: transparent;
    border: 1.5px solid var(--ar-gl);
    color: var(--ar-g-1);
    font-size: 12px; font-weight: 600;
    padding: 7px 14px; border-radius: 999px;
    white-space: nowrap;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}
.ar-yr-btn:hover { border-color: var(--ar-ink); color: var(--ar-ink); }
.ar-yr-btn.active { background: var(--ar-ink); border-color: var(--ar-ink); color: #fff; }
.ar-view-btns { display: flex; gap: 4px; flex-shrink: 0; }
.ar-vbtn {
    width: 36px; height: 36px;
    background: transparent;
    border: 1.5px solid var(--ar-gl);
    border-radius: 6px;
    color: var(--ar-gm);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .15s;
}
.ar-vbtn:hover { border-color: var(--ar-ink); color: var(--ar-ink); }
.ar-vbtn.active { background: var(--ar-ink); border-color: var(--ar-ink); color: #fff; }

/* MAIN + LATEST HERO */
.ar-main { padding: 36px 0 64px; }
.ar-latest {
    display: grid; grid-template-columns: 260px 1fr; gap: 32px;
    background: var(--ar-cream);
    border-radius: 8px;
    padding: 28px;
    margin-bottom: 48px;
}
.ar-latest-cover { position: relative; aspect-ratio: 3/4; border-radius: 6px; overflow: hidden; background: var(--ar-ink); }
.ar-latest-cover-img { width: 100%; height: 100%; object-fit: cover; }
.ar-latest-cover-ph {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.7);
    font-family: var(--ar-serif); font-size: 92px; font-weight: 700;
    background: var(--ar-red);
}
.ar-latest-badge {
    position: absolute; top: 12px; left: 12px;
    background: var(--ar-red); color: #fff;
    font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    padding: 5px 9px; border-radius: 3px; z-index: 2;
}
.ar-latest-body { display: flex; flex-direction: column; justify-content: center; }
.ar-latest-label { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ar-red); margin-bottom: 6px; }
.ar-latest-num { font-family: var(--ar-serif); font-size: clamp(28px, 3vw, 38px); font-weight: 700; line-height: 1.1; margin-bottom: 6px; }
.ar-latest-date { font-size: 14px; color: var(--ar-gm); margin-bottom: 18px; }
.ar-latest-articles { display: flex; flex-direction: column; gap: 1px; margin-bottom: 20px; }
.ar-la-row {
    display: grid; grid-template-columns: 160px 1fr 140px;
    gap: 14px; align-items: baseline;
    padding: 10px 0;
    border-top: 1px solid var(--ar-gl);
    transition: color .15s;
}
.ar-la-row:last-child { border-bottom: 1px solid var(--ar-gl); }
.ar-la-row:hover .ar-la-title { color: var(--ar-red); }
.ar-la-col { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ar-red); }
.ar-la-title { font-family: var(--ar-serif); font-size: 16px; font-weight: 600; color: var(--ar-ink); line-height: 1.3; transition: color .15s; }
.ar-la-by { font-size: 12px; color: var(--ar-gm); text-align: right; }
.ar-latest-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.ar-btn-view, .ar-btn-sub {
    display: inline-flex; align-items: center;
    font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    padding: 11px 18px; border-radius: 4px;
    transition: all .15s;
}
#page-archive .ar-btn-view { background: var(--ar-red); color: #fff; }
#page-archive .ar-btn-view:hover { background: var(--ar-redd); color: #fff; }
#page-archive .ar-btn-sub { background: transparent; color: var(--ar-ink); border: 1.5px solid var(--ar-gl); }
#page-archive .ar-btn-sub:hover { border-color: var(--ar-ink); color: var(--ar-ink); }

/* YEAR GROUPS */
.ar-year-group { margin-bottom: 48px; }
.ar-year-heading { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--ar-gl); }
.ar-year-num { font-family: var(--ar-serif); font-size: 32px; font-weight: 700; line-height: 1; }
.ar-year-count { font-size: 12px; color: var(--ar-gm); font-weight: 600; }

/* ISSUES GRID (default view) */
.ar-issues-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 24px 18px; }
.ar-issue-card { display: block; transition: transform .2s; }
.ar-issue-card:hover { transform: translateY(-2px); }
.ar-issue-cover {
    position: relative; aspect-ratio: 3/4;
    background: var(--ar-ink);
    border-radius: 4px; overflow: hidden;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: box-shadow .2s;
}
.ar-issue-card:hover .ar-issue-cover { box-shadow: 0 8px 20px rgba(0,0,0,.14); }
.ar-issue-cover-img { width: 100%; height: 100%; object-fit: cover; }
.ar-issue-cover-ph {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.7);
    background: var(--ar-red);
    font-family: var(--ar-serif); font-size: 56px; font-weight: 700;
}
.ar-issue-num { font-family: var(--ar-serif); font-size: 16px; font-weight: 700; line-height: 1; }
.ar-issue-date { font-size: 12px; color: var(--ar-gm); margin-top: 3px; }

/* LIST VIEW (toggle) */
.ar-issues-list { display: none; flex-direction: column; gap: 1px; }
#page-archive.ar-view-list .ar-issues-grid { display: none; }
#page-archive.ar-view-list .ar-issues-list { display: flex; }
#page-archive.ar-view-list .ar-latest { display: none; }
.ar-il-row {
    display: grid; grid-template-columns: 72px 1fr auto;
    gap: 16px; align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--ar-gl);
    transition: background .15s;
}
.ar-il-row:last-child { border-bottom: 1px solid var(--ar-gl); }
.ar-il-row:hover { background: var(--ar-cream); }
.ar-il-cover { width: 72px; height: 96px; object-fit: cover; background: var(--ar-ink); border-radius: 3px; flex-shrink: 0; }
.ar-il-cover--ph {
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.85);
    background: var(--ar-red);
    font-family: var(--ar-serif); font-size: 28px; font-weight: 700;
}
.ar-il-num { font-family: var(--ar-serif); font-size: 17px; font-weight: 700; margin-bottom: 2px; }
.ar-il-date { font-size: 13px; color: var(--ar-gm); }
.ar-il-badge {
    font-size: 11px; font-weight: 700;
    color: var(--ar-red);
    background: rgba(200,16,46,.08);
    padding: 5px 12px; border-radius: 999px;
}

/* LOAD MORE */
.ar-load-more-row { display: flex; justify-content: center; padding: 16px 0 32px; }
.ar-load-more-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--ar-ink); color: #fff;
    border: none;
    font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    padding: 13px 24px; border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s, opacity .15s;
}
.ar-load-more-btn:hover { background: var(--ar-red); }
.ar-load-more-btn:disabled { opacity: .5; cursor: wait; }

/* LOADING / EMPTY */
.ar-loading {
    display: none;
    text-align: center;
    padding: 40px 20px;
    font-size: 13px;
    color: var(--ar-gm);
}
.ar-no-results {
    display: none;
    text-align: center;
    padding: 60px 20px;
    color: var(--ar-gm);
}
.ar-no-results.show { display: block; }
.ar-no-h { font-family: var(--ar-serif); font-size: 22px; font-weight: 700; color: var(--ar-ink); margin-bottom: 8px; }

/* RESPONSIVE */
@media (max-width: 1180px) {
    .ar-issues-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 980px) {
    .ar-issues-grid { grid-template-columns: repeat(4, 1fr); }
    .ar-hero-in { grid-template-columns: 1fr; gap: 28px; }
    .ar-latest { grid-template-columns: 200px 1fr; padding: 22px; }
    .ar-la-row { grid-template-columns: 1fr; gap: 4px; }
    .ar-la-col { font-size: 9px; }
    .ar-la-by { text-align: left; }
}
@media (max-width: 720px) {
    .ar-wrap { padding: 0 14px; }
    .ar-hero { padding: 36px 0 32px; }
    .ar-hero-stats { gap: 24px; }
    .ar-hs-n { font-size: 28px; }
    .ar-controls { top: 49px; }
    .ar-controls-in { flex-wrap: wrap; gap: 10px; }
    .ar-search { flex: 1 1 100%; }
    .ar-divider { display: none; }
    .ar-issues-grid { grid-template-columns: repeat(3, 1fr); gap: 16px 12px; }
    .ar-latest { grid-template-columns: 1fr; padding: 18px; gap: 20px; }
    .ar-latest-cover { max-width: 160px; }
    .ar-il-row { grid-template-columns: 56px 1fr; }
    .ar-il-cover { width: 56px; height: 74px; }
    .ar-il-badge { display: none; }
    .ar-ptab { padding: 14px 4px; font-size: 13px; }
}
@media (max-width: 480px) {
    .ar-issues-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Latest-issue headline rows: title + byline on one line, ellipsis on overflow
   (Hila 2026-06-08 — bylines were wrapping unevenly). */
.ar-latest-articles .ar-la-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: nowrap; }
.ar-latest-articles .ar-la-title { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-latest-articles .ar-la-by { flex: 0 0 auto; white-space: nowrap; color: var(--ar-g1, #5C5C5C); font-style: italic; }
