﻿/**
 * Modern Buddha - Responsive Styles
 * Mobile-first responsive design for all devices
 * 
 * @package Modern Buddha
 * @version 1.0.0
 */

/* ===================================
   BREAKPOINTS
   - Mobile: < 576px
   - Tablet: 576px - 991px
   - Desktop: 992px+
   =================================== */

/* ===================================
   TABLET & BELOW (max-width: 991px)
   =================================== */
@media screen and (max-width: 991px) {
    
    /* Typography adjustments */
    :root {
        --font-size-6xl: 2.5rem;
        --font-size-5xl: 2rem;
        --font-size-4xl: 1.875rem;
        --font-size-3xl: 1.5rem;
    }
    
    /* Container padding */
    .container,
    .container-fluid {
        padding: 0 var(--spacing-md);
    }
    
    /* Section spacing */
    .section {
        padding: var(--spacing-2xl) 0;
    }
    
    .section-lg {
        padding: var(--spacing-3xl) 0;
    }
    
    /* Grid adjustments */
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Hero section */
    .hero {
        min-height: 70vh;
        padding: var(--spacing-2xl) var(--spacing-md);
    }
    
    .hero h1 {
        font-size: var(--font-size-5xl);
    }
    
    .hero p {
        font-size: var(--font-size-large);
    }
    
    /* Cards */
    .feature-card {
        padding: var(--spacing-lg);
    }
    
    /* Newsletter form */
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
    }
}

/* ===================================
   MOBILE (max-width: 767px)
   =================================== */
@media screen and (max-width: 767px) {
    
    /* Typography */
    h1 {
        font-size: var(--font-size-4xl);
    }
    
    h2 {
        font-size: var(--font-size-3xl);
    }
    
    h3 {
        font-size: var(--font-size-2xl);
    }
    
    /* Container */
    .container,
    .container-fluid {
        padding: 0 var(--spacing-sm);
    }
    
    /* All grids become single column */
    .grid,
    .grid-2,
    .grid-3,
    .grid-4,
    .grid-auto {
        grid-template-columns: 1fr;
    }
    
    /* Hero */
    .hero {
        min-height: 60vh;
        padding: var(--spacing-xl) var(--spacing-sm);
    }
    
    .hero h1 {
        font-size: var(--font-size-4xl);
        letter-spacing: 1px;
    }
    
    .hero p {
        font-size: var(--font-size-base);
    }
    
    .hero::before,
    .hero::after {
        display: none;
    }
    
    /* Buttons */
    .btn-large {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: var(--font-size-base);
    }
    
    /* Cards */
    .card-body {
        padding: var(--spacing-md);
    }
    
    .feature-card {
        padding: var(--spacing-md);
    }
    
    .feature-icon {
        font-size: var(--font-size-4xl);
    }
    
    /* Section titles */
    .section-title {
        font-size: var(--font-size-3xl);
    }
    
    /* Forms */
    .form-inline {
        flex-direction: column;
    }
    
    /* Pagination */
    .pagination {
        gap: 0.25rem;
    }
    
    .pagination a,
    .pagination span {
        min-width: 35px;
        height: 35px;
        font-size: var(--font-size-small);
    }
    
    /* Stats */
    .stats {
        grid-template-columns: 1fr;
    }
    
    .stat-number {
        font-size: var(--font-size-4xl);
    }
    
    /* Blockquote */
    blockquote {
        padding: var(--spacing-md);
    }
    
    blockquote p {
        font-size: var(--font-size-base);
    }
    
    /* Back to top button */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* ===================================
   MOBILE NAVIGATION
   =================================== */
@media screen and (max-width: 991px) {
    
    /* Header */
    .site-header {
        padding: var(--spacing-sm) 0;
    }
    
    .site-header .container {
        padding: 0 var(--spacing-md);
    }
    
    /* Navigation */
    .primary-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--color-white);
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
        padding: var(--spacing-2xl) var(--spacing-lg);
        transition: right var(--transition-normal);
        z-index: var(--z-dropdown);
        overflow-y: auto;
    }
    
    .primary-menu.active {
        right: 0;
    }
    
    .primary-menu ul {
        flex-direction: column;
        gap: 0;
    }
    
    .primary-menu li {
        width: 100%;
        border-bottom: 1px solid var(--color-border);
    }
    
    .primary-menu a {
        display: block;
        padding: var(--spacing-md) 0;
        font-size: var(--font-size-large);
    }
    
    /* Mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        padding: var(--spacing-xs);
        background: none;
        border: none;
        z-index: calc(var(--z-dropdown) + 1);
    }
    
    .mobile-menu-toggle span {
        width: 25px;
        height: 3px;
        background-color: var(--color-dark);
        transition: all var(--transition-normal);
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* Social icons in mobile */
    .social-icons {
        gap: var(--spacing-sm);
    }
    
    .social-icon {
        width: 35px;
        height: 35px;
        font-size: var(--font-size-base);
    }
}

/* ===================================
   TABLET SPECIFIC (576px - 991px)
   =================================== */
@media screen and (min-width: 576px) and (max-width: 991px) {
    
    /* 2-column grid for tablets */
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===================================
   LARGE DESKTOP (min-width: 1400px)
   =================================== */
@media screen and (min-width: 1400px) {
    
    :root {
        --container-max-width: 1320px;
    }
    
    .hero h1 {
        font-size: 4rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
}

/* ===================================
   PRINT SPECIFIC
   =================================== */
@media print {
    
    .site-header,
    .site-footer,
    .back-to-top,
    .mobile-menu-toggle,
    .social-share,
    .newsletter-form {
        display: none !important;
    }
    
    .container {
        max-width: 100%;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
}

/* ===================================
   LANDSCAPE MOBILE (max-height: 500px)
   =================================== */
@media screen and (max-height: 500px) and (orientation: landscape) {
    
    .hero {
        min-height: 100vh;
    }
    
    .hero h1 {
        font-size: var(--font-size-3xl);
    }
}

/* ===================================
   ACCESSIBILITY - REDUCED MOTION
   =================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===================================
   DARK MODE SUPPORT (Optional)
   =================================== */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode support
    
    :root {
        --color-background: #1a1a1a;
        --color-text: #e0e0e0;
        --color-dark: #f5f5f5;
    }
    
    .card,
    .feature-card {
        background: #2c2c2c;
    }
    
    */
}
/* ===================================
   SINGLE BOOK PAGE — RESPONSIVE
   =================================== */

/* Tablet: 768px – 991px */
@media screen and (max-width: 991px) {
    .bk-layout {
        grid-template-columns: 210px 1fr;
        gap: 2.25rem;
    }
    .bk-cover-col { position: static; }
    .bk-title { font-size: 2rem; }
    .bk-related-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Large mobile: 576px – 767px */
@media screen and (max-width: 767px) {
    .bk-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .bk-cover-col {
        display: grid;
        grid-template-columns: 160px 1fr;
        gap: 1.25rem;
        align-items: start;
    }
    .bk-cover-wrap { grid-row: 1 / 4; }
    .bk-hero { padding: 2rem 0 3rem; }
    .bk-title { font-size: 1.75rem; }
    .bk-related-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .bk-cta-inline { display: flex; }   /* show inline CTAs on mobile */
    .bk-cta-col { display: none; }      /* hide sidebar CTAs on mobile */
}

/* Small mobile: < 576px */
@media screen and (max-width: 575px) {
    .bk-cover-col {
        grid-template-columns: 130px 1fr;
    }
    .bk-title { font-size: 1.5rem; }
    .bk-meta-strip { gap: 0.4rem; }
    .bk-meta-pill { font-size: 0.72rem; padding: 0.25rem 0.55rem; }
    .bk-related-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .bk-meta-list { display: none; }
}

/* ===================================
   BOOKS ARCHIVE FILTER — RESPONSIVE
   =================================== */

/* Mobile: collapse to horizontal scrollable row */
@media screen and (max-width: 575px) {
    .books-filter-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 0.25rem 0.5rem 0.75rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .books-filter-tabs::-webkit-scrollbar {
        display: none;
    }
    .books-filter-tabs .resource-filter-tab {
        flex-shrink: 0;
        white-space: nowrap;
    }
}

/* ===================================
   PRINT STYLESHEET — Meditation Guide
   =================================== */
@media print {
    .site-header,
    .site-footer,
    .back-to-top,
    .whatsapp-float,
    .share-strip,
    .post-share,
    .related-posts,
    .events-cta-section,
    .cta-box-centered,
    nav,
    button,
    .btn,
    .resource-filter-tabs,
    .no-print { display: none !important; }

    body, .container, .container-narrow {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 12pt;
        color: #000;
        background: white;
    }

    h1, h2, h3, h4 {
        color: #000;
        page-break-after: avoid;
    }

    .meditation-step,
    .technique-card,
    .practice-step { page-break-inside: avoid; }

    a[href]:after { content: " (" attr(href) ")"; font-size: 10pt; color: #666; }
    a[href^="#"]:after,
    a[href^="javascript:"]:after { content: ""; }

    img { max-width: 100% !important; }
}

/* ===================================
   WHATSAPP FLOAT — hide on tiny screens
   =================================== */
@media (max-width: 400px) {
    .whatsapp-float__label { display: none; }
    .whatsapp-float { padding: 12px; border-radius: 50%; }
}

/* ===================================
   BOOK ARCHIVE — RESPONSIVE
   =================================== */

/* Advanced filter panel: 2 cols on medium screens */
@media (max-width: 960px) {
    .books-adv-panel {
        grid-template-columns: 1fr 1fr;
    }
    .books-adv-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: flex-end;
        border-top: 1px solid var(--color-border);
        padding-top: 0.6rem;
        margin-top: 0.1rem;
    }
}

/* 3-col at 1000px (sidebar still present) */
@media (max-width: 1000px) {
    .books-card-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Sidebar + grid: narrow layout at 860px */
@media (max-width: 860px) {
    .books-archive-layout {
        grid-template-columns: 175px 1fr;
        gap: 1rem;
    }
    .books-card-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Stack sidebar above grid on mobile */
@media (max-width: 650px) {
    .books-archive-layout {
        grid-template-columns: 1fr;
    }
    .books-sidebar {
        position: static;
    }
    /* Categories become a horizontal pill strip */
    .books-sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.3rem;
        padding: 0.6rem 0.8rem;
        max-height: none;
        overflow: visible;
    }
    .books-sidebar-item {
        display: inline-flex;
        border-left: none;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-full);
        padding: 0.28rem 0.7rem;
        font-size: 0.75rem;
        gap: 0.3rem;
    }
    .books-sidebar-item.active {
        border-color: var(--color-primary);
        background: var(--color-primary);
        color: white;
    }
    .books-sidebar-item.active .books-sidebar-item-count {
        background: rgba(255,255,255,0.25);
        color: white;
    }
    .books-sidebar-heading { padding-bottom: 0.2rem; }
    /* Advanced filter: 1 col */
    .books-adv-panel {
        grid-template-columns: 1fr;
    }
    .books-adv-actions {
        grid-column: 1;
    }
    /* Search row */
    .books-main-search-row {
        flex-wrap: wrap;
    }
    .books-main-search-wrap { flex-basis: 100%; }
    .books-main-search-btn { flex: 1; }
    .books-clear-btn { flex: 1; text-align: center; }
}

/* Masters + Quotes archive: narrow sidebar at 860px */
@media (max-width: 860px) {
    .masters-archive-layout,
    .quotes-archive-layout {
        grid-template-columns: 175px 1fr;
        gap: 1rem;
    }
}

/* Masters + Quotes archive: stack sidebar above content on mobile */
@media (max-width: 650px) {
    .masters-archive-layout,
    .quotes-archive-layout {
        grid-template-columns: 1fr;
    }
    .masters-sidebar,
    .quotes-sidebar {
        position: static;
    }
    /* Sidebar items become horizontal scrolling pill strip */
    .masters-sidebar-nav,
    .quotes-sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.3rem;
        padding: 0.6rem;
        max-height: none;
        overflow: visible;
    }
    .masters-sidebar-heading,
    .quotes-sidebar-heading {
        width: 100%;
        border-bottom: none;
        padding-bottom: 0.1rem;
    }
    .masters-sidebar-item,
    .quotes-sidebar-item {
        display: inline-flex;
        width: auto;
        border: 1px solid var(--color-border);
        border-bottom: 1px solid var(--color-border);
        border-radius: var(--radius-full);
        padding: 0.3rem 0.7rem;
        font-size: 0.75rem;
        gap: 0.3rem;
    }
    .masters-sidebar-item.active,
    .quotes-sidebar-item.active {
        border-color: var(--color-primary);
        background: var(--color-primary);
        color: white;
    }
    .masters-sidebar-item.active .masters-sidebar-item-count,
    .quotes-sidebar-item.active .quotes-sidebar-item-count {
        background: rgba(255,255,255,0.25);
        color: white;
    }
    /* Restore full-width grid on mobile */
    .masters-main-content .spiritual-masters-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    .quotes-main-content .quotes-grid {
        grid-template-columns: 1fr;
    }
}

/* 2-col card grid on small phones */
@media (max-width: 480px) {
    .books-card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .book-card-body { padding: 0.65rem 0.75rem 0.75rem; gap: 0.25rem; }
    .book-card-title { font-size: 0.82rem; }
    .book-card-btn  { font-size: 0.72rem; padding: 0.38rem 0.4rem; }
    .books-pagination { gap: 0.2rem; }
    .books-pagination .page-numbers { min-width: 1.75rem; height: 1.75rem; font-size: 0.78rem; }
}

/* 1-col cards on very small phones */
@media (max-width: 340px) {
    .books-card-grid { grid-template-columns: 1fr; }
}

/* Scroll row breakpoints — spiritual master book sections */
@media (max-width: 991px) {
    .books-scroll-row .recommended-card {
        flex: 0 0 calc((100% - 3rem) / 4); /* 4 visible */
    }
}

@media (max-width: 768px) {
    .books-scroll-row .recommended-card {
        flex: 0 0 calc((100% - 2rem) / 3); /* 3 visible */
    }
}

@media (max-width: 480px) {
    .books-scroll-row .recommended-card {
        flex: 0 0 calc((100% - 1rem) / 2.2); /* ~2 visible */
    }
}

/* ===================================
   AUTH / QUIZ RESPONSIVE
   =================================== */
@media (max-width: 991px) {
    .header-auth-label {
        display: none;
    }
    .header-auth-link {
        padding: 0.35rem 0.55rem;
        border: none;
    }
    .header-auth-icon {
        font-size: 1.1rem;
    }
}

@media (max-width: 640px) {
    .quiz-options--grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .auth-card {
        padding: 1.8rem 1.4rem;
    }
    .quiz-page {
        padding: 2rem 0.8rem 3.5rem;
    }
    .quiz-header__title {
        font-size: 1.6rem;
    }
    .quiz-step__question {
        font-size: 1.25rem;
    }
    .profile-grid {
        grid-template-columns: 1fr;
    }
    .account-header .container {
        gap: 0.9rem;
    }
    .account-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    .account-header__name {
        font-size: 1.4rem;
    }
    .quiz-cta-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
}

/* ===================================
   PERSONALISED CORNER — RESPONSIVE
   =================================== */

/* Account tabs: scroll horizontally on tablet */
@media (max-width: 768px) {
    .account-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        scrollbar-width: none;
        padding-bottom: 2px;
    }
    .account-tabs::-webkit-scrollbar { display: none; }
    .account-tab { display: inline-flex; }

    /* Shelf mini grid: 3 cols on tablet */
    .shelf-mini-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Journal: stack editor above sidebar */
    .journal-layout {
        grid-template-columns: 1fr;
    }
    .journal-entries-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--color-border, #e2ddd7);
        padding-left: 0;
        padding-top: 1.2rem;
        margin-top: 1.2rem;
        max-height: 340px;
        overflow-y: auto;
    }

    /* My Corner: single column grid */
    .my-corner-page .corner-section-grid,
    .my-corner-page .mc-grid-2col {
        grid-template-columns: 1fr;
    }

    /* My Corner: rec strip 2-col on tablet */
    .mc-rec-strip {
        grid-template-columns: repeat(2, 1fr);
    }

    /* My Corner: events strip stack */
    .mc-events-strip {
        flex-direction: column;
        align-items: stretch;
    }
    .mc-event-card {
        max-width: 100%;
    }

    /* Welcome banner: stack on tablet */
    .mc-welcome-banner__inner {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    .mc-welcome-picks-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* For You: book scroll row shrinks cards */
    .books-scroll-row .recommended-card {
        flex: 0 0 120px;
    }

    /* Practice heatmap: smaller cells */
    .heatmap-day {
        width: 9px;
        height: 9px;
    }

    /* Learning path steps list */
    .path-steps-list { gap: 0.6rem; }
}

@media (max-width: 576px) {
    /* Shelf mini grid: 2 cols on mobile */
    .shelf-mini-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Practice streak row: wrap */
    .practice-streak-row {
        gap: 1rem;
        flex-wrap: wrap;
    }
    .practice-streak-item {
        min-width: 70px;
    }

    /* Practice minute buttons: tighter */
    .practice-minutes-row {
        gap: 0.4rem;
    }
    .practice-min-btn {
        padding: 0.35rem 0.65rem;
        font-size: 0.8rem;
    }

    /* Heatmap: even smaller, allow wrapping */
    .practice-heatmap {
        gap: 2px;
    }
    .heatmap-day {
        width: 8px;
        height: 8px;
        border-radius: 1px;
    }

    /* For You daily anchor: stack */
    .daily-anchor {
        grid-template-columns: 1fr;
    }

    /* Journal textarea on mobile */
    .journal-textarea {
        font-size: 0.92rem;
    }

    /* My Corner widgets: uniform */
    .corner-widget {
        padding: 1rem;
    }
    .corner-welcome__name {
        font-size: 1.3rem;
    }

    /* My Corner: rec strip on mobile */
    .mc-rec-strip {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Welcome banner: compact on mobile */
    .mc-welcome-banner {
        padding: 1.3rem 1.2rem;
    }
    .mc-welcome-banner__name {
        font-size: 1.3rem;
    }
    .mc-welcome-picks-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* My Corner: shelf counts wrap */
    .mc-shelf-counts {
        gap: 0.8rem;
    }

    /* My Corner: saved rows truncate less aggressively */
    .mc-saved-row__title {
        font-size: 0.85rem;
    }

    /* Settings gear icon smaller tap target compensated */
    .corner-settings-link {
        width: 40px;
        height: 40px;
    }
}

/* ── Phase 5: Browse Clusters — Tablet (≤ 1024px) ── */
@media ( max-width: 1024px ) {
    .res-clusters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .res-fy-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Phase 5: Browse Clusters — Mobile (≤ 600px) ── */
@media ( max-width: 600px ) {
    .res-clusters-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }
    .res-cluster-card {
        padding: 0.9rem;
    }
    .res-fy-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.65rem;
    }
    .res-start-here-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .res-for-you-header {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* ── Cluster Page template — responsive ── */
@media ( max-width: 1024px ) {
    .cluster-resource-grid { grid-template-columns: repeat(3, 1fr); }
}
@media ( max-width: 768px ) {
    .cluster-resource-grid { grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
    .cluster-page-title    { font-size: 1.4rem; }
    .cluster-page-icon     { font-size: 1.8rem; }
}
@media ( max-width: 480px ) {
    .cluster-resource-grid { grid-template-columns: 1fr; }
    .cluster-trad-filter-bar .container { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.3rem; }
}

/* ── Featured Teaching / Weekly Rhythm — home page ── */
@media ( max-width: 768px ) {
    .featured-week-grid { grid-template-columns: 1fr; }
    .featured-week-card .featured-teaching-thumb { height: 180px; }
    .featured-teaching-card { flex-direction: column; gap: 0; }
    .featured-teaching-thumb { width: 100%; height: 200px; }
    .featured-teaching-body { padding: 1.2rem; }
    .featured-teaching-title { font-size: 1rem; }
}
@media ( max-width: 480px ) {
    .featured-week-wa-btn { font-size: 0.82rem; padding: 0.55rem 1rem; }
}

/* ── Tradition overview grid ── */
@media ( max-width: 900px ) {
    .traditions-grid { grid-template-columns: repeat(2, 1fr); }
}
@media ( max-width: 560px ) {
    .traditions-grid { grid-template-columns: 1fr; }
    .trad-overview-icon { font-size: 2.2rem; }
}

/* ── Tradition detail page — responsive ── */
@media ( max-width: 1024px ) {
    .trad-books-grid { grid-template-columns: repeat(3, 1fr); }
    .trad-masters-grid { grid-template-columns: repeat(3, 1fr); }
}
@media ( max-width: 768px ) {
    .trad-detail-hero__icon { font-size: 2.4rem; }
    .trad-quotes-grid { grid-template-columns: 1fr; }
    .trad-books-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .trad-media-grid { grid-template-columns: 1fr; }
    .trad-masters-grid { grid-template-columns: repeat(2, 1fr); }
    .trad-master-card { padding: 1rem 0.7rem 0.8rem; }
    .trad-section-header .section-title { font-size: 1.25rem; }
}
@media ( max-width: 480px ) {
    .trad-books-grid { grid-template-columns: repeat(2, 1fr); }
    .trad-masters-grid { grid-template-columns: repeat(2, 1fr); }
    .trad-article-row__thumb { width: 56px; height: 42px; }
    .trad-start-box { padding: 1.1rem 1.2rem; }
}

/* ── Master Follow button + Following feed — responsive ── */
@media ( max-width: 480px ) {
    .master-action-btns { flex-direction: column; gap: 0.4rem; }
    .mc-following-feed { grid-template-columns: repeat(2, 1fr); }
}

/* ── Search Results Page — Phase E ── */
@media ( max-width: 600px ) {
    .srp-heading { font-size: 1.5rem; }
    .srp-item__thumb { width: 56px; height: 56px; }
    .srp-item { padding: 0.9rem; gap: 0.75rem; }
    .srp-item__date { display: none; }
    .srp-filters { gap: 0.4rem; }
    .srp-filter-btn { padding: 0.35rem 0.7rem; font-size: 0.78rem; }
}

/* ── Journey Timeline — Phase D ── */
@media ( max-width: 600px ) {
    .mc-journey-date { display: none; }
    .mc-milestone-banner { padding: 0.75rem; gap: 0.65rem; }
    .mc-milestone-banner__icon { font-size: 1.3rem; }
}

/* ── Practice Library — Phase G ── */
@media ( max-width: 900px ) {
    .plib-grid { grid-template-columns: repeat(2, 1fr); }
}
@media ( max-width: 560px ) {
    .plib-grid { grid-template-columns: 1fr; }
    .plib-grid--2col { grid-template-columns: 1fr; }
    .plib-filter-label { width: auto; }
    .plib-filter-bar { position: relative; }
}

/* ── Sangha / Reading Groups — Phase H ── */
@media ( max-width: 900px ) {
    .sangha-grid { grid-template-columns: repeat(2, 1fr); }
}
@media ( max-width: 600px ) {
    .sangha-grid { grid-template-columns: 1fr; }
    .sangha-single-hero__inner { flex-direction: column; }
    .sangha-single-thumb { width: 100%; height: 160px; }
    .sangha-single-thumb img { height: 160px; }
    .sangha-thread-meta { display: none; }
}

/* ── Journal Canvas — Spiritual Notepad ── */
@media ( max-width: 640px ) {
    .journal-type-bar { padding: 0.5rem 0.75rem; gap: 0.3rem; }
    .journal-type-btn { font-size: 0.73rem; padding: 0.22rem 0.55rem; }
    .journal-tag-area { padding: 0.5rem 0.75rem 0.35rem; }
    .reflect-journal-cta { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
    .reflect-journal-cta__btn { align-self: flex-start; }
}

/* ── My Corner — Tradition widget ── */
@media ( max-width: 640px ) {
    .mc-tradition-widget { flex-wrap: wrap; gap: 0.6rem; }
    .mc-tradition-widget__link { width: 100%; text-align: center; }
}
