/**
 * Aroma Theme - Responsive Styles
 *
 * @package Aroma
 */

/*--------------------------------------------------------------
>>> BREAKPOINTS:
----------------------------------------------------------------
# Extra Large: 1280px and up
# Large: 1024px - 1279px
# Medium: 768px - 1023px
# Small: 480px - 767px
# Extra Small: Below 480px
--------------------------------------------------------------*/

/*--------------------------------------------------------------
# Extra Large Screens (1280px and up)
--------------------------------------------------------------*/
@media screen and (min-width: 1280px) {
    .aroma-container {
        padding-left: var(--aroma-spacing-xl);
        padding-right: var(--aroma-spacing-xl);
    }
}

/*--------------------------------------------------------------
# Large Screens (1024px - 1279px)
--------------------------------------------------------------*/
@media screen and (min-width: 1024px) and (max-width: 1279px) {
    .aroma-layout-sidebar-right,
    .aroma-layout-sidebar-left {
        grid-template-columns: 1fr 280px;
    }
    
    .aroma-menu {
        gap: var(--aroma-spacing-md);
    }
}

/*--------------------------------------------------------------
# Medium Screens (768px - 1023px)
--------------------------------------------------------------*/
@media screen and (max-width: 1023px) {
    /* Layout */
    .aroma-layout-sidebar-right,
    .aroma-layout-sidebar-left {
        grid-template-columns: 1fr;
    }
    
    .aroma-layout-sidebar-left .aroma-sidebar {
        order: 0;
    }
    
    /* Grid */
    .aroma-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .aroma-grid-6 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Header */
    .aroma-header-inner {
        gap: var(--aroma-spacing-md);
    }
    
    /* Footer */
    .aroma-footer-bottom-inner {
        flex-direction: column;
        text-align: center;
    }
    
    .aroma-footer-menu {
        justify-content: center;
    }
    
    /* Single Post */
    .aroma-single-title {
        font-size: var(--aroma-text-3xl);
    }
    
    .aroma-author-bio {
        flex-direction: column;
        text-align: center;
    }
    
    .aroma-nav-links {
        grid-template-columns: 1fr;
        gap: var(--aroma-spacing-lg);
    }
    
    .aroma-nav-next {
        text-align: left;
    }
    
    /* Contact */
    .aroma-contact-layout {
        grid-template-columns: 1fr;
    }
    
    /* 404 */
    .aroma-404-number {
        font-size: 8rem;
    }
}

/*--------------------------------------------------------------
# Small Screens (480px - 767px)
--------------------------------------------------------------*/
@media screen and (max-width: 767px) {
    /* Typography */
    :root {
        --aroma-text-4xl: 1.875rem;
        --aroma-text-5xl: 2.25rem;
        --aroma-text-6xl: 2.5rem;
    }
    
    /* Spacing */
    .aroma-section {
        padding-top: var(--aroma-spacing-2xl);
        padding-bottom: var(--aroma-spacing-2xl);
    }
    
    .aroma-section-lg {
        padding-top: var(--aroma-spacing-3xl);
        padding-bottom: var(--aroma-spacing-3xl);
    }
    
    /* Container */
    .aroma-container {
        padding-left: var(--aroma-spacing-md);
        padding-right: var(--aroma-spacing-md);
    }
    
    /* Grid */
    .aroma-grid-2,
    .aroma-grid-3,
    .aroma-grid-4,
    .aroma-grid-6 {
        grid-template-columns: 1fr;
    }
    
    /* Header */
    .aroma-header-branding .custom-logo {
        max-height: 40px;
    }
    
    .aroma-site-title {
        font-size: var(--aroma-text-lg);
    }
    
    /* Topbar */
    .aroma-topbar {
        display: none;
    }
    
    /* Page Header */
    .aroma-page-header {
        padding: var(--aroma-spacing-2xl) 0;
    }
    
    .aroma-page-title {
        font-size: var(--aroma-text-2xl);
    }
    
    /* Section Header */
    .aroma-section-header {
        margin-bottom: var(--aroma-spacing-2xl);
    }
    
    .aroma-section-title {
        font-size: var(--aroma-text-2xl);
    }
    
    /* Posts */
    .aroma-posts-grid {
        gap: var(--aroma-spacing-lg);
    }
    
    .aroma-card-body {
        padding: var(--aroma-spacing-lg);
    }
    
    /* Single Post */
    .aroma-single-header {
        padding: var(--aroma-spacing-2xl) 0;
    }
    
    .aroma-single-title {
        font-size: var(--aroma-text-2xl);
    }
    
    .aroma-single-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .aroma-post-tags,
    .aroma-share-buttons {
        width: 100%;
    }
    
    .aroma-share-buttons {
        justify-content: flex-start;
    }
    
    /* Post Meta */
    .aroma-post-meta {
        flex-direction: column;
        gap: var(--aroma-spacing-sm);
    }
    
    /* Footer */
    .aroma-footer-widgets {
        padding: var(--aroma-spacing-2xl) 0;
    }
    
    .aroma-footer-widgets .aroma-grid {
        gap: var(--aroma-spacing-2xl);
    }
    
    /* Breadcrumbs */
    .aroma-breadcrumb-list {
        font-size: var(--aroma-text-xs);
    }
    
    /* Buttons */
    .aroma-btn {
        padding: var(--aroma-spacing-sm) var(--aroma-spacing-lg);
    }
    
    .aroma-btn-lg {
        padding: var(--aroma-spacing-md) var(--aroma-spacing-xl);
    }
    
    /* 404 */
    .aroma-404-number {
        font-size: 6rem;
    }
    
    .aroma-404-actions {
        flex-direction: column;
    }
    
    .aroma-404-actions .aroma-btn {
        width: 100%;
    }
    
    /* Contact */
    .aroma-contact-item {
        flex-direction: column;
        text-align: center;
    }
    
    .aroma-contact-icon {
        margin: 0 auto;
    }
    
    .aroma-form-row.aroma-grid-2 {
        grid-template-columns: 1fr;
    }
    
    /* Search */
    .aroma-search-field {
        font-size: var(--aroma-text-base);
        padding: var(--aroma-spacing-md) var(--aroma-spacing-lg);
        padding-right: 50px;
    }
    
    .aroma-search-submit {
        width: 36px;
        height: 36px;
    }
    
    /* Mobile Menu */
    .aroma-mobile-menu {
        width: 100%;
        max-width: 100%;
    }
    
    /* Back to Top */
    .aroma-back-to-top {
        width: 40px;
        height: 40px;
        bottom: var(--aroma-spacing-md);
        right: var(--aroma-spacing-md);
    }
    
    /* Pagination */
    .aroma-pagination .page-numbers a,
    .aroma-pagination .page-numbers span {
        min-width: 36px;
        height: 36px;
        font-size: var(--aroma-text-sm);
    }
    
    /* Comments */
    .aroma-comment-body {
        padding: var(--aroma-spacing-md);
    }
    
    .comment-author {
        flex-direction: column;
        text-align: center;
    }
    
    .children {
        padding-left: var(--aroma-spacing-sm);
    }
}

/*--------------------------------------------------------------
# Extra Small Screens (Below 480px)
--------------------------------------------------------------*/
@media screen and (max-width: 479px) {
    /* Typography */
    :root {
        --aroma-text-3xl: 1.5rem;
        --aroma-text-4xl: 1.75rem;
        --aroma-text-5xl: 2rem;
    }
    
    /* Header */
    .aroma-header-actions {
        gap: var(--aroma-spacing-xs);
    }
    
    .aroma-search-toggle {
        width: 36px;
        height: 36px;
    }
    
    /* Cards */
    .aroma-card-body {
        padding: var(--aroma-spacing-md);
    }
    
    .aroma-card-title {
        font-size: var(--aroma-text-lg);
    }
    
    /* Post Card */
    .aroma-post-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--aroma-spacing-md);
    }
    
    /* 404 */
    .aroma-404-number {
        font-size: 4rem;
    }
    
    .aroma-404-illustration svg {
        width: 100px;
        height: 100px;
    }
    
    /* Search Overlay */
    .aroma-search-close {
        top: var(--aroma-spacing-md);
        right: var(--aroma-spacing-md);
    }
    
    .aroma-search-title {
        font-size: var(--aroma-text-xl);
    }
}

/*--------------------------------------------------------------
# Print Styles
--------------------------------------------------------------*/
@media print {
    /* Hide non-essential elements */
    .aroma-site-header,
    .aroma-site-footer,
    .aroma-sidebar,
    .aroma-mobile-menu,
    .aroma-mobile-overlay,
    .aroma-search-overlay,
    .aroma-back-to-top,
    .aroma-share-buttons,
    .aroma-post-navigation,
    .aroma-related-posts,
    .aroma-comments-area,
    .aroma-pagination,
    .skip-link {
        display: none !important;
    }
    
    /* Reset colors */
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12pt;
        line-height: 1.5;
    }
    
    /* Links */
    a {
        color: #000 !important;
        text-decoration: underline;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
    }
    
    a[href^="#"]::after,
    a[href^="javascript:"]::after {
        content: "";
    }
    
    /* Images */
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    /* Headings */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
        color: #000 !important;
    }
    
    /* Paragraphs */
    p {
        orphans: 3;
        widows: 3;
    }
    
    /* Tables */
    table {
        border-collapse: collapse !important;
    }
    
    table td,
    table th {
        background-color: #fff !important;
        border: 1px solid #ddd !important;
    }
    
    /* Layout */
    .aroma-container {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    .entry-content {
        max-width: 100% !important;
    }
    
    /* Page breaks */
    .aroma-page-header {
        page-break-after: avoid;
    }
    
    article {
        page-break-inside: avoid;
    }
}

/*--------------------------------------------------------------
# Reduced Motion
--------------------------------------------------------------*/
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/*--------------------------------------------------------------
# High Contrast Mode
--------------------------------------------------------------*/
@media (prefers-contrast: high) {
    :root {
        --aroma-primary: #0000ff;
        --aroma-secondary: #000000;
        --aroma-gray-100: #ffffff;
        --aroma-gray-200: #e0e0e0;
        --aroma-gray-500: #666666;
        --aroma-gray-700: #333333;
    }
    
    .aroma-btn {
        border-width: 3px;
    }
    
    a:focus,
    button:focus,
    input:focus,
    textarea:focus,
    select:focus {
        outline: 3px solid currentColor;
        outline-offset: 2px;
    }
}

/*--------------------------------------------------------------
# Dark Mode Support (System Preference)
--------------------------------------------------------------*/
@media (prefers-color-scheme: dark) {
    /* Only apply if theme doesn't have its own dark mode toggle */
    .aroma-auto-dark-mode {
        --aroma-white: #0f172a;
        --aroma-black: #ffffff;
        --aroma-gray-50: #1e293b;
        --aroma-gray-100: #334155;
        --aroma-gray-200: #475569;
        --aroma-gray-300: #64748b;
        --aroma-gray-400: #94a3b8;
        --aroma-gray-500: #cbd5e1;
        --aroma-gray-600: #e2e8f0;
        --aroma-gray-700: #f1f5f9;
        --aroma-gray-800: #f8fafc;
        --aroma-gray-900: #ffffff;
        --aroma-secondary: #f8fafc;
    }
}

/*--------------------------------------------------------------
# RTL Support
--------------------------------------------------------------*/
[dir="rtl"] .aroma-header-inner {
    flex-direction: row-reverse;
}

[dir="rtl"] .aroma-menu {
    flex-direction: row-reverse;
}

[dir="rtl"] .aroma-dropdown {
    left: auto;
    right: 0;
}

[dir="rtl"] .aroma-dropdown-nested {
    left: auto;
    right: 100%;
}

[dir="rtl"] .aroma-mobile-menu {
    right: auto;
    left: -100%;
}

[dir="rtl"] .aroma-mobile-menu.is-active {
    left: 0;
}

[dir="rtl"] .aroma-mobile-submenu {
    padding-left: 0;
    padding-right: var(--aroma-spacing-lg);
}

[dir="rtl"] .aroma-breadcrumb-list {
    flex-direction: row-reverse;
}

[dir="rtl"] .aroma-read-more svg {
    transform: rotate(180deg);
}

[dir="rtl"] .aroma-read-more:hover svg {
    transform: rotate(180deg) translateX(4px);
}

[dir="rtl"] .aroma-nav-next {
    text-align: left;
}

[dir="rtl"] .aroma-nav-previous {
    text-align: right;
}

[dir="rtl"] .aroma-back-to-top {
    right: auto;
    left: var(--aroma-spacing-xl);
}

[dir="rtl"] .aroma-layout-sidebar-left .aroma-sidebar {
    order: 1;
}

[dir="rtl"] .aroma-post-tags,
[dir="rtl"] .aroma-share-buttons {
    flex-direction: row-reverse;
}

[dir="rtl"] .aroma-footer-bottom-inner {
    flex-direction: row-reverse;
}

[dir="rtl"] .aroma-topbar-inner {
    flex-direction: row-reverse;
}

[dir="rtl"] .aroma-topbar-info {
    flex-direction: row-reverse;
}
