/* Основной контейнер */
.cd-city-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 48px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    box-sizing: border-box;
    width: 100%;
}

/* Scoped global image rules - only within city pages */
.cd-city-page img {
    max-width: 100%;
    height: auto;
}

/* Respect WordPress srcset - don't override when natural ratio is intentional */
.cd-city-page img:not(.cd-hero-image):not(.cd-gallery-item img) {
    width: auto;
}

/* HERO */
.cd-hero-section {
    margin-bottom: 32px;
}

.cd-hero-top {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.cd-hero-title-block {
    flex: 1 1 320px;
    min-width: 0;
}

.cd-hero-title {
    font-size: 2rem;
    line-height: 1.2;
    margin: 0 0 8px;
}

.cd-hero-city {
    display: block;
    font-weight: 600;
    color: #EC6A00;
}

.cd-hero-subtitle {
    margin: 0 0 12px;
    font-size: 0.98rem;
    color: #555;
}

.cd-hero-badges {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cd-hero-badges li {
    font-size: 0.85rem;
    background: #f5f5f5;
    border-radius: 999px;
    padding: 6px 10px;
}

/* Кнопки */
.cd-hero-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.cd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.1s ease;
    white-space: nowrap;
    max-width: 100%;
    box-sizing: border-box;
}

.cd-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.cd-btn-whatsapp {
    background: #25D366;
    color: #fff;
}

.cd-btn-call {
    background: #1E90FF;
    color: #fff;
}

.cd-btn-email {
    background: #EC6A00;
    color: #fff;
}

/* HERO media – видео + фото рядом */
.cd-hero-media {
    flex: 1 1 320px;
    display: flex;
    gap: 12px;
    align-items: stretch;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.cd-hero-video-wrapper,
.cd-hero-image-wrapper {
    flex: 1 1 0;
    max-width: 50%;
    min-width: 0;
    aspect-ratio: 16 / 9;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    /* Desktop: visually dominant but not oversized - max height constraint */
    max-height: 500px;
}

.cd-hero-video,
.cd-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    /* Smooth image rendering for photos */
    image-rendering: auto;
    -ms-interpolation-mode: bicubic;
    /* Ensure image always fills container completely */
    min-width: 100%;
    min-height: 100%;
}

/* GRID: Preise + Kontakt */
.cd-info-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 32px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.cd-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid #eee;
}

.cd-card h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.cd-price-main {
    margin: 0 0 6px;
    font-weight: 500;
}

.cd-price-range,
.cd-price-teaser {
    margin: 0 0 6px;
    font-size: 0.9rem;
    color: #555;
}

.cd-list {
    list-style: disc;
    margin: 8px 0 0 18px;
    padding: 0;
    font-size: 0.9rem;
}

.cd-contact-line {
    margin: 0 0 6px;
    font-size: 0.9rem;
}

.cd-contact-line a {
    color: #EC6A00;
    text-decoration: none;
}

.cd-contact-line a:hover {
    text-decoration: underline;
}

.cd-contact-region {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #444;
}

/* Stuttgart works block */
.cd-stuttgart-works {
    margin: 40px 0;
}

.cd-stuttgart-works h2 {
    margin-bottom: 20px;
}

.cd-works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.cd-work-item img {
    width: 100%;
    height: auto;
    border-radius: 6px;
}

.cd-work-item figcaption {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.4;
}

/* Общие секции */
.cd-section {
    margin-bottom: 32px;
}

.cd-section h2 {
    font-size: 1.25rem;
    margin: 0 0 10px;
}

/* LongText */
.cd-section-longtext .cd-longtext {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
}

.cd-section-longtext .cd-longtext img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
}

/* Галерея - Mobile first: 1 column */
.cd-section-gallery .cd-gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Tablet: 2 columns */
@media (min-width: 600px) {
    .cd-section-gallery .cd-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Desktop: 3 columns */
@media (min-width: 900px) {
    .cd-section-gallery .cd-gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Large Desktop: 4 columns */
@media (min-width: 1100px) {
    .cd-section-gallery .cd-gallery-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.cd-gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 4 / 3;
    width: 100%;
    min-width: 0;
}

.cd-gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    max-width: 100%;
    /* Prevent layout shift during lazy loading */
    background: #000;
    min-height: 0;
}

/* FAQ + отзывы */
.cd-faq-block,
.cd-reviews-block {
    font-size: 0.95rem;
}

.cd-faq-block p,
.cd-reviews-block p {
    margin-bottom: 6px;
}

/* Карта */
.cd-section-map .cd-map-wrapper {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid #eee;
    height: 320px;
}

.cd-section-map iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Interlinks */
.cd-section-interlinks .cd-interlinks-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cd-interlink-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: #f4f4f4;
    font-size: 0.9rem;
    text-decoration: none;
    color: #333;
    transition: background-color 0.1s ease, transform 0.1s ease, box-shadow 0.1s ease;
}

.cd-interlink-btn:hover {
    background: #EC6A00;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}

/* Нижний CTA */
.cd-section-bottom-cta {
    margin-top: 16px;
}

.cd-bottom-cta-inner {
    border-radius: 18px;
    padding: 18px 18px 20px;
    background: linear-gradient(135deg, #EC6A00, #ff9440);
    color: #fff;
    text-align: center;
    box-shadow: 0 3px 14px rgba(0,0,0,0.18);
}

.cd-bottom-cta-inner h2 {
    margin: 0 0 8px;
    font-size: 1.25rem;
}

.cd-bottom-cta-inner p {
    margin: 0 0 14px;
    font-size: 0.95rem;
}

/* Респонсив */
@media (max-width: 900px) {
    .cd-hero-top {
        flex-direction: column;
    }

    .cd-hero-media {
        width: 100%;
        flex-direction: column;
    }

    .cd-hero-video-wrapper,
    .cd-hero-image-wrapper {
        max-width: 100%;
        width: 100%;
        aspect-ratio: 16 / 9;
        max-height: 65vh;
    }

    .cd-info-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 599px) {
    /* Mobile: 1 column (already set by base, but ensure consistency) */
    .cd-section-gallery .cd-gallery-grid {
        grid-template-columns: 1fr;
    }

    .cd-hero-title {
        font-size: 1.6rem;
    }

    .cd-hero-video-wrapper,
    .cd-hero-image-wrapper {
        max-height: 60vh;
    }

    .cd-bottom-cta-inner {
        padding: 16px 14px 18px;
    }
    
    .cd-btn {
        white-space: normal;
        min-width: 0;
        max-width: 100%;
    }
    
    .cd-hero-cta-row {
        flex-wrap: wrap;
        gap: 8px;
    }
}
/* =========================
   CUTDRILL – CITY FOOTER
   ========================= */
.cd-city-footer {
    margin-top: 48px;
    padding: 40px 0 32px;
    border-top: 1px solid #e5e5e5;
    background: #f7f7f7;
}

.cd-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: flex-start;
}

.cd-footer-col {
    flex: 1 1 260px;
    min-width: 0;
    max-width: 100%;
}

/* Брендовый блок слева */
.cd-footer-logo-text {
    font-weight: 700;
    font-size: 1.3rem;
}

.cd-footer-tagline {
    margin-top: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Центральная навигация */
.cd-footer-heading {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.cd-footer-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cd-footer-nav li {
    margin-bottom: 4px;
}

.cd-footer-nav a {
    text-decoration: none;
    font-size: 0.95rem;
}

.cd-footer-nav a:hover {
    text-decoration: underline;
}

/* Контакты справа */
.cd-footer-contact-line {
    margin: 0 0 6px;
    font-size: 0.95rem;
}

.cd-footer-contact-line a {
    text-decoration: none;
}

.cd-footer-contact-line a:hover {
    text-decoration: underline;
}

.cd-footer-cta-row {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Нижняя полоска */
.cd-footer-bottom {
    max-width: 1200px;
    margin: 24px auto 0;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    font-size: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
}

.cd-footer-copy,
.cd-footer-legal {
    margin: 0;
}

.cd-footer-legal a {
    text-decoration: none;
}

.cd-footer-legal a:hover {
    text-decoration: underline;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .cd-footer-inner {
        flex-direction: column;
    }

    .cd-footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .cd-footer-cta-row {
        justify-content: flex-start;
    }
    
    .cd-footer-col {
        min-width: 0;
        max-width: 100%;
    }
}

/* Root overflow protection - minimal fallback only if absolutely needed */
* {
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}
