
/* ==========================================
   DFS — SINGLE HANDBOOK
   ========================================== */

.dfs-handbook-single {
    position: relative;
    width: 100%;
    padding: clamp(70px, 8vw, 120px) 0;
    background: #FFFFFF;
    overflow: hidden;
    font-family: "Sofia Sans", sans-serif;
}

.dfs-handbook-single__inner {
    width: min(calc(100% - 64px), 1320px);
    margin-inline: auto;
}

.dfs-handbook-single__layout {
    position: relative;
    display: grid;
    grid-template-columns:
        minmax(0, 0.72fr)
        minmax(0, 1.5fr);

    align-items: center;
    gap: clamp(55px, 8vw, 125px);
    padding-right: 90px;
}

/* Cover */

.dfs-handbook-single__cover-column {
    min-width: 0;
}

.dfs-handbook-single__cover {
    margin: 0;
}

.dfs-handbook-single__cover-image {
    display: block;
    width: 100%;
    height: auto;
    box-shadow: 0 15px 35px rgba(0, 54, 73, 0.15);
    transition:
        transform 350ms ease,
        box-shadow 350ms ease;
}

.dfs-handbook-single__cover-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 22px 45px rgba(0, 54, 73, 0.2);
}

/* Download */

.dfs-handbook-single__download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    width: 100%;
    min-height: 58px;
    margin-top: 26px;
    padding: 16px 20px;

    color: var(--dfs-white) !important;
    background: var(--dfs-orange);

    font-size: 0.95rem;
    font-weight: 850;
    text-align: center;
    text-decoration: none !important;

    transition:
        transform 220ms ease,
        background-color 220ms ease,
        box-shadow 220ms ease;
}

.dfs-handbook-single__download:hover {
    color: var(--dfs-white) !important;
    background: #DF4500;
    transform: translateY(-3px);
    box-shadow: 0 14px 25px rgba(255, 79, 0, 0.19);
}

.dfs-handbook-single__download:focus-visible {
    outline: 3px solid var(--dfs-navy);
    outline-offset: 4px;
}

/* Content */

.dfs-handbook-single__content {
    min-width: 0;
}

.dfs-handbook-single__eyebrow {
    margin: 0 0 22px;
    color: var(--dfs-orange);
    font-size: 0.8rem;
    font-weight: 850;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.dfs-handbook-single__title {
    margin: 0 0 30px;
    color: var(--dfs-navy);
    font-size: clamp(2.8rem, 4vw, 4.8rem);
    font-weight: 900;
    line-height: 1.04;
    letter-spacing: -0.045em;
    overflow-wrap: anywhere;
}

.dfs-handbook-single__description {
    max-width: 680px;
    color: var(--dfs-text);
    font-size: clamp(1.05rem, 1.35vw, 1.24rem);
    line-height: 1.65;
}

.dfs-handbook-single__description p {
    margin: 0 0 18px;
}

.dfs-handbook-single__description p:last-child {
    margin-bottom: 0;
}

/* Vertical code */

.dfs-handbook-single__code {
    position: absolute;
    right: 0;
    top: 50%;

    color: rgba(0, 54, 73, 0.13);

    font-size: clamp(4rem, 7vw, 7rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;

    writing-mode: vertical-rl;
    transform: translateY(-50%) rotate(180deg);
    pointer-events: none;
    user-select: none;
}

/* Gallery placeholder */

.dfs-handbook-single__gallery-slot {
    margin-top: clamp(60px, 7vw, 105px);
}

/* ==========================================
   Tablet
   ========================================== */

@media (max-width: 1024px) {

    .dfs-handbook-single__inner {
        width: min(calc(100% - 48px), 900px);
    }

    .dfs-handbook-single__layout {
        gap: 45px;
        padding-right: 60px;
    }

    .dfs-handbook-single__code {
        font-size: 4.5rem;
    }
}

/* ==========================================
   Mobile
   ========================================== */

@media (max-width: 767px) {

    .dfs-handbook-single {
        padding: 60px 0 75px;
    }

    .dfs-handbook-single__inner {
        width: calc(100% - 36px);
    }

    .dfs-handbook-single__layout {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 45px;
        padding-right: 0;
    }

    .dfs-handbook-single__cover-column {
        width: min(100%, 340px);
        margin-inline: auto;
        margin-top: 34px;
    }

    .dfs-handbook-single__title {
        font-size: clamp(2.5rem, 9vw, 3.7rem);
    }

    .dfs-handbook-single__code {
        position: static;
        align-self: flex-end;
        font-size: 3rem;
        writing-mode: horizontal-tb;
        transform: none;
    }

    .dfs-handbook-single__gallery-slot {
        margin-top: 55px;
    }
}

/* ==========================================
   Reduced motion
   ========================================== */

@media (prefers-reduced-motion: reduce) {

    .dfs-handbook-single__cover-image,
    .dfs-handbook-single__download {
        transition: none;
    }
}


/* ==========================================
   DFS HANDBOOK — CONNECTED GALLERY
   ========================================== */

.dfs-handbook-gallery {
    position: relative;
    width: 100%;
    padding: clamp(65px, 7vw, 105px) 0;
    background: #F7F9FA;
    overflow: hidden;
}

.dfs-handbook-gallery__inner {
    width: min(calc(100% - 64px), 1320px);
    margin-inline: auto;
}

/* Gallery layout */

.dfs-handbook-gallery__viewer {
    position: relative;
}

.dfs-handbook-gallery__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
}

.dfs-handbook-gallery__viewport::-webkit-scrollbar {
    display: none;
}

.dfs-handbook-gallery__viewport.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.dfs-handbook-gallery__track {
    display: flex;
    align-items: stretch;
    width: max-content;
    min-width: 100%;
    gap: 0;
}

/* Individual image */

.dfs-handbook-gallery__item {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: zoom-in;
    overflow: hidden;
    line-height: 0;
    -webkit-tap-highlight-color: transparent;
}

.dfs-handbook-gallery__image {
    display: block;
    width: auto;
    height: clamp(220px, 24vw, 370px);
    max-width: none;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

/* Orange line — only under hovered image */

.dfs-handbook-gallery__item::after {
    content: "";
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    bottom: 0;
    height: 5px;
    background: var(--dfs-orange);

    transform: scaleX(0);
    transform-origin: left center;

    transition: transform 420ms cubic-bezier(.2,.7,.2,1);
    pointer-events: none;
}

.dfs-handbook-gallery__item:hover::after,
.dfs-handbook-gallery__item:focus-visible::after {
    transform: scaleX(1);
}

.dfs-handbook-gallery__item:focus-visible {
    outline: 3px solid var(--dfs-orange);
    outline-offset: -3px;
}

/* Navigation */

.dfs-handbook-gallery__arrow {
    position: absolute;
    z-index: 5;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 64px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(255,255,255,.94);
    color: var(--dfs-navy);
    font-size: 1.8rem;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 220ms ease, color 220ms ease;
}

.dfs-handbook-gallery__arrow:hover {
    background: var(--dfs-orange);
    color: var(--dfs-white);
}

.dfs-handbook-gallery__arrow:disabled {
    opacity: .25;
    cursor: default;
}

.dfs-handbook-gallery__arrow--prev {
    left: 0;
}

.dfs-handbook-gallery__arrow--next {
    right: 0;
}

/* ==========================================
   FULLSCREEN LIGHTBOX
   ========================================== */

.dfs-handbook-lightbox[hidden] {
    display: none !important;
}

.dfs-handbook-lightbox {
    position: fixed;
    z-index: 999999;
    inset: 0;
    display: flex;
    align-items: center;
    background: rgba(0, 24, 34, .97);
    color: #fff;
    overflow: hidden;
}

body.dfs-handbook-lightbox-open {
    overflow: hidden;
}

.dfs-handbook-lightbox__top {
    position: absolute;
    z-index: 10;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 30px;
}

.dfs-handbook-lightbox__label {
    max-width: 75%;
    color: rgba(255,255,255,.8);
    font-size: .85rem;
    font-weight: 750;
    letter-spacing: .04em;
}

.dfs-handbook-lightbox__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 0;
    background: transparent;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
}

.dfs-handbook-lightbox__close:hover {
    background: var(--dfs-orange);
    border-color: var(--dfs-orange);
}

.dfs-handbook-lightbox__viewport {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    cursor: grab;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
}

.dfs-handbook-lightbox__viewport::-webkit-scrollbar {
    display: none;
}

.dfs-handbook-lightbox__viewport.is-dragging {
    cursor: grabbing;
}

.dfs-handbook-lightbox__track {
    display: flex;
    align-items: center;
    width: max-content;
    min-width: 100%;
    gap: 1px;
}

.dfs-handbook-lightbox__track img {
    display: block;
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    height: min(80vh, 850px);
    object-fit: contain;
    user-select: none;
    pointer-events: none;
}

.dfs-handbook-lightbox__arrow {
    position: absolute;
    z-index: 10;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 72px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    transform: translateY(-50%);
}

.dfs-handbook-lightbox__arrow:hover {
    background: var(--dfs-orange);
}

.dfs-handbook-lightbox__arrow:disabled {
    opacity: .25;
    cursor: default;
}

.dfs-handbook-lightbox__arrow--prev {
    left: 15px;
}

.dfs-handbook-lightbox__arrow--next {
    right: 15px;
}

.dfs-handbook-lightbox__help {
    position: absolute;
    bottom: 18px;
    left: 0;
    right: 0;
    margin: 0;
    color: rgba(255,255,255,.55);
    font-size: .78rem;
    text-align: center;
    pointer-events: none;
}

/* Tablet */

@media (max-width: 1024px) {
    .dfs-handbook-gallery__inner {
        width: calc(100% - 48px);
    }

    .dfs-handbook-gallery__image {
        height: 300px;
    }
}

/* Mobile */

@media (max-width: 767px) {
    .dfs-handbook-gallery {
        padding: 65px 0;
    }

    .dfs-handbook-gallery__inner {
        width: calc(100% - 32px);
    }

    .dfs-handbook-gallery__image {
        height: 240px;
    }

    .dfs-handbook-gallery__arrow {
        width: 40px;
        height: 52px;
        font-size: 1.4rem;
    }

    .dfs-handbook-lightbox__top {
        padding: 15px 16px;
    }

    .dfs-handbook-lightbox__track img {
        height: min(68vh, 600px);
    }

    .dfs-handbook-lightbox__arrow {
        width: 40px;
        height: 55px;
        font-size: 1.5rem;
    }

    .dfs-handbook-lightbox__arrow--prev {
        left: 0;
    }

    .dfs-handbook-lightbox__arrow--next {
        right: 0;
    }
}

/* Accessibility */

@media (prefers-reduced-motion: reduce) {
    .dfs-handbook-gallery__item::after,
    .dfs-handbook-gallery__arrow,
    .dfs-handbook-lightbox__arrow {
        transition: none;
    }
}

/* ==========================================
   DFS HANDBOOK — FULL WIDTH GALLERY
   ========================================== */

/* Основната информация остава над галерията */
.dfs-handbook-single {
    display: block;
    width: 100%;
    background: var(--dfs-white);
}

/* Галерията винаги е отделен ред */
.dfs-handbook-gallery {
    display: block;
    position: relative;
    clear: both;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 0 clamp(70px, 8vw, 120px);
    background: transparent;
}

/* Ширина на галерията */
.dfs-handbook-gallery__inner {
    width: min(calc(100% - 64px), 1320px);
    max-width: none;
    margin-inline: auto;
    padding: 0;
    background: transparent;
}

/* Премахваме декоративните фонове */
.dfs-handbook-gallery::before,
.dfs-handbook-gallery::after,
.dfs-handbook-gallery__inner::before,
.dfs-handbook-gallery__inner::after {
    content: none;
}

/* Премахваме фона около изображенията */
.dfs-handbook-gallery__viewer,
.dfs-handbook-gallery__viewport,
.dfs-handbook-gallery__track {
    background: transparent;
    box-shadow: none;
}

/* Галерията заема цялата налична ширина */
.dfs-handbook-gallery__viewer {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0;
}

/* Изображенията остават свързани */
.dfs-handbook-gallery__track {
    display: flex;
    gap: 0;
    align-items: stretch;
}

.dfs-handbook-gallery__item {
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

/* Стрелки от двете страни */
.dfs-handbook-gallery__arrow--prev {
    left: -24px;
}

.dfs-handbook-gallery__arrow--next {
    right: -24px;
}

/* Таблет */
@media (max-width: 1024px) {
    .dfs-handbook-gallery__inner {
        width: calc(100% - 48px);
    }

    .dfs-handbook-gallery__arrow--prev {
        left: -12px;
    }

    .dfs-handbook-gallery__arrow--next {
        right: -12px;
    }
}

/* Мобилно */
@media (max-width: 767px) {
    .dfs-handbook-gallery {
        padding-bottom: 65px;
    }

    .dfs-handbook-gallery__inner {
        width: calc(100% - 32px);
    }

    .dfs-handbook-gallery__arrow--prev {
        left: -8px;
    }

    .dfs-handbook-gallery__arrow--next {
        right: -8px;
    }
}

/* ==========================================
   DFS HANDBOOK — ASTRA LAYOUT FIX
   ========================================== */

/* Подреждаме основната информация и галерията вертикално */
body.single-dfs_handbook .ast-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* Основната информация заема цялата ширина */
body.single-dfs_handbook .ast-container > .dfs-handbook-single {
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
}

/* Галерията винаги е под основната информация */
body.single-dfs_handbook .ast-container > .dfs-handbook-gallery {
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
    align-self: stretch;
    background: transparent;
}

/* Запазваме светлия фон на цялата страница */
body.single-dfs_handbook {
    background: #fff;
}

/* Галерията следва основното съдържание */
body.single-dfs_handbook .dfs-handbook-gallery {
    margin-top: 0;
    padding-top: 0;
    padding-bottom: clamp(70px, 8vw, 120px);
}

/* По-широка композиция */
body.single-dfs_handbook .dfs-handbook-gallery__inner {
    width: min(calc(100% - 64px), 1320px);
    max-width: none;
    margin-inline: auto;
}

/* Без фон зад изображенията */
body.single-dfs_handbook .dfs-handbook-gallery__viewer,
body.single-dfs_handbook .dfs-handbook-gallery__viewport,
body.single-dfs_handbook .dfs-handbook-gallery__track {
    background: transparent;
}

/* Изображенията са непосредствено едно до друго */
body.single-dfs_handbook .dfs-handbook-gallery__track {
    gap: 1px;
}

@media (max-width: 767px) {
    body.single-dfs_handbook .dfs-handbook-gallery__inner {
        width: calc(100% - 32px);
    }
}

.ast-plain-container.ast-no-sidebar #primary {
  margin: 0;
}

/* ==========================================
   DFS HANDBOOK — COMPACT GALLERY
   ========================================== */

/* Desktop */
@media (min-width: 1025px) {
    body.single-dfs_handbook .dfs-handbook-gallery__item {
        height: 240px;
        width: auto;
        flex: 0 0 auto;
    }

    body.single-dfs_handbook .dfs-handbook-gallery__image {
        display: block;
        width: auto;
        height: 100%;
        max-width: none;
        object-fit: contain;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1024px) {
    body.single-dfs_handbook .dfs-handbook-gallery__item {
        height: 220px;
        width: auto;
        flex: 0 0 auto;
    }

    body.single-dfs_handbook .dfs-handbook-gallery__image {
        width: auto;
        height: 100%;
        max-width: none;
    }
}

/* Mobile */
@media (max-width: 767px) {
    body.single-dfs_handbook .dfs-handbook-gallery__item {
        height: 190px;
        width: auto;
        flex: 0 0 auto;
    }

    body.single-dfs_handbook .dfs-handbook-gallery__image {
        width: auto;
        height: 100%;
        max-width: none;
    }
}