/* =============================================================
   library.css — Shared styles for Publications & E-Library pages
   Loaded globally via layouts/app.blade.php
   ============================================================= */


/* ─────────────────────────────────────────────────────────────
   1.  TYPOGRAPHY
   ───────────────────────────────────────────────────────────── */

.lib-subheader-label,
.pub-subheader-title,
.elib-subheader-title,
.pub-card-title,
.elib-card-title,
.pub-section-title {
    font-family: var(--title-font), "Helvetica Neue", Helvetica, Arial, sans-serif;
}

#publications,
#elibrary,
.pub-section-label,
.pub-card-body,
.elib-card-body,
.elib-card-desc,
.pub-breadcrumb-item,
.pub-card-btn,
.elib-card-btn,
.pub-count-badge,
.pub-card-num,
.pub-card-mime,
.elib-card-mime,
.elib-card-downloads {
    font-family: var(--body-font), "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body.lang-ar .lib-subheader-label,
body.lang-ar .pub-subheader-title,
body.lang-ar .elib-subheader-title,
body.lang-ar .pub-subheader-label,
body.lang-ar .pub-section-label,
body.lang-ar .pub-section-title,
body.lang-ar .pub-breadcrumb-item,
body.lang-ar .pub-card-title,
body.lang-ar .pub-card-btn,
body.lang-ar .elib-card-title,
body.lang-ar .elib-card-desc,
body.lang-ar .elib-card-btn {
    font-family: "Noto Sans Arabic", sans-serif;
}


/* ─────────────────────────────────────────────────────────────
   2.  PAGE SUB-HEADER  (shared base)
   ───────────────────────────────────────────────────────────── */

/* Shared structural base */
.lib-subheader {
    position: relative;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* Publications header — background + padding */
.pub-subheader-bg {
    background-image: url('../images/background/18.jpg');
    padding: 150px 0 60px;
}

/* E-Library header — background + padding (taller) */
.elib-subheader-bg {
    background-image: url('../images/background/about-us.png');
    padding: 180px 0 80px;
}

/* Overlay shared layer */
.lib-subheader-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.pub-subheader-overlay {
    background: linear-gradient(135deg, rgba(36, 46, 63, .92) 50%, rgba(26, 34, 51, .85) 100%);
}

.elib-subheader-overlay {
    background: linear-gradient(135deg, rgba(26, 34, 51, .95) 0%, rgba(36, 46, 63, .88) 100%);
}

/* Content sits above overlay */
.lib-subheader-content {
    position: relative;
    z-index: 1;
}

/* Decorative watermark — E-Library only */
.elib-watermark {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    opacity: .04;
    z-index: 0;
    pointer-events: none;
}

[dir="rtl"] .elib-watermark {
    right: auto;
    left: 5%;
}


/* ─────────────────────────────────────────────────────────────
   3.  SUBHEADER TEXT
   ───────────────────────────────────────────────────────────── */

.lib-subheader-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #c5a059;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Vertically centre inline SVG icons */
.lib-subheader-label svg {
    vertical-align: middle;
    margin-bottom: 2px;
    flex-shrink: 0;
}

.pub-subheader-title {
    font-size: clamp(1.75rem, 4vw, 2.8rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.elib-subheader-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.15;
}

.elib-subheader-sub {
    font-size: clamp(.9rem, 2vw, 1.1rem);
    color: rgba(255, 255, 255, .55);
    font-weight: 400;
}


/* ─────────────────────────────────────────────────────────────
   4.  BREADCRUMB  (shared between both pages)
   ───────────────────────────────────────────────────────────── */

.pub-breadcrumb {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    list-style: none;
    padding: 6px 14px;
    margin: 0;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(197, 160, 89, .25);
    border-radius: 30px;
    backdrop-filter: blur(6px);
}

.pub-breadcrumb-item {
    font-size: .8rem;
    font-weight: 500;
}

.pub-breadcrumb-item a {
    color: rgba(255, 255, 255, .65);
    text-decoration: none;
    transition: color .2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pub-breadcrumb-item a:hover {
    color: #c5a059;
}

.pub-breadcrumb-item a svg {
    vertical-align: middle;
    margin-bottom: 2px;
    flex-shrink: 0;
}

.pub-breadcrumb-item.active {
    color: #c5a059;
    font-weight: 600;
}

.pub-breadcrumb-sep {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, .3);
    padding: 0 4px;
}

/* Flip chevrons in RTL layouts */
[dir="rtl"] .pub-breadcrumb-sep svg {
    transform: scaleX(-1);
}


/* ─────────────────────────────────────────────────────────────
   5.  SECTION HEADER  (Publications page)
   ───────────────────────────────────────────────────────────── */

.pub-section-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #c5a059;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pub-section-label span {
    flex: 1;
    max-width: 32px;
    height: 1px;
    background: #c5a059;
    opacity: .4;
}

.pub-section-title {
    font-size: 1.9rem;
    font-weight: 700;
    color: #242e3f;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.pub-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    border-radius: 20px;
    background: #c5a059;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: 0;
}


/* ─────────────────────────────────────────────────────────────
   6.  EMPTY STATE  (shared)
   ───────────────────────────────────────────────────────────── */

.pub-empty-state {
    padding: 48px 0;
}

.pub-empty-icon {
    display: block;
    margin: 0 auto 16px;
    opacity: .55;
}

.pub-empty-text {
    color: #6c757d;
    font-size: 1rem;
    margin: 0;
}


/* ─────────────────────────────────────────────────────────────
   7.  CARD  — shared base
   ───────────────────────────────────────────────────────────── */

.pub-card,
.elib-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #e8e4db;
    box-shadow: 0 2px 14px rgba(36, 46, 63, .07);
    transition: transform .25s ease, box-shadow .25s ease;
}



.pub-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(197, 160, 89, .16);
}

.elib-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(197, 160, 89, .18);
}


/* ─────────────────────────────────────────────────────────────
   8.  CARD COVER  — shared base + per-page variants
   ───────────────────────────────────────────────────────────── */

.pub-card-cover,
.elib-card-cover {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Shared bottom fade */
.pub-card-cover::after,
.elib-card-cover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: none;
}

/* Publications cover */
.pub-card-cover {
    background: linear-gradient(145deg, #1e2d42 0%, #242e3f 100%);
    min-height: 190px;
}

.pub-card-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(197, 160, 89, .12) 1px, transparent 1px);
    background-size: 18px 18px;
}

.pub-card-cover::after {
    height: 48px;
    background: linear-gradient(to top, rgba(36, 46, 63, .6), transparent);
}

/* E-Library cover */
.elib-card-cover {
    background: linear-gradient(145deg, #1a2233 0%, #2c3a52 100%);
    min-height: 210px;
}

.elib-card-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(197, 160, 89, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(197, 160, 89, .04) 1px, transparent 1px);
    background-size: 30px 30px;
}

.elib-card-cover::after {
    height: 52px;
    background: linear-gradient(to top, rgba(26, 34, 51, .65), transparent);
}


/* ─────────────────────────────────────────────────────────────
   9.  COVER BADGES  (MIME, serial number, download count)
   ───────────────────────────────────────────────────────────── */

/* MIME badge — top-end corner */
.pub-card-mime,
.elib-card-mime {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: .6rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #fff;
}

[dir="rtl"] .pub-card-mime,
[dir="rtl"] .elib-card-mime {
    right: auto;
    left: 12px;
}

/* Serial number — top-start corner (Publications) */
.pub-card-num {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, .4);
}

[dir="rtl"] .pub-card-num {
    left: auto;
    right: 12px;
}

/* Download counter — top-start corner (E-Library) */
.elib-card-downloads {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: .6rem;
    font-weight: 700;
    color: rgba(255, 255, 255, .5);
}

[dir="rtl"] .elib-card-downloads {
    left: auto;
    right: 12px;
}


/* ─────────────────────────────────────────────────────────────
   10. CARD ICON WRAPPERS
   ───────────────────────────────────────────────────────────── */

.pub-card-icon-wrap {
    position: relative;
    z-index: 1;
    width: 80px;
    height: 96px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .3));
    transition: transform .25s ease;
}

.pub-card:hover .pub-card-icon-wrap {
    transform: translateY(-4px) scale(1.04);
}

.elib-card-icon-wrap {
    position: relative;
    z-index: 1;
    width: 120px;
    height: 90px;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .35));
    transition: transform .28s ease;
}

.elib-card:hover .elib-card-icon-wrap {
    transform: translateY(-5px) scale(1.05);
}


/* ─────────────────────────────────────────────────────────────
   11. CARD BODY  (shared pattern)
   ───────────────────────────────────────────────────────────── */

.pub-card-body,
.elib-card-body {
    padding: 18px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.pub-card-title-wrap,
.elib-card-title-wrap {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex: 1;
    margin-bottom: 16px;
}

.pub-card-accent-bar,
.elib-card-accent-bar {
    flex-shrink: 0;
    width: 3px;
    border-radius: 3px;
    background: #c5a059;
    margin-top: 3px;
    align-self: stretch;
}

.pub-card-title,
.elib-card-title {
    font-size: .9rem;
    font-weight: 600;
    color: #242e3f;
    line-height: 1.55;
    margin: 0;
}

.elib-card-title {
    margin-bottom: 6px;
}

.elib-card-desc {
    font-size: .78rem;
    color: #6c757d;
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* ─────────────────────────────────────────────────────────────
   12. DOWNLOAD BUTTON  (shared)
   ───────────────────────────────────────────────────────────── */

.pub-card-btn,
.elib-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 9px 16px;
    border-radius: 6px;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .02em;
    background: #242e3f;
    color: #c5a059;
    border: 1.5px solid rgba(197, 160, 89, .3);
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}

.pub-card-btn:hover,
.elib-card-btn:hover {
    background: #c5a059;
    color: #fff;
    border-color: #c5a059;
}

.pub-card-btn--disabled,
.elib-card-btn--disabled {
    background: #f4f4f4;
    color: #b0b0b0;
    border-color: #e8e8e8;
    cursor: not-allowed;
    pointer-events: none;
}