/**
 * Responsive Design System
 * Mobile-first approach with 6 breakpoints
 */

/* ========== Breakpoint Variables ========== */
:root {
    /* Breakpoints */
    --breakpoint-xs: 360px;   /* Small mobile */
    --breakpoint-sm: 480px;   /* Mobile */
    --breakpoint-md: 768px;   /* Tablet */
    --breakpoint-lg: 1024px;  /* Laptop */
    --breakpoint-xl: 1280px;  /* Desktop */
    --breakpoint-2xl: 1536px; /* Large Desktop */
    
    /* Container Widths */
    --container-sm: 100%;
    --container-md: 720px;
    --container-lg: 960px;
    --container-xl: 1140px;
    --container-2xl: 1320px;
}

/* ========== Base Container ========== */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ========== Responsive Typography ========== */
/* Base font size is set in style.css */

/* ========== Grid System ========== */
.grid {
    display: grid;
    gap: 1.5rem;
}

/* ========== Media Queries ========== */

/* X-Small devices (portrait phones, 360px and up) */
@media (min-width: 360px) {
    :root {
        --base-font-size: 0.9rem;
    }
}

/* Small devices (landscape phones, 480px and up) */
@media (min-width: 480px) {
    :root {
        --base-font-size: 0.9375rem; /* 15px */
    }
    
    .container {
        max-width: var(--container-sm);
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    :root {
        --base-font-size: 1rem; /* 16px */
    }
    
    .container {
        max-width: var(--container-md);
        padding: 0 1.5rem;
    }
    
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large devices (laptops, 1024px and up) */
@media (min-width: 1024px) {
    .container {
        max-width: var(--container-lg);
    }
    
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* X-Large devices (desktops, 1280px and up) */
@media (min-width: 1280px) {
    .container {
        max-width: var(--container-xl);
    }
    
    .grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* XX-Large devices (large desktops, 1536px and up) */
@media (min-width: 1536px) {
    .container {
        max-width: var(--container-2xl);
    }
    
    .grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ========== Print Styles ========== */
@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a,
    a:visited {
        text-decoration: underline;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
    }
    
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.3;
        color: #000;
        background: #fff;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
    }
    
    p, h2, h3 {
        orphans: 3;
        widows: 3;
    }
    
    img {
        page-break-inside: avoid;
        max-width: 100% !important;
    }
    
    @page {
        margin: 2cm;
    }
}

/* ========== Related Posts Carousel ========== */
.related-posts {
    margin: 4rem 0;
    padding: 2rem 0;
    position: relative;
}

.related-posts .section-title {
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 2rem;
    color: #2c3e50;
    position: relative;
    padding-bottom: 1rem;
}

.related-posts .section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: #3498db;
}

.related-posts-carousel {
    margin: 0 -15px;
    position: relative;
}

.related-slide {
    padding: 0 15px;
    outline: none;
}

.related-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.related-image {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
}

.related-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.related-card:hover .related-image img {
    transform: scale(1.05);
}

.related-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.related-content h3 {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    line-height: 1.4;
}

.related-content h3 a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.related-content h3 a:hover {
    color: #3498db;
}

.related-date {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-top: auto;
}

/* Slick Carousel Navigation */
.slick-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #2c3e50;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.slick-arrow:hover {
    background: #3498db;
    color: #fff;
}

.slick-prev {
    left: -20px;
}

.slick-next {
    right: -20px;
}

.slick-dots {
    display: flex !important;
    justify-content: center;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
}

.slick-dots li {
    margin: 0 5px;
}

.slick-dots button {
    width: 10px;
    height: 10px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #bdc3c7;
    text-indent: -9999px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slick-dots button:hover,
.slick-dots button:focus {
    background: #7f8c8d;
    outline: none;
}

.slick-dots .slick-active button {
    background: #3498db;
    transform: scale(1.2);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .related-posts {
        margin: 3rem 0;
    }
    
    .slick-prev {
        left: 0;
    }
    
    .slick-next {
        right: 0;
    }
}

@media (max-width: 768px) {
    .related-posts .section-title {
        font-size: 1.75rem;
    }
    
    .related-content {
        padding: 1.25rem;
    }
    
    .related-content h3 {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .related-posts .section-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .related-posts-carousel {
        margin: 0 -10px;
    }
    
    .related-slide {
        padding: 0 10px;
    }
    
    .slick-arrow {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

/* Enhanced Carousel Navigation */
.related-posts {
    position: relative;
}

.related-posts-carousel {
    position: relative;
    padding: 0 40px; /* Add padding for arrows */
}

.slick-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #fff !important;
    color: #2c3e50;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.9;
}

.slick-arrow:hover {
    background: #3498db !important;
    color: #fff;
    transform: translateY(-50%) scale(1.1);
    opacity: 1;
}

.slick-arrow:focus {
    outline: none;
}

.slick-prev {
    left: 0;
}

.slick-next {
    right: 0;
}

/* Hide arrows when disabled */
.slick-disabled {
    opacity: 0.3 !important;
    cursor: not-allowed;
    transform: translateY(-50%) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .related-posts-carousel {
        padding: 0 35px;
    }
    
    .slick-arrow {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

/* Ensure arrows are always visible on mobile */
@media (max-width: 576px) {
    .slick-arrow {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
}

/* Enhanced Carousel Navigation - High Contrast */
.slick-arrow {
    background: #3498db !important;
    color: #fff !important;
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

.slick-arrow:hover {
    background: #2980b9 !important;
    color: #fff !important;
    transform: translateY(-50%) scale(1.1);
    opacity: 1 !important;
}

.slick-arrow i {
    color: #fff !important;
}

/* Ensure arrows are visible on light backgrounds */
.related-posts-carousel {
    position: relative;
    padding: 0 50px;
}

.slick-prev {
    left: 0;
}

.slick-next {
    right: 0;
}

/* Improve visibility on mobile */
@media (max-width: 768px) {
    .slick-arrow {
        width: 36px !important;
        height: 36px !important;
        background: #3498db !important;
    }
    
    .slick-prev {
        left: 5px !important;
    }
    
    .slick-next {
        right: 5px !important;
    }
}
