/* =========================================================
   MAGAZINE
   ========================================================= */

.magazine-archive,
.magazine-single {
    padding: 50px 0 80px;
}


/* =========================================================
   PAGE HEADER
   ========================================================= */

.magazine-page-header {
    text-align: center;
    margin-bottom: 40px;
}

.magazine-page-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 999px;

    background: #eaf7ef;
    color: #008f4c;

    font-size: 13px;
    font-weight: 600;

    margin-bottom: 12px;
}

.magazine-page-header h1 {
    margin: 0 0 8px;

    font-size: 30px;
    font-weight: 700;

    color: #111827;
}

.magazine-page-header p {
    margin: 0;

    color: #6b7280;
    font-size: 15px;
}


/* =========================================================
   GRID
   ========================================================= */

.magazine-grid {
    display: grid;

    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 24px;
}


/* =========================================================
   CARD
   ========================================================= */

.magazine-card {
    overflow: hidden;

    background: #fff;

    border: 1px solid #e5e7eb;
    border-radius: 16px;

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.magazine-card:hover {
    transform: translateY(-3px);

 
}


/* =========================================================
   COVER
   ========================================================= */

.magazine-card-cover {
    display: block;

    aspect-ratio: 3 / 4;

    overflow: hidden;

    background: #f3f4f6;
}

.magazine-card-cover img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    transition: transform .3s ease;
}

.magazine-card:hover .magazine-card-cover img {
    transform: scale(1.03);
}


.magazine-card-placeholder {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #6b7280;
}


/* =========================================================
   CARD CONTENT
   ========================================================= */

.magazine-card-content {
    padding: 20px;
}


.magazine-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    margin-bottom: 12px;
}

.magazine-issue {
    color: #008f4c;

    font-size: 13px;
    font-weight: 700;
}

.magazine-season {
    color: #6b7280;

    font-size: 12px;
}


.magazine-card-title {
    margin: 0 0 8px;

    font-size: 17px;
    line-height: 1.6;
}

.magazine-card-title a {
    color: #111827;
    text-decoration: none;
}


.magazine-card-date {
    color: #6b7280;

    font-size: 12px;

    margin-bottom: 18px;
}


/* =========================================================
   BUTTON
   ========================================================= */

.magazine-card-button {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    width: 100%;

    padding: 10px 14px;

    border-radius: 9px;

    background: #008f4c;
    color: #fff;

    text-decoration: none;

    font-size: 13px;
    font-weight: 600;

    transition: background .2s ease;
}

.magazine-card-button:hover {
    background: #007b42;
}

.magazine-card-button span {
    font-size: 16px;
}


/* =========================================================
   EMPTY
   ========================================================= */

.magazine-empty {
    text-align: center;

    padding: 70px 20px;

    background: #fff;

    border: 1px solid #e5e7eb;
    border-radius: 16px;
}

.magazine-empty-icon {
    font-size: 42px;
    margin-bottom: 15px;
}

.magazine-empty h2 {
    margin: 0 0 8px;

    font-size: 20px;
}

.magazine-empty p {
    margin: 0;

    color: #6b7280;
}


/* =========================================================
   SINGLE
   ========================================================= */

.magazine-single-card {
    max-width: 1000px;

    margin: 0 auto;

    background: #fff;

    border: 1px solid #e5e7eb;
    border-radius: 18px;

    overflow: hidden;
}


/* HEADER */

.magazine-single-header {
    text-align: center;

      padding: 35px 25px 1px;


}

.magazine-single-meta {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 10px;

    flex-wrap: wrap;

    margin-bottom: 15px;

    color: #6b7280;

    font-size: 13px;
}

.magazine-single-issue {
    color: #008f4c;
    font-weight: 700;
}

.magazine-single-header h1 {
    margin: 0;

    font-size: 26px;
    line-height: 1.5;

    color: #111827;
}

.magazine-single-date {
    margin-top: 12px;

    color: #6b7280;

    font-size: 13px;
}

.magazine-single-date span {
    margin-left: 6px;
}


/* BODY */

.magazine-single-body {
    padding: 35px;
}


/* COVER */

.magazine-single-cover {
    max-width: 600px;

    margin: 0 auto 35px;

    text-align: center;
}

.magazine-single-cover img {
    width: 100%;
    height: auto;

    display: block;

    border-radius: 12px;

    box-shadow:
        0 8px 30px rgba(0, 0, 0, .12);
}


/* DESCRIPTION */

.magazine-single-description {
    max-width: 760px;

    margin: 0 auto 30px;

    text-align: right;
}

.magazine-single-description h2 {
    margin: 0 0 12px;

    font-size: 18px;
}

.magazine-single-description div {
    color: #4b5563;

    font-size: 14px;
    line-height: 2;
}


/* ACTIONS */

.magazine-single-actions {
    display: flex;

    justify-content: center;

    gap: 12px;

    flex-wrap: wrap;

    margin-top: 30px;
}

.magazine-action {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    min-width: 150px;

    padding: 12px 20px;

    border-radius: 9px;

    text-decoration: none;

    font-size: 14px;
    font-weight: 600;
}

.magazine-action-primary {
    background: #008f4c;
    color: #fff;
}

.magazine-action-secondary {
    background: #BD9945;
    color: #ffffff;
}


/* BACK */

.magazine-single-back {
    max-width: 1000px;

    margin: 18px auto 0;

    text-align: right;
}

.magazine-single-back a {
    color: #008f4c;

    text-decoration: none;

    font-size: 13px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {

    .magazine-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 600px) {

    .magazine-archive,
    .magazine-single {
        padding: 30px 0 60px;
    }

    .magazine-page-header {
        margin-bottom: 25px;
    }

    .magazine-page-header h1 {
        font-size: 24px;
    }

    .magazine-grid {
        grid-template-columns: 1fr;

        gap: 18px;
    }

    .magazine-card-content {
        padding: 16px;
    }

    .magazine-single-header {
        padding: 25px 18px;
    }

    .magazine-single-header h1 {
        font-size: 21px;
    }

    .magazine-single-body {
        padding: 20px;
    }

    .magazine-single-actions {
        flex-direction: column;
    }

    .magazine-action {
        width: 100%;
    }

}

/* =========================================================
   Magazine Hero
   ========================================================= */

.magazine-hero {
    position: relative;
    min-height: 157px;

    background-image: url('../images/magazine-hero.jpg');
    background-size: cover;
    background-position: center 15%;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
}

.magazine-hero__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
}

.magazine-hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.magazine-hero__content h1 {
    margin: 0;
    color: #fff;

    font-size: 42px;
    font-weight: 700;
}

.magazine-archive {
    padding-top: 0;
}

.magazine-hero {
    margin-top: 0;
}

/* الهاتف */
@media (max-width: 768px) {
    .magazine-hero {
        min-height: 100px;
    }

    .magazine-hero__content h1 {

    font-size: 30px;
    font-weight: 700;
}
}

/* =========================================
   Magazine Archive - Cards Grid
========================================= */

.magazine-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    max-width: 1300px;
    margin: 35px auto 0;
}

.magazine-card {
    width: 100%;
    min-width: 0;
}

/* الصورة */
.magazine-card img {
    width: 100%;
    height: auto;
    display: block;
}

/* Tablet */
@media (max-width: 1100px) {
    .magazine-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Mobile */
@media (max-width: 700px) {
    .magazine-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

.magazine-card {
    width: 95%;
    min-width: 0;
}

}

/* Small Mobile */
@media (max-width: 480px) {
    .magazine-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

.magazine-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.magazine-card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.magazine-card-button {
    margin-top: auto;
}

@media (max-width: 767px) {

    .magazine-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        width: 100%;
        margin: 35px auto 0;
        padding: 0 10px;
        box-sizing: border-box;
    }

    .magazine-card {
        width: 100%;
        min-width: 0;
    }

}

/* =========================================================
   Magazine Cards - بدون حركة عند Hover / Click
========================================================= */

.magazine-card,
.magazine-card:hover,
.magazine-card:active {
    transform: none !important;
}

.magazine-card-cover,
.magazine-card-cover:hover,
.magazine-card-cover:active {
    transform: none !important;
}

.magazine-card-cover img,
.magazine-card-cover:hover img {
    transform: none !important;
}

.magazine-card-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.magazine-card-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* =========================================================
   SINGLE - ACTION ICONS
   ========================================================= */

.magazine-action svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.magazine-action {
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}

.magazine-action-primary:hover {
    background: #007b42;
    color: #fff;
}

.magazine-action-secondary:hover {
    background: #9c803f;
    color: #ffffff;
}

/* =========================================================
   SINGLE - PDF READER
   ========================================================= */

.magazine-pdf-reader {
    max-width: 900px;
    margin: 40px auto 0;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.magazine-pdf-reader__header {
    padding: 16px 18px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.magazine-pdf-reader__title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.magazine-pdf-reader__icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    border-radius: 10px;
    background: #eaf7ef;
    color: #008f4c;
}

.magazine-pdf-reader__icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.magazine-pdf-reader__title div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.magazine-pdf-reader__title strong {
    color: #111827;
    font-size: 15px;
    font-weight: 700;
}

.magazine-pdf-reader__title div span {
    color: #6b7280;
    font-size: 12px;
}

.magazine-pdf-reader__viewer {
    width: 100%;
    height: 780px;
    background: #525659;
}

.magazine-pdf-reader__viewer iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

@media (max-width: 700px) {

    .magazine-pdf-reader {
        margin-top: 30px;
        border-radius: 12px;
    }

    .magazine-pdf-reader__header {
        padding: 13px 14px;
    }

    .magazine-pdf-reader__viewer {
        height: 600px;
    }

}

@media (max-width: 480px) {

    .magazine-pdf-reader__viewer {
        height: 520px;
    }

}



/* PDF reader fallback */
.magazine-pdf-reader__viewer > object {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

.magazine-pdf-reader__fallback {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px;
    text-align: center;
    background: #fff;
    color: #374151;
}

.magazine-pdf-reader__fallback p {
    margin: 0;
}

.magazine-pdf-reader__fallback a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 8px;
    background: #009447;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}


/* =========================================================
   MAGAZINE - PDF.JS READER
   ========================================================= */

.magazine-pdfjs-reader {
    width: 100%;
    overflow: hidden;
    background: #525659;
}

.magazine-pdfjs-reader__toolbar {
    min-height: 54px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #20252b;
    color: #fff;
    direction: ltr;
}

.magazine-pdfjs-reader__button {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.06);
    color: #fff;
    cursor: pointer;
}

.magazine-pdfjs-reader__button:hover {
    background: rgba(255,255,255,.14);
}

.magazine-pdfjs-reader__button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.magazine-pdfjs-reader__page {
    min-width: 78px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #fff;
    font-size: 13px;
    direction: ltr;
}

.magazine-pdfjs-reader__page input {
    width: 42px;
    height: 32px;
    padding: 0 5px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 6px;
    outline: 0;
    background: rgba(255,255,255,.08);
    color: #fff;
    text-align: center;
    font: inherit;
}

.magazine-pdfjs-reader__separator {
    width: 1px;
    height: 25px;
    margin: 0 5px;
    background: rgba(255,255,255,.18);
}

.magazine-pdfjs-reader__zoom {
    min-width: 45px;
    text-align: center;
    color: #fff;
    font-size: 12px;
    direction: ltr;
}

.magazine-pdfjs-reader__stage {
    min-height: 760px;
    padding: 22px 16px 30px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: auto;
    background: #525659;
}

.magazine-pdfjs-reader__stage canvas {
    display: block;
    max-width: none;
    background: #fff;
    box-shadow: 0 3px 16px rgba(0,0,0,.25);
}

.magazine-pdfjs-reader__loading {
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff;
    font-size: 14px;
}

.magazine-pdfjs-reader__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: magazine-pdf-spin .8s linear infinite;
}

@keyframes magazine-pdf-spin {
    to {
        transform: rotate(360deg);
    }
}

.magazine-pdfjs-reader__error {
    max-width: 420px;
    margin: 80px auto;
    padding: 25px;
    border-radius: 12px;
    background: #fff;
    color: #374151;
    text-align: center;
    line-height: 1.8;
}

.magazine-pdfjs-reader__error a {
    display: inline-flex;
    margin-top: 10px;
    padding: 9px 16px;
    border-radius: 7px;
    background: #009447;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

@media (max-width: 700px) {

    .magazine-pdfjs-reader__toolbar {
        min-height: 50px;
        padding: 7px 8px;
        gap: 5px;
    }

    .magazine-pdfjs-reader__button {
        width: 34px;
        height: 34px;
    }

    .magazine-pdfjs-reader__separator {
        margin: 0 2px;
    }

    .magazine-pdfjs-reader__stage {
        min-height: 560px;
        padding: 12px 8px 20px;
    }

}

@media (max-width: 420px) {

    .magazine-pdfjs-reader__toolbar {
        gap: 3px;
    }

    .magazine-pdfjs-reader__button {
        width: 32px;
        height: 32px;
    }

    .magazine-pdfjs-reader__page {
        min-width: 65px;
    }

    .magazine-pdfjs-reader__page input {
        width: 36px;
    }

    .magazine-pdfjs-reader__separator {
        display: none;
    }

}

.magazine-pdf-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    direction: rtl;
}

.magazine-pdf-toolbar button {
    border: 0;
    border-radius: 8px;
    padding: 9px 14px;
    background: #008f4c;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
}

.magazine-pdf-toolbar button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.magazine-pdf-pages {
    min-height: 500px;
    padding: 30px 15px;
    background: #e5e7eb;
    display: flex;
    justify-content: center;
}

.magazine-pdf-page {
    background: #fff;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .12);
}

.magazine-pdf-page canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.magazine-pdf-loading,
.magazine-pdf-error {
    padding: 60px 20px;
    text-align: center;
    font-size: 16px;
}

.magazine-pdf-error {
    color: #b91c1c;
}

/* =========================================================
   MAGAZINE META - ROUNDED
   ========================================================= */

.magazine-single-meta {
    gap: 8px;
}

.magazine-single-meta > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 6px 12px;

    border: 1px solid #e5e7eb;
    border-radius: 999px;

    background: #f8fafc;

    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
}

.magazine-single-meta .magazine-single-issue {
    color: #ffffff;
    background: #008f4c;
  
}


/* تاريخ الإصدار */

.magazine-single-date {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    width: fit-content;

    margin: 12px auto 0;

    padding: 6px 12px;

    border: 1px solid #e5e7eb;
    border-radius: 999px;

    background: #f8fafc;

    color: #6b7280;
    font-size: 13px;
}

.magazine-single-header {
    text-align: center;
}

.magazine-single-header h1 {
    margin-bottom: 20px;
}

.magazine-single-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.magazine-single-meta {
    display: flex;
    align-items: center;
    gap: 24px;
}

.magazine-single-date {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.magazine-single__meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

/* =========================================================
   FRENCH / LTR
   ========================================================= */

.magazine-archive--fr {
    direction: ltr;
}

.magazine-archive--fr .magazine-hero {
    direction: ltr;
}

.magazine-archive--fr .magazine-hero__content {
    direction: ltr;
    text-align: center;
}

.magazine-archive--fr .magazine-card {
    direction: ltr;
}

.magazine-archive--fr .magazine-card-content {
    direction: ltr;
    text-align: left;
}

.magazine-archive--fr .magazine-card-top {
    direction: ltr;
}

.magazine-archive--fr .magazine-issue,
.magazine-archive--fr .magazine-season {
    direction: ltr;
}

.magazine-archive--fr .magazine-card-title,
.magazine-archive--fr .magazine-card-title a,
.magazine-archive--fr .magazine-card-date {
    direction: ltr;
    text-align: left;
}

.magazine-archive--fr .magazine-card-button {
    direction: ltr;
}

.magazine-archive--fr .magazine-empty {
    direction: ltr;
    text-align: center;
}

/* =========================================================
   MAGAZINE SINGLE - FRENCH / LTR
   ========================================================= */

.magazine-single--fr {
    direction: ltr;
}

.magazine-single--fr .magazine-single-card {
    direction: ltr;
}

.magazine-single--fr .magazine-single-header {
    direction: ltr;
    text-align: center;
}

.magazine-single--fr .magazine-single-info {
    direction: ltr;
}

.magazine-single--fr .magazine-single-meta {
    direction: ltr;
}

.magazine-single--fr .magazine-single-date {
    direction: ltr;
}

.magazine-single--fr .magazine-single-body {
    direction: ltr;
}

.magazine-single--fr .magazine-single-description {
    direction: ltr;
    text-align: left;
}

.magazine-single--fr .magazine-single-description h2 {
    text-align: left;
}

.magazine-single--fr .magazine-single-description div {
    text-align: left;
}

.magazine-single--fr .magazine-single-actions {
    direction: ltr;
}

.magazine-single--fr .magazine-single-back {
    direction: ltr;
    text-align: left;
}


/* =========================================================
   OTHER MAGAZINES - FRENCH / LTR
   ========================================================= */

.magazine-single--fr .magazine-other {
    direction: ltr;
}

.magazine-single--fr .magazine-other__header {
    direction: ltr;
}

.magazine-single--fr .magazine-other__header h2 {
    text-align: left;
}

.magazine-single--fr .magazine-other__grid {
    direction: ltr;
}

.magazine-single--fr .magazine-other__card {
    direction: ltr;
}

.magazine-single--fr .magazine-other__content {
    text-align: left;
}

.magazine-single--fr .magazine-other__title,
.magazine-single--fr .magazine-other__title a {
    text-align: left;
}

.magazine-single--fr .magazine-other__season {
    text-align: left;
}

.magazine-single--fr .magazine-other__issue {
    direction: ltr;
}

.magazine-single--fr .magazine-other__read {
    direction: ltr;
}


/* =========================================================
   MAGAZINE READER - FRENCH / LTR
   ========================================================= */

.magazine-reader-page--fr {
    direction: ltr;
}

.magazine-reader-page--fr .magazine-reader-page__header {
    direction: ltr;
}

.magazine-reader-page--fr .magazine-reader-page__title {
    direction: ltr;
    text-align: left;
}

.magazine-reader-page--fr .magazine-reader-page__meta {
    direction: ltr;
}

.magazine-reader-page--fr .magazine-reader-page__back {
    direction: ltr;
    text-align: left;
}

.magazine-reader-page--fr .magazine-reader {
    direction: ltr;
}

.magazine-reader-page--fr .magazine-reader__toolbar {
    direction: ltr;
}

.magazine-reader-page--fr .magazine-reader__loading,
.magazine-reader-page--fr .magazine-reader__error {
    direction: ltr;
    text-align: center;
}