/* =========================================================
   CUI Lahore News & Events: shared detail page (5 templates)
   Self-contained (no Bootstrap grid needed); all classes start with cn-
========================================================= */

.cn-detail {
    --cn-navy: #073b4c;
    --cn-teal: #0b858d;
    --cn-gold: #e5b83d;
    --cn-text: #44606a;
    --cn-line: #e1eaec;
    --cn-soft: #f4f8f9;
    max-width: 1180px;
    margin: 0 auto;
    padding: 48px 16px 64px;
    color: var(--cn-text);
    font-size: 17px;
    line-height: 1.75;
}

.cn-preview-bar {
    margin-bottom: 24px;
    padding: 10px 16px;
    border-radius: 10px;
    background: #fff7e0;
    color: #7a5a00;
    font-size: 14px;
    font-weight: 600;
}

/* ---------- Head ---------- */

.cn-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.cn-chip {
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--cn-soft);
    color: var(--cn-teal);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.cn-chip-type { background: var(--cn-navy); color: #fff; }
.cn-state.is-upcoming { background: #e7f6ee; color: #1d7a46; }
.cn-state.is-live { background: #fde9e7; color: #b42318; }
.cn-state.is-past { background: #eef1f3; color: #6b7c84; }

.cn-title {
    margin: 0 0 16px;
    color: var(--cn-navy);
    font-size: clamp(26px, 3.6vw, 42px);
    font-weight: 800;
    line-height: 1.2;
}

.cn-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    padding-bottom: 24px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--cn-line);
    font-size: 15px;
    font-weight: 600;
}

.cn-meta span { display: inline-flex; align-items: center; gap: 8px; }

/* Icons drawn with CSS masks so host sites need no icon font */
.cn-ico {
    display: inline-block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    background: currentColor;
    -webkit-mask: var(--i) center / contain no-repeat;
    mask: var(--i) center / contain no-repeat;
}
.cn-meta .cn-ico { color: var(--cn-teal); }
.cn-ico-cal { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-2V2h-2v2H9V2zm-2 8h14v10H5z'/%3E%3C/svg%3E"); }
.cn-ico-pin { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5 7 13 7 13s7-8 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E"); }
.cn-ico-unit { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 1 8l11 6 9-4.9V16h2V8zM5 13.2V17l7 4 7-4v-3.8l-7 3.8z'/%3E%3C/svg%3E"); }

/* ---------- Body layouts ---------- */

.cn-body { display: grid; gap: 40px; }

/* Templates 1, 3, 4: text left, media right */
.cn-t1 .cn-body,
.cn-t3 .cn-body,
.cn-t4 .cn-body {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: start;
}

/* Templates 2, 5: single readable column */
.cn-t2 .cn-body,
.cn-t5 .cn-body { max-width: 860px; }

.cn-side { position: sticky; top: 110px; }

.cn-lead {
    margin: 0 0 20px;
    color: var(--cn-navy);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.6;
}

.cn-content p { margin: 0 0 18px; }
.cn-content h2, .cn-content h3 { margin: 28px 0 12px; color: var(--cn-navy); font-weight: 800; }
.cn-content ul, .cn-content ol { margin: 0 0 18px; padding-left: 22px; }
.cn-content a { color: var(--cn-teal); }
.cn-content img { max-width: 100%; height: auto; border-radius: 12px; }
.cn-content blockquote { margin: 0 0 18px; padding: 12px 20px; border-left: 4px solid var(--cn-gold); background: var(--cn-soft); }

/* ---------- Images ---------- */

.cn-banner {
    margin: 0 0 36px;
    overflow: hidden;
    border-radius: 22px;
    aspect-ratio: 21 / 8;
    background: var(--cn-soft);
}

.cn-banner img,
.cn-main-image img,
.cn-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

.cn-main-image {
    margin: 0;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(7, 59, 76, .14);
}
.cn-main-image img { height: auto; }

.cn-slider {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: var(--cn-navy);
    box-shadow: 0 20px 40px rgba(7, 59, 76, .14);
}

.cn-slides { display: flex; transition: transform .5s ease; }
.cn-slide { position: relative; flex: 0 0 100%; margin: 0; aspect-ratio: 4 / 3; }

.cn-slide figcaption,
.cn-gallery figcaption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 24px 14px 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .65));
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
}

.cn-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px; height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    color: var(--cn-navy);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.cn-prev { left: 12px; }
.cn-next { right: 12px; }

.cn-dots {
    position: absolute;
    left: 0; right: 0; bottom: 12px;
    display: flex;
    justify-content: center;
    gap: 6px;
}
.cn-dots button {
    width: 8px; height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .55);
    cursor: pointer;
    transition: width .3s ease;
}
.cn-dots button.is-active { width: 22px; background: var(--cn-gold); }

/* ---------- Gallery ---------- */

.cn-gallery-wrap { margin-top: 48px; }

.cn-h2 {
    margin: 0 0 18px;
    color: var(--cn-navy);
    font-size: 24px;
    font-weight: 800;
}
.cn-h2 span { margin-left: 8px; color: #8aa0a8; font-size: 14px; font-weight: 600; }

.cn-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.cn-gallery figure {
    position: relative;
    margin: 0;
    overflow: hidden;
    border-radius: 14px;
    aspect-ratio: 4 / 3;
}
.cn-gallery img {
    width: 100%; height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform .4s ease;
}
.cn-gallery figure:hover img { transform: scale(1.05); }

/* ---------- Actions, share ---------- */

.cn-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.cn-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease;
}
.cn-btn:hover { transform: translateY(-2px); }
.cn-btn-primary { background: var(--cn-navy); color: #fff; }
.cn-btn-primary:hover { background: var(--cn-teal); color: #fff; }
.cn-btn-ghost { border-color: #c9dfe2; background: #fff; color: var(--cn-navy); }
.cn-btn-ghost:hover { border-color: var(--cn-teal); color: var(--cn-teal); }

.cn-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--cn-line);
    font-size: 14px;
}
.cn-share span { margin-right: 6px; color: var(--cn-navy); font-weight: 800; }
.cn-share a,
.cn-share button {
    padding: 6px 14px;
    border: 1px solid var(--cn-line);
    border-radius: 999px;
    background: #fff;
    color: var(--cn-navy);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.cn-share a:hover,
.cn-share button:hover { border-color: var(--cn-teal); color: var(--cn-teal); }

/* ---------- Related ---------- */

.cn-related { margin-top: 56px; }
.cn-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}
.cn-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--cn-line);
    border-radius: 16px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: transform .25s ease, box-shadow .25s ease;
}
.cn-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(7, 59, 76, .1); }
.cn-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.cn-card div { padding: 14px 16px 18px; }
.cn-card small { display: block; margin-bottom: 4px; color: var(--cn-teal); font-size: 12px; font-weight: 700; }
.cn-card strong { color: var(--cn-navy); font-size: 16px; line-height: 1.4; }

/* ---------- Lightbox ---------- */

.cn-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 22, 30, .92);
}
.cn-lightbox[hidden] { display: none; }
.cn-lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 10px; }
.cn-lightbox button {
    position: absolute;
    border: 0;
    background: none;
    color: #fff;
    font-size: 44px;
    line-height: 1;
    cursor: pointer;
}
.cn-lb-close { top: 16px; right: 24px; }
.cn-lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.cn-lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ---------- Responsive ---------- */

@media (max-width: 991px) {
    .cn-t1 .cn-body,
    .cn-t3 .cn-body,
    .cn-t4 .cn-body { grid-template-columns: 1fr; }
    .cn-side { position: static; order: -1; }
    .cn-banner { aspect-ratio: 16 / 9; }
}

@media (max-width: 575px) {
    .cn-detail { padding-top: 32px; font-size: 16px; }
    .cn-gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
