/* ═══════════════════════════════════════════════════
   Drawing Tutorial Generator — Frontend v1.2
   ═══════════════════════════════════════════════════ */

/* ── Base ──────────────────────────────────────────── */
.dtg-wrap {
    max-width: 1140px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, sans-serif;
    color: #1a1a2e;
}

/* ── Layout: content + sidebar ─────────────────────── */
.dtg-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    align-items: start;
}
.dtg-content { min-width: 0; }

/* ═══════════════════════════════════════════════════
   HERO SLIDER
   ═══════════════════════════════════════════════════ */
.dtg-hero {
    background: #0d0d1a;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 12px 40px rgba(0,0,0,.3);
}

.dtg-slide-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: #0d0d1a;
}
.dtg-main .swiper-slide img {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    display: block;
}
.dtg-slide-label {
    position: absolute;
    bottom: 14px;
    left: 14px;
    background: rgba(0,0,0,.65);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

/* Nav buttons */
.dtg-nav-btn {
    color: #fff !important;
    background: rgba(0,0,0,.5) !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    backdrop-filter: blur(4px);
    transition: background .2s !important;
}
.dtg-nav-btn::after { font-size: 14px !important; }
.dtg-nav-btn:hover  { background: rgba(99,102,241,.85) !important; }

/* Pagination */
.dtg-pagination .swiper-pagination-bullet        { background: rgba(255,255,255,.45); }
.dtg-pagination .swiper-pagination-bullet-active { background: #6366f1; }

/* Thumbs strip */
.dtg-thumbs {
    padding: 10px 10px 12px !important;
    background: #0d0d1a;
}
.dtg-thumbs .swiper-slide {
    width: 68px !important;
    height: 68px !important;
    cursor: pointer;
    opacity: .5;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: opacity .2s, border-color .2s, transform .15s;
    flex-shrink: 0;
}
.dtg-thumbs .swiper-slide img { width:100%; height:100%; object-fit:cover; display:block; }
.dtg-thumbs .swiper-slide-thumb-active {
    opacity: 1;
    border-color: #6366f1;
    transform: scale(1.06);
}

/* ═══════════════════════════════════════════════════
   SHARE BAR
   ═══════════════════════════════════════════════════ */
.dtg-share {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #eeeef8;
    margin-bottom: 30px;
}
.dtg-share__lbl {
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .9px;
    color: #999;
    margin-right: 4px;
}
.dtg-share__btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 15px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
    color: #fff !important;
    border: none;
    cursor: pointer;
    line-height: 1;
    transition: filter .2s, transform .15s;
    font-family: inherit;
}
.dtg-share__btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.dtg-share--fb    { background: #1877f2 !important; color: #fff !important; }
.dtg-share--wa    { background: #25d366 !important; color: #fff !important; }
.dtg-share--pin   { background: #e60023 !important; color: #fff !important; }
.dtg-share--rd    { background: #ff4500 !important; color: #fff !important; }
.dtg-share--print { background: #374151 !important; color: #fff !important; }

/* Related posts */
.dtg-sidebar__related {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    max-height: 320px;
    overflow-y: auto;
}
.dtg-related-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    text-decoration: none;
    color: #1a1a2e;
    font-size: 12px;
    font-weight: 600;
    border-bottom: 1px solid #f5f5fb;
    transition: background .15s;
}
.dtg-related-item:hover { background: #f5f5ff; }
.dtg-sidebar__related li:last-child .dtg-related-item { border-bottom: none; }
.dtg-related-item img {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px;
    max-width: 38px !important;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
    border: 1px solid #ebebf5;
    display: block;
}
.dtg-related-item span { line-height: 1.3; }

/* ═══════════════════════════════════════════════════
   STEPS
   ═══════════════════════════════════════════════════ */
.dtg-steps__title {
    font-size: 19px;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid #6366f1;
}

.dtg-step {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: center;
    margin-bottom: 28px;
    padding: 24px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(0,0,0,.07);
    border: 1px solid #f0f0f8;
    transition: box-shadow .25s;
}
.dtg-step:hover { box-shadow: 0 6px 28px rgba(99,102,241,.14); }
.dtg-step--rtl  { direction: rtl; }
.dtg-step--rtl .dtg-step__body { direction: ltr; }

/* Step image (clickable → lightbox) */
.dtg-step__img {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    line-height: 0;
}
.dtg-step__img a { display: block; position: relative; }
.dtg-step__img img {
    width: 100%;
    border-radius: 10px;
    display: block;
    transition: transform .3s;
}
.dtg-step__img a:hover img { transform: scale(1.04); }

/* Zoom icon */
.dtg-step__zoom {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
    backdrop-filter: blur(3px);
}
.dtg-step__img a:hover .dtg-step__zoom { opacity: 1; }

/* Step body */
.dtg-step__body {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.dtg-step__num {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(99,102,241,.38);
}
.dtg-step__num span {
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
}
.dtg-step__text { flex: 1; min-width: 0; }
.dtg-step__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: #6366f1;
    margin: 0 0 8px;
}
.dtg-step__desc {
    margin: 0;
    font-size: 15px;
    line-height: 1.75;
    color: #3d3d55;
}

/* ═══════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════ */
.dtg-sidebar {
    position: sticky;
    top: 24px;
    align-self: start;      /* critical for sticky inside CSS grid */
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.dtg-sidebar__box {
    background: #fff;
    border: 1px solid #ebebf5;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

.dtg-sidebar__title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .9px;
    color: #fff;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    margin: 0;
    padding: 12px 18px;
}

/* Details list */
.dtg-sidebar__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.dtg-sidebar__list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    border-bottom: 1px solid #f5f5fb;
    font-size: 13px;
    gap: 10px;
}
.dtg-sidebar__list li:last-child { border-bottom: none; }
.dtg-sidebar__list span  { color: #888; white-space: nowrap; }
.dtg-sidebar__list strong{ color: #1a1a2e; text-align: right; }

/* Description from GPT */
.dtg-sidebar__desc {
    padding: 14px 18px 16px;
    font-size: 13px;
    line-height: 1.7;
    color: #555;
    border-top: 1px solid #f0f0f8;
}

/* Steps nav */
.dtg-sidebar__steps {
    list-style: none;
    margin: 0;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 400px;
    overflow-y: auto;
}
.dtg-step-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 9px;
    border-radius: 9px;
    text-decoration: none !important;
    color: #3d3d55 !important;
    font-size: 13px;
    font-weight: 600;
    transition: background .15s;
}
.dtg-step-nav:hover { background: #f0f0ff; color: #6366f1 !important; }
.dtg-step-nav img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 7px;
    border: 1px solid #eee;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════════════════ */
.dtg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
}
.dtg-lb__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5,5,15,.92);
    backdrop-filter: blur(8px);
}
.dtg-lb__inner {
    position: relative;
    z-index: 1;
    max-width: 92vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.dtg-lb__img {
    max-width: 88vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 24px 70px rgba(0,0,0,.55);
    display: block;
}
.dtg-lb__caption {
    color: rgba(255,255,255,.75);
    font-size: 14px;
    margin: 0;
    text-align: center;
    font-family: -apple-system, sans-serif;
}
.dtg-lb__close,
.dtg-lb__prev,
.dtg-lb__next {
    position: absolute;
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    backdrop-filter: blur(6px);
    transition: background .2s;
    line-height: 1;
    font-family: inherit;
}
.dtg-lb__close:hover,
.dtg-lb__prev:hover,
.dtg-lb__next:hover { background: rgba(99,102,241,.75); }
.dtg-lb__close { top: -52px; right: 0; font-size: 16px; }
.dtg-lb__prev  { top: 50%; left: -60px; transform: translateY(-50%); }
.dtg-lb__next  { top: 50%; right: -60px; transform: translateY(-50%); }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 960px) {
    .dtg-layout { grid-template-columns: 1fr; }
    .dtg-sidebar { position: static; }
    .dtg-sidebar--hide-mobile { display: none; }
}
@media (max-width: 640px) {
    .dtg-step { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
    .dtg-step--rtl { direction: ltr; }
    .dtg-slide-inner { min-height: 240px; }
    .dtg-lb__prev { left: -46px; }
    .dtg-lb__next { right: -46px; }
    .dtg-lb__close { top: -48px; }
}

/* ═══════════════════════════════════════════════════
   PRINT — only called from our JS print window
   ═══════════════════════════════════════════════════ */
@media print {
    .dtg-hero, .dtg-share, .dtg-sidebar,
    .dtg-steps__title, .dtg-lightbox { display: none !important; }
}
