/* ==========================================================================
   sbmahimalaya.org — custom.css
   Added 6 Aug 2026. Helix Ultimate (crafty) `templates/crafty/css/custom.css`
   ko index.php line 136 par khud load karta hai.

   Scope: sirf right column (#sp-right), Updates ki category table, aur
   article body ki typography. Global layout ko haath NAHI lagaya.
   Rollback: is file ko delete kar do — site apni default styling par wapas.
   ========================================================================== */

:root {
    --sbma-green: #005c3a;
    --sbma-green-soft: rgba(0, 92, 58, .08);
    --sbma-gray-bg: #f7f8f9;   /* lightest gray — right column */
    --sbma-line: #e6e9eb;
    --sbma-text: #003804;
    --sbma-muted: #6b7770;
}

/* ==========================================================================
   1. RIGHT COLUMN — lightest gray panel
   ========================================================================== */

#sp-right {
    padding: 0 15px;
}

#sp-right > .sp-column {
    background: var(--sbma-gray-bg);
    border: 1px solid var(--sbma-line);
    border-radius: 10px;
    padding: 26px 24px 12px;
}

/* module ke beech ka gap */
#sp-right .sp-module + .sp-module {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--sbma-line);
}

/* "UPDATES ..." heading
   NOTE: template.css me `#sp-right .sp-module .sp-module-title` hai (1,2,0),
   isliye `.sp-column` jodkar specificity badhani padi — warna wo jeet jata hai. */
#sp-right .sp-column .sp-module .sp-module-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--sbma-green);
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--sbma-green);
}

/* ---- list reset ---- */
#sp-right ul.mod-list,
#sp-right ul.mod-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* saal ka group heading — 2026 / 2025 / … */
#sp-right .mod-articles-category-group {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--sbma-green);
    background: var(--sbma-green-soft);
    border-radius: 20px;
    padding: 3px 12px;
    margin: 20px 0 10px;
}

#sp-right li:first-child > .mod-articles-category-group {
    margin-top: 0;
}

/* ---- har update ka link ----
   NOTE: template.css ka `#sp-right .sp-module ul > li > a` (1,1,3) `padding: 2px 0`
   aur `line-height: 36px` set karta hai. Isliye yahan bhi utne hi elements +
   ek extra class chahiye, warna padding/line-height apply hi nahi hoti. */
#sp-right .sp-module ul > li > a.mod-articles-category-title {
    display: block;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--sbma-text);
    text-decoration: none;
    padding: 10px 10px 10px 14px;
    border-left: 3px solid transparent;
    border-radius: 0 6px 6px 0;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}

#sp-right .sp-module ul ul > li + li > a.mod-articles-category-title {
    border-top: 1px solid var(--sbma-line);
}

#sp-right .sp-module ul > li > a.mod-articles-category-title:hover,
#sp-right .sp-module ul > li > a.mod-articles-category-title:focus {
    background: #fff;
    border-left-color: var(--sbma-green);
    color: var(--sbma-green);
}

/* jo article abhi khula hai */
#sp-right .sp-module ul > li > a.mod-articles-category-title.active,
#sp-right .sp-module ul > li.active > a.mod-articles-category-title {
    background: #fff;
    border-left-color: var(--sbma-green);
    color: var(--sbma-green);
    font-weight: 600;
}

/* mobile par right column neeche jata hai — thoda gap */
@media (max-width: 991.98px) {
    #sp-right > .sp-column {
        margin-top: 30px;
    }
}

/* ==========================================================================
   2. UPDATES ki category table (left)
   ========================================================================== */

.category-list .table,
.blog .table,
table.category {
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--sbma-line);
    border-radius: 10px;
    overflow: hidden;
}

.category-list .table thead th,
table.category thead th {
    background: var(--sbma-gray-bg);
    color: var(--sbma-green);
    font-size: 13px;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-bottom: 2px solid var(--sbma-line);
    padding: 14px 16px;
}

.category-list .table tbody td,
table.category tbody td {
    padding: 13px 16px;
    border-top: 1px solid var(--sbma-line);
    vertical-align: middle;
}

.category-list .table tbody tr:hover,
table.category tbody tr:hover {
    background: var(--sbma-gray-bg);
}

.category-list .table tbody a,
table.category tbody a {
    color: var(--sbma-text);
    text-decoration: none;
    font-weight: 500;
}

.category-list .table tbody a:hover,
table.category tbody a:hover {
    color: var(--sbma-green);
    text-decoration: underline;
}

/* ==========================================================================
   3. Article body — typography + photos
   ========================================================================== */

/* NOTE: is site par article body div par `com-content-article__body` class hai hi
   NAHI — wrapper `.article-details` hai. Isliye saare selector usi par. */

.article-details {
    font-size: 16px;
    line-height: 1.75;
}

/* h3 template me CENTERED hai — usse lad nahi rahe, wahi rakh kar
   spacing + ek chhota centered rule diya hai. */
.article-details h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--sbma-green);
    margin: 42px 0 18px;
}

.article-details h3::after {
    content: "";
    display: block;
    width: 54px;
    height: 2px;
    background: var(--sbma-green);
    opacity: .45;
    margin: 12px auto 0;
}

.article-details ul {
    padding-left: 20px;
}

.article-details li {
    margin-bottom: 7px;
}

/* intro header block (Reporting Period / Project Area / …) */
.article-details .sbma-meta {
    background: var(--sbma-gray-bg);
    border-left: 3px solid var(--sbma-green);
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
    margin: 0 0 24px;
    font-size: 15px;
    line-height: 1.9;
}

/* photos — rounded + halki shadow */
.article-details img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .10);
}

/* photo caption: <p><img><br><em>caption</em></p> wala pattern */
.article-details p img + br + em {
    display: block;
    margin-top: 10px;
    font-size: 13.5px;
    font-style: normal;
    color: var(--sbma-muted);
    text-align: center;
    line-height: 1.5;
}

/* activity summary table */
.article-details table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--sbma-line);
    border-radius: 10px;
    overflow: hidden;
    margin: 22px 0 28px;
    font-size: 15px;
}

.article-details table thead th {
    background: var(--sbma-gray-bg);
    color: var(--sbma-green);
    font-size: 13px;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 12px 14px;
    border-bottom: 2px solid var(--sbma-line);
    text-align: left;
}

.article-details table td {
    padding: 11px 14px;
    border-top: 1px solid var(--sbma-line);
}

.article-details table tbody tr:hover {
    background: var(--sbma-gray-bg);
}

/* ==========================================================================
   4. DOWNLOADS page — 4-column card grid + document modal
   (article: /index.php/downloads — 6 Aug 2026)
   ========================================================================== */

.sbma-dl-section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--sbma-green);
    margin: 40px 0 22px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--sbma-green);
}

.sbma-dl-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
}

@media (max-width: 1199.98px) { .sbma-dl-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 991.98px)  { .sbma-dl-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575.98px)  { .sbma-dl-grid { grid-template-columns: 1fr; } }

.sbma-dl-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--sbma-line);
    border-radius: 10px;
    padding: 16px 16px 18px;
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}

.sbma-dl-card:hover {
    border-color: var(--sbma-green);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .09);
    transform: translateY(-2px);
}

/* title — UPAR */
.sbma-dl-card .sbma-dl-title {
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--sbma-green);
    margin: 0 0 14px;
    min-height: 42px;      /* teeno row ke title ek line par align rahen */
}

.sbma-dl-card .sbma-dl-meta {
    font-size: 12px;
    color: var(--sbma-muted);
    margin: -8px 0 12px;
    letter-spacing: .03em;
    text-transform: uppercase;
}

/* thumbnail — BEECH me */
.sbma-dl-thumb {
    background: var(--sbma-gray-bg);
    border: 1px solid var(--sbma-line);
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 16px;
}

.article-details .sbma-dl-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    border-radius: 0;
    box-shadow: none;
    display: block;
}

/* button — NEECHE */
.sbma-dl-card .sbma-dl-btn {
    margin-top: auto;
    display: block;
    width: 100%;
    background: var(--sbma-green);
    color: #fff;
    border: 1px solid var(--sbma-green);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
}

.sbma-dl-card .sbma-dl-btn:hover,
.sbma-dl-card .sbma-dl-btn:focus {
    background: #fff;
    color: var(--sbma-green);
}

/* ---------- modal ---------- */
.sbma-modal[hidden] { display: none; }

.sbma-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, .62);
}

.sbma-modal-box {
    background: #fff;
    border-radius: 10px;
    width: min(1000px, 100%);
    height: min(90vh, 100%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
}

.sbma-modal-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--sbma-line);
    background: var(--sbma-gray-bg);
}

.sbma-modal-head h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--sbma-green);
    flex: 1 1 auto;
    line-height: 1.4;
}

.sbma-modal-actions { display: flex; gap: 8px; flex: 0 0 auto; }

.sbma-modal-actions a,
.sbma-modal-actions button {
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid var(--sbma-green);
    background: #fff;
    color: var(--sbma-green);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .16s ease, color .16s ease;
}

.sbma-modal-actions a:hover,
.sbma-modal-actions button:hover {
    background: var(--sbma-green);
    color: #fff;
}

.sbma-modal-actions .sbma-modal-close {
    border-color: #c9ced1;
    color: #4a5551;
    font-weight: 700;
    padding: 8px 12px;
}

.sbma-modal-actions .sbma-modal-close:hover {
    background: #4a5551;
    border-color: #4a5551;
    color: #fff;
}

.sbma-modal-body { flex: 1 1 auto; background: #525659; }
.sbma-modal-body iframe { width: 100%; height: 100%; border: 0; display: block; }

@media (max-width: 575.98px) {
    .sbma-modal { padding: 10px; }
    .sbma-modal-head { flex-wrap: wrap; }
    .sbma-modal-head h4 { flex: 1 0 100%; margin-bottom: 4px; }
}

body.sbma-modal-open { overflow: hidden; }

/* ==========================================================================
   5. HISTORY / ARCHIVE — chhoti purani tasveeren + gallery
   (Swami Manmathan article — 6 Aug 2026)

   ⚠️ Ye archive scans BAHUT CHHOTI hain (167x249 se 325x216 tak). Inhe
   width:100% dene par pixelated dikhengi — isliye natural size ke aas-paas
   cap kiya hai, stretch NAHI kiya.
   ========================================================================== */

.article-details figure.sbma-figure {
    margin: 26px auto;
    text-align: center;
    max-width: 340px;
}

.article-details figure.sbma-figure.sbma-figure-portrait {
    max-width: 200px;
}

.article-details figure.sbma-figure img {
    width: 100%;
    height: auto;
    image-rendering: auto;
    border: 1px solid var(--sbma-line);
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}

.article-details figure.sbma-figure figcaption {
    margin-top: 9px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--sbma-muted);
}

/* desktop par portrait ko text ke saath float karo */
@media (min-width: 768px) {
    .article-details figure.sbma-figure-portrait {
        float: right;
        margin: 6px 0 18px 26px;
    }
}

/* ---------- archive gallery ---------- */
.sbma-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 22px 0 8px;
}

@media (max-width: 991.98px) { .sbma-gallery { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 575.98px) { .sbma-gallery { grid-template-columns: repeat(2, 1fr); } }

.sbma-gallery button {
    padding: 0;
    border: 1px solid var(--sbma-line);
    border-radius: 6px;
    background: var(--sbma-gray-bg);
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    display: block;
    width: 100%;
    transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.sbma-gallery button:hover,
.sbma-gallery button:focus {
    border-color: var(--sbma-green);
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(0, 0, 0, .12);
}

.article-details .sbma-gallery button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
    box-shadow: none;
}

.sbma-gallery-note {
    font-size: 13.5px;
    color: var(--sbma-muted);
    margin: 0 0 18px;
}
