/*
 * Public CMS pages (Phase 3B-3): styles that were inline in portfolio.php, gallery.php and
 * calculator.php, plus the classes used by the section templates in app/Views/public/sections/.
 */

/* ---- from portfolio.php ---- */
.portfolio-filter-bar {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        margin-bottom: 40px;
    }
    .filter-btn {
        background: #ffffff;
        color: #475569;
        border: 1px solid var(--border);
        padding: 10px 22px;
        border-radius: 30px;
        font-size: 0.88rem;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    .filter-btn:hover, .filter-btn.active {
        background: var(--brand);
        color: #ffffff;
        border-color: var(--brand);
        box-shadow: 0 4px 14px rgba(244, 57, 14, 0.3);
    }
    .portfolio-grid-showcase {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 28px;
        margin-bottom: 60px;
    }
    .portfolio-card-item {
        background: #ffffff;
        border-radius: 20px;
        overflow: hidden;
        border: 1px solid var(--border);
        box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
        transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        display: flex;
        flex-direction: column;
        cursor: pointer;
    }
    .portfolio-card-item:hover {
        transform: translateY(-8px);
        box-shadow: 0 16px 32px rgba(244, 57, 14, 0.12);
        border-color: rgba(244, 57, 14, 0.3);
    }
    .portfolio-thumb-wrapper {
        position: relative;
        width: 100%;
        height: 230px;
        overflow: hidden;
        background: #f8fafc;
    }
    .portfolio-thumb-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.5s ease;
    }
    .portfolio-card-item:hover .portfolio-thumb-img {
        transform: scale(1.08);
    }
    .portfolio-overlay-badge {
        position: absolute;
        top: 14px;
        left: 14px;
        background: rgba(15, 23, 42, 0.85);
        backdrop-filter: blur(8px);
        color: #ffffff;
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 1px;
        text-transform: uppercase;
        padding: 5px 12px;
        border-radius: 14px;
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    .portfolio-content-body {
        padding: 22px;
        display: flex;
        flex-direction: column;
        flex-grow: 1;
    }
    .portfolio-client-tag {
        font-size: 0.78rem;
        color: var(--brand);
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        margin-bottom: 6px;
    }
    .portfolio-card-title {
        font-size: 1.18rem;
        font-weight: 800;
        color: var(--dark);
        line-height: 1.35;
        margin-bottom: 10px;
    }
    .portfolio-card-desc {
        font-size: 0.88rem;
        color: var(--dark-muted);
        line-height: 1.6;
        margin-bottom: 18px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .portfolio-action-link {
        margin-top: auto;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-size: 0.85rem;
        font-weight: 800;
        color: var(--brand);
        text-decoration: none;
    }

    /* LIGHTBOX MODAL */
    .portfolio-modal-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.85);
        backdrop-filter: blur(10px);
        z-index: 99999;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 20px;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .portfolio-modal-backdrop.active {
        display: flex;
        opacity: 1;
    }
    .portfolio-modal-card {
        background: #ffffff;
        width: 100%;
        max-width: 820px;
        border-radius: 24px;
        overflow: hidden;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
        position: relative;
        transform: scale(0.92);
        transition: transform 0.3s ease;
    }
    .portfolio-modal-backdrop.active .portfolio-modal-card {
        transform: scale(1);
    }
    .portfolio-modal-close {
        position: absolute;
        top: 16px;
        right: 16px;
        width: 38px;
        height: 38px;
        border-radius: 50%;
        background: rgba(15, 23, 42, 0.7);
        color: #ffffff;
        border: none;
        font-size: 1.1rem;
        cursor: pointer;
        z-index: 10;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.2s;
    }
    .portfolio-modal-close:hover {
        background: var(--brand);
    }
    .portfolio-modal-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    @media (max-width: 768px) {
        .portfolio-modal-grid {
            grid-template-columns: 1fr;
        }
    }

/* ---- from gallery.php ---- */
.gallery-filter-bar {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        margin-bottom: 40px;
    }
    .gallery-filter-btn {
        background: #ffffff;
        color: #475569;
        border: 1px solid var(--border);
        padding: 10px 22px;
        border-radius: 30px;
        font-size: 0.88rem;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    .gallery-filter-btn:hover, .gallery-filter-btn.active {
        background: var(--brand);
        color: #ffffff;
        border-color: var(--brand);
        box-shadow: 0 4px 14px rgba(244, 57, 14, 0.3);
    }
    .gallery-grid-masonry {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 24px;
        margin-bottom: 60px;
    }
    .gallery-item-card {
        position: relative;
        border-radius: 20px;
        overflow: hidden;
        height: 280px;
        background: #0f172a;
        box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
        cursor: pointer;
        border: 1px solid var(--border);
    }
    .gallery-item-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
    }
    .gallery-item-card:hover .gallery-item-img {
        transform: scale(1.1);
        opacity: 0.85;
    }
    .gallery-card-overlay {
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(15, 23, 42, 0) 20%, rgba(15, 23, 42, 0.92) 100%);
        padding: 24px;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        transition: opacity 0.3s ease;
    }
    .gallery-card-category {
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 1.2px;
        text-transform: uppercase;
        color: var(--brand);
        margin-bottom: 6px;
    }
    .gallery-card-title {
        font-size: 1.1rem;
        font-weight: 800;
        color: #ffffff;
        line-height: 1.3;
    }
    .gallery-card-zoom-icon {
        position: absolute;
        top: 16px;
        right: 16px;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(8px);
        color: #ffffff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.85rem;
        transition: background 0.3s, transform 0.3s;
    }
    .gallery-item-card:hover .gallery-card-zoom-icon {
        background: var(--brand);
        transform: scale(1.1);
    }

    /* LIGHTBOX MODAL */
    .gallery-modal-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.92);
        backdrop-filter: blur(12px);
        z-index: 99999;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 20px;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .gallery-modal-backdrop.active {
        display: flex;
        opacity: 1;
    }
    .gallery-modal-content {
        background: #0f172a;
        border-radius: 24px;
        max-width: 900px;
        width: 100%;
        overflow: hidden;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
        border: 1px solid rgba(244, 57, 14, 0.3);
        position: relative;
    }
    .gallery-modal-close {
        position: absolute;
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.15);
        color: #ffffff;
        border: none;
        font-size: 1.1rem;
        cursor: pointer;
        z-index: 10;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.2s;
    }
    .gallery-modal-close:hover {
        background: var(--brand);
    }

/* ---- from calculator.php ---- */
.ts-calc-msg { padding: 14px 18px; border-radius: 12px; font-weight: 700; margin-bottom: 18px; }
  .ts-calc-msg.ok { background: #feebe7; color: #7a1d07; border: 1px solid #fbb09f; }
  .ts-calc-msg.err { background: #fff1f0; color: #922208; border: 1px solid #f8886e; }
  .ts-calc-empty { padding: 30px; text-align: center; color: #64748b; font-weight: 600; }
  .ts-calc-quote input, .ts-calc-quote textarea { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid #e2e8f0; font: inherit; box-sizing: border-box; }
  .ts-calc-quote textarea { min-height: 80px; resize: vertical; }
  .ts-calc-quote .ts-calc-field { margin-bottom: 12px; }
  .ts-calc-hidden { display: none !important; }

/* ---- section templates (Phase 3B-3) ---- */
.cms-pad { padding: 80px 0; }
.cms-center-actions { justify-content: center; margin-top: 24px; }
.cms-left { text-align: left; }
.cms-section-btn { display: flex; width: max-content; margin: 32px auto 0; }

/* story */
.cms-story-text { font-size: 1.02rem; color: var(--dark-muted); line-height: 1.7; margin-bottom: 20px; }
.about-story-grid.cms-story-noimg { grid-template-columns: 1fr; max-width: 900px; }
.about-story-content .hero-actions { margin-top: 24px; gap: 14px; }

/* mission / vision boxes */
.cms-boxes { padding-top: 0; }
.mission-vision-container.cms-boxes-single { grid-template-columns: 1fr; max-width: 900px; }
.mv-box:nth-child(2n) .mv-icon { background: #FEF3C7; color: #D97706; }
.cms-mv-title { font-size: 1.35rem; font-weight: 700; color: var(--dark); margin-bottom: 12px; }
.cms-mv-desc { color: var(--dark-muted); line-height: 1.65; font-size: 0.96rem; }

/* values */
.cms-value-icon { background: var(--brand-90); color: var(--brand); margin: 0 auto 20px; }
.value-card:nth-child(3n+2) .cms-value-icon { background: #E0E7FF; color: #4F46E5; }
.value-card:nth-child(3n) .cms-value-icon { background: #DCFCE7; color: #16A34A; }
.cms-value-title { font-size: 1.2rem; font-weight: 700; color: var(--dark); margin-bottom: 10px; }
.cms-value-desc { font-size: 0.92rem; color: var(--dark-light); line-height: 1.6; }

/* service catalogue / production lines / steps */
.services-section.cms-catalog { padding: 70px 0 40px; }
.cms-badge-2 { background: #FEF3C7; color: #D97706; }
.cms-badge-3 { background: #E0E7FF; color: #4F46E5; }
.cms-detail-title { font-size: 1.6rem; font-weight: 800; color: var(--dark); margin: 8px 0 14px; }
.cms-detail-desc { color: var(--dark-muted); line-height: 1.65; font-size: 1rem; }
.cms-detail-actions { margin-top: 24px; }
.cms-detail-img { border-radius: var(--radius-xl); box-shadow: var(--shadow-md); width: 100%; height: 300px; object-fit: cover; }
.service-detail-card.cms-detail-noimg { grid-template-columns: 1fr; }
.cms-step-title { font-size: 1.15rem; font-weight: 700; color: var(--dark); margin-bottom: 8px; }
.cms-step-desc { font-size: 0.9rem; color: var(--dark-light); line-height: 1.55; }

/* portfolio / gallery */
.cms-showcase { padding: 60px 0 90px; }
.cms-showcase .section-header { margin-bottom: 32px; }
[data-cms-item][hidden] { display: none !important; }
.portfolio-client-tag i { margin-right: 4px; }
.cms-modal-media { height: 380px; background: #0f172a; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cms-modal-media img { width: 100%; height: 100%; object-fit: cover; }
.cms-modal-body { padding: 32px; display: flex; flex-direction: column; justify-content: center; }
.cms-modal-cat { display: inline-block; font-size: 0.75rem; font-weight: 800; color: var(--brand); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.cms-modal-title { font-size: 1.45rem; font-weight: 900; color: #0f172a; line-height: 1.3; margin-bottom: 12px; }
.cms-modal-client { font-size: 0.85rem; font-weight: 700; color: #64748b; margin-bottom: 16px; }
.cms-modal-client i { color: var(--brand); margin-right: 6px; }
.cms-modal-client span { color: #0f172a; }
.cms-modal-desc { font-size: 0.92rem; color: #475569; line-height: 1.65; margin-bottom: 24px; }
.cms-gmodal-media { max-height: 520px; overflow: hidden; background: #000; display: flex; align-items: center; justify-content: center; }
.cms-gmodal-media img { width: 100%; height: 100%; object-fit: contain; }
.cms-gmodal-body { padding: 28px; background: #0f172a; color: #ffffff; }
.cms-gmodal-title { font-size: 1.35rem; font-weight: 900; color: #ffffff; margin-bottom: 10px; }
.cms-gmodal-desc { font-size: 0.92rem; color: #94a3b8; line-height: 1.6; }
@media (max-width: 768px) { .cms-modal-media { height: 240px; } }

/* statistics strip */
.cms-strip-section { padding: 0 0 70px; }
.cms-stats-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; background: #ffffff; padding: 36px 30px; border-radius: 24px; border: 1px solid var(--border); box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04); text-align: center; }
.cms-strip-num { font-size: 2.2rem; font-weight: 900; color: var(--brand); }
.cms-strip-item:nth-child(2n) .cms-strip-num { color: var(--dark); }
.cms-strip-label { font-size: 0.82rem; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }

/* contact */
.info-card:nth-child(5n+2) .info-card-icon { background: #E0E7FF; color: #4F46E5; }
.info-card:nth-child(5n+3) .info-card-icon { background: #E0F2FE; color: #0284C7; }
.info-card:nth-child(5n+4) .info-card-icon { background: #DCFCE7; color: #16A34A; }
.info-card:nth-child(5n) .info-card-icon { background: #FEF3C7; color: #D97706; }
.cms-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cms-form-intro { color: var(--dark-muted); margin-bottom: 16px; line-height: 1.6; }
.map-card-header h3 i { color: var(--brand); }
.cms-map-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cms-btn-sm { padding: 10px 20px; font-size: 0.88rem; }
.cms-map-frame { height: 420px; width: 100%; position: relative; }
.cms-map-frame iframe { border: 0; position: absolute; inset: 0; width: 100%; height: 100%; }

/* alerts after a form was sent */
.twilight-alert.cms-alert-error { border-left-color: #EF4444; }
.cms-alert-icon { color: var(--brand); margin-right: 10px; }
.cms-alert-error .cms-alert-icon { color: #EF4444; }

/* calculator */
.cms-muted { color: #64748b; }
.cms-calc-quote-title { margin: 18px 0 10px; font-size: 1rem; }
.cms-calc-submit { border: none; cursor: pointer; width: 100%; justify-content: center; }

/* buttons keep their natural width in the page hero and in text-only production lines
   (style.css makes .btn-primary-pill full width; phones still get full-width buttons) */
.cms-center-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.cms-center-actions .btn-primary-pill,
.cms-detail-noimg .cms-detail-actions .btn-primary-pill { width: auto; }
@media (max-width: 768px) {
    .cms-center-actions .btn-primary-pill,
    .cms-detail-noimg .cms-detail-actions .btn-primary-pill { width: 100%; }
}
