/* =======================================================
   RESPONSIVE CONFIGURATIONS (Sağlık Dergisi & Gazetesi)
======================================================= */

/* -------------------------------------------------------
   FIX: Hero slider overflow bleed — force all carousel
   wrappers to clip at every breakpoint
------------------------------------------------------- */
.hero-wrapper {
    overflow: hidden !important;
}

.hero-wrapper .carousel-inner {
    overflow: hidden !important;
}

.hero-wrapper .carousel-item {
    overflow: hidden !important;
}

.hero-slider-card {
    overflow: hidden !important;
}

/* Extra Small Devices (Mobil Portre - < 576px) */
@media (max-width: 575.98px) {
    .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    section {
        padding: 30px 0 !important;
    }

    /* Typography Scaling */
    .display-4 {
        font-size: 1.8rem !important;
        line-height: 1.2 !important;
    }

    .display-5 {
        font-size: 1.5rem !important;
    }

    .hero-content p {
        font-size: 0.9rem !important;
        margin-bottom: 1.5rem !important;
    }

    /* Hero Section — Stacked Layout */
    .hero-wrapper {
        border-radius: 20px !important;
    }

    .hero-slider-card {
        padding: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        flex-direction: column !important;
        align-items: stretch !important;
        background: #120a31 !important;
        border-radius: 20px !important;
    }

    .hero-wrapper,
    .carousel-inner,
    .carousel-item {
        height: auto !important;
    }

    .hero-bg-image {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        bottom: auto !important;
        height: 220px !important;
        width: 100% !important;
        object-fit: cover !important;
        object-position: center center !important;
        z-index: 1 !important;
        animation: none !important;
        transform: none !important;
        border-radius: 20px 20px 0 0 !important;
        opacity: 1 !important;
    }

    .hero-content {
        max-width: 100% !important;
        width: 100% !important;
        padding: 25px 20px 30px !important;
        text-align: center;
        position: relative !important;
        z-index: 2 !important;
    }

    .hero-content .btn {
        justify-content: center;
        width: 100%;
    }

    /* Magazine Promo Adjustment */
    .magazine-promo-card {
        padding: 25px 15px !important;
        height: auto !important;
    }

    .magazine-promo-card h2 {
        font-size: 1.6rem !important;
    }

    /* Canlı Yayın & Timeline */
    .date-badge {
        min-width: 70px !important;
        min-height: 80px !important;
        padding: 15px 5px !important;
    }

    .date-badge .fs-2 {
        font-size: 1.5rem !important;
    }

    .timeline::before {
        left: 20px !important;
    }

    .timeline-badge {
        left: 20px !important;
    }

    .timeline-panel {
        width: calc(100% - 50px) !important;
        float: right !important;
    }

    .timeline-panel::before {
        border-left-width: 0 !important;
        border-right-width: 15px !important;
        left: -15px !important;
        right: auto !important;
    }
}

/* Small Devices (Mobil Yatay - 576px - 767.98px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .display-4 {
        font-size: 2.2rem !important;
    }

    .hero-wrapper {
        border-radius: 25px !important;
    }

    .hero-slider-card {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        border-radius: 25px !important;
    }

    .hero-wrapper,
    .carousel-inner,
    .carousel-item {
        height: auto !important;
    }

    .hero-bg-image {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        bottom: auto !important;
        height: 280px !important;
        width: 100% !important;
        object-fit: cover !important;
        object-position: center center !important;
        animation: none !important;
        transform: none !important;
        border-radius: 25px 25px 0 0 !important;
        opacity: 1 !important;
    }

    .hero-content {
        max-width: 100% !important;
        width: 100% !important;
        padding: 30px 25px 35px !important;
        text-align: center !important;
    }
}

/* Medium Devices (Tabletler - 768px - 991.98px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .display-4 {
        font-size: 2.2rem !important;
    }

    .hero-content p {
        font-size: 1rem !important;
    }

    .hero-wrapper {
        border-radius: 30px !important;
    }

    .hero-slider-card {
        padding: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        flex-direction: column !important;
        align-items: stretch !important;
        border-radius: 30px !important;
    }

    .hero-wrapper,
    .carousel-inner,
    .carousel-item {
        height: auto !important;
    }

    .hero-bg-image {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        bottom: auto !important;
        height: 350px !important;
        width: 100% !important;
        object-fit: cover !important;
        object-position: center center !important;
        animation: none !important;
        transform: none !important;
        border-radius: 30px 30px 0 0 !important;
        opacity: 1 !important;
    }

    .hero-content {
        max-width: 100% !important;
        width: 100% !important;
        padding: 35px 30px 40px !important;
    }

    .navbar-custom .navbar-nav {
        background-color: rgba(10, 5, 27, 0.95);
        padding: 20px;
        border-radius: 15px;
        margin-top: 15px;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Large & Squeeze Viewports (992px - 1199.98px) */
@media (max-width: 1199.98px) {
    .display-4 {
        font-size: 2.8rem !important;
    }

    .hero-content p {
        font-size: 1.1rem !important;
    }

    /* Break flex columns on grid layouts */
    .row-cols-md-4 .col {
        width: 50% !important;
        margin-bottom: 15px;
    }
}

/* Global Utility Adjustments for All Mobile Screens */

/* Magazine Promo Stacking Breakpoint */
@media (max-width: 987px) {
    .magazine-promo-card .row {
        flex-direction: column-reverse !important;
        text-align: center;
    }

    .magazine-promo-card .row [class*="col-"] {
        width: 100% !important;
    }

    .magazine-promo-card .d-flex.flex-column {
        align-items: center !important;
    }

    .magazine-promo-card {
        height: auto !important;
        padding: 30px 20px !important;
    }

    .magazine-promo-card img {
        max-height: 240px !important;
        margin-bottom: 25px;
        transform: none !important;
    }
}

@media (max-width: 991.98px) {

    .hero-wrapper,
    .carousel-inner,
    .carousel-item,
    .hero-slider-card {
        height: auto !important;
        min-height: 0 !important;
    }

    .footer-links {
        text-align: center;
    }

    .footer-links li a {
        padding-left: 0 !important;
    }
}

/* Ultra Small Devices (JioPhone 2, etc. - < 320px) */
@media (max-width: 320px) {
    .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    section {
        padding: 20px 0 !important;
    }

    h2 {
        font-size: 1.2rem !important;
    }

    h3 {
        font-size: 1.1rem !important;
    }

    h4 {
        font-size: 1rem !important;
    }

    .display-4 {
        font-size: 1.4rem !important;
    }

    .hero-content p {
        font-size: 0.85rem !important;
    }

    .hero-bg-image {
        height: 180px !important;
    }

    .hero-content {
        padding: 20px 15px 25px !important;
    }

    .btn {
        padding: 8px 15px !important;
        font-size: 0.8rem !important;
    }

    .magazine-promo-card h2 {
        font-size: 1.3rem !important;
    }

    .magazine-promo-card .row {
        flex-direction: column-reverse !important;
    }

    .magazine-promo-card .col-6 {
        width: 100% !important;
        text-align: center !important;
    }

    .magazine-promo-card img {
        max-height: 200px !important;
        margin-bottom: 15px;
    }

    /* Newsletter stack fix */
    .newsletter-box .input-group {
        flex-direction: column !important;
        gap: 10px;
        background: transparent !important;
    }

    .newsletter-box .input-group input {
        border-radius: 12px !important;
        width: 100% !important;
    }

    .newsletter-box .input-group button {
        border-radius: 12px !important;
        width: 100% !important;
    }
}

/* -------------------------------------------------------
   Site-wide mobile hardening
   Applies to the public website: home, news, magazine,
   interviews, broadcasts, announcements, authors, contact.
------------------------------------------------------- */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
video,
iframe {
    max-width: 100%;
}

img {
    height: auto;
}

.container,
.container-fluid {
    min-width: 0;
}

.row {
    min-width: 0;
}

[class*="col-"] {
    min-width: 0;
}

.card,
.news-card,
.article-card,
.interview-card,
.broadcast-card,
.magazine-card,
.announcement-card,
.timeline-card,
.footer-card {
    min-width: 0;
}

.card p,
.card h1,
.card h2,
.card h3,
.card h4,
.card h5,
.card h6,
.news-card p,
.article-card p,
.interview-card p,
.broadcast-card p,
.magazine-card p,
.announcement-card p {
    overflow-wrap: anywhere;
}

@media (max-width: 1199.98px) {
    .navbar .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .navbar-collapse {
        margin-top: 0.75rem;
        padding: 0.75rem;
        border-radius: 14px;
        background: #ffffff;
        box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    }

    .navbar-nav {
        align-items: center !important;
        gap: 0.25rem !important;
        text-align: center;
    }

    .navbar-nav .nav-item {
        width: 100%;
    }

    .navbar-nav .nav-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 0.75rem 0.9rem !important;
        border-radius: 10px;
        text-align: center;
    }

    .navbar-nav .nav-item.ms-2 {
        margin-left: 0 !important;
    }

    .active-nav::after {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    main {
        overflow-x: hidden;
    }

    .container,
    .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .row {
        --bs-gutter-x: 1rem;
    }

    .display-1,
    .display-2,
    .display-3 {
        font-size: 2.25rem !important;
        line-height: 1.12 !important;
    }

    h1,
    .h1 {
        font-size: 2rem !important;
        line-height: 1.16 !important;
    }

    h2,
    .h2 {
        font-size: 1.55rem !important;
        line-height: 1.22 !important;
    }

    .lead {
        font-size: 1rem !important;
    }

    .ratio,
    iframe,
    video {
        max-height: 70vh;
    }
}

@media (max-width: 767.98px) {
    body {
        font-size: 0.95rem;
    }

    section,
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .gx-5 {
        --bs-gutter-x: 1rem;
    }

    .gy-5 {
        --bs-gutter-y: 1.5rem;
    }

    .btn,
    .form-control,
    .form-select {
        min-height: 42px;
    }

    .btn {
        white-space: normal;
    }

    .input-group {
        min-width: 0;
    }

    .input-group > .form-control {
        min-width: 0;
    }

    .modal-dialog {
        margin: 1rem;
    }

    .modal-content {
        max-height: calc(100vh - 2rem);
    }

    .modal-body {
        overflow-y: auto;
    }

    .table-responsive {
        border-radius: 12px;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 575.98px) {
    .topbar .container-fluid {
        gap: 0.75rem;
    }

    .navbar {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    .navbar-toggler {
        width: 42px;
        height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        background: #f8fafc;
    }

    .display-4 {
        font-size: 1.7rem !important;
    }

    h1,
    .h1 {
        font-size: 1.75rem !important;
    }

    h2,
    .h2 {
        font-size: 1.35rem !important;
    }

    .card,
    .news-card,
    .article-card,
    .interview-card,
    .broadcast-card,
    .magazine-card,
    .announcement-card {
        border-radius: 14px !important;
    }

    .d-flex.flex-wrap.gap-3,
    .d-flex.flex-wrap.gap-4 {
        gap: 0.75rem !important;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* -------------------------------------------------------
   Legacy restore: magazine promo card only
   Keep this card on its previous responsive behavior.
------------------------------------------------------- */
@media (max-width: 987px) {
    .magazine-promo-card.h-100.position-relative.p-4.rounded-5,
    .magazine-promo-card {
        height: auto !important;
        padding: 30px 32px !important;
    }

    .magazine-promo-card .row {
        flex-direction: row !important;
        align-items: center !important;
        text-align: left !important;
    }

    .magazine-promo-card .row [class*="col-"] {
        width: auto !important;
    }

    .magazine-promo-card .row > .col-7 {
        flex: 0 0 46% !important;
        max-width: 46% !important;
    }

    .magazine-promo-card .row > .col-5 {
        flex: 0 0 54% !important;
        max-width: 54% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .magazine-promo-card .d-flex.flex-column {
        align-items: flex-start !important;
    }

    .magazine-promo-card img {
        width: clamp(220px, 28vw, 280px) !important;
        max-height: 340px !important;
        height: auto !important;
        margin-bottom: 0 !important;
        transform: none !important;
        object-fit: contain !important;
        object-position: center center !important;
        aspect-ratio: auto !important;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .magazine-promo-card.h-100.position-relative.p-4.rounded-5,
    .magazine-promo-card {
        padding: 28px 24px !important;
    }

    .magazine-promo-card .row > .col-7 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .magazine-promo-card .row > .col-5 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .magazine-promo-card img {
        width: clamp(180px, 32vw, 230px) !important;
        max-height: 300px !important;
    }
}

@media (max-width: 575.98px) {
    .magazine-promo-card.h-100.position-relative.p-4.rounded-5,
    .magazine-promo-card {
        padding: 25px 15px !important;
        height: auto !important;
        border-radius: 30px !important;
    }

    .magazine-promo-card h2 {
        font-size: 1.6rem !important;
    }

    .magazine-promo-card .row {
        flex-direction: column-reverse !important;
        text-align: center !important;
    }

    .magazine-promo-card .row > .col-7,
    .magazine-promo-card .row > .col-5,
    .magazine-promo-card .row [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    .magazine-promo-card .row > .col-5 {
        justify-content: center !important;
        margin-bottom: 18px !important;
    }

    .magazine-promo-card .d-flex.flex-column {
        align-items: center !important;
    }

    .magazine-promo-card img {
        width: min(100%, 260px) !important;
        max-height: none !important;
        height: auto !important;
        margin-bottom: 0 !important;
        object-fit: contain !important;
        object-position: center center !important;
        aspect-ratio: auto !important;
    }
}

@media (max-width: 320px) {
    .magazine-promo-card h2 {
        font-size: 1.3rem !important;
    }

    .magazine-promo-card .row {
        flex-direction: column-reverse !important;
    }

    .magazine-promo-card .col-6 {
        width: 100% !important;
        text-align: center !important;
    }

    .magazine-promo-card img {
        width: min(100%, 220px) !important;
        max-height: none !important;
        height: auto !important;
        margin-bottom: 15px !important;
        object-fit: contain !important;
        aspect-ratio: auto !important;
    }
}
