/* ====================================================
   RICHIFYNOW — RESPONSIVE + LUXURY + CENTER ALIGNMENT
   Tasks 1-3 consolidated override layer
   ==================================================== */

/* ── TASK 3: Luxury Typography — Playfair Display for headings ── */
h1, h2, h3, h4, h5, h6,
.rn-page-title,
.rn-page-title-sm,
.rn-carousel-title,
.rn-article-title,
.blog-title,
.section-header h2,
.rn-post-title,
.rn-home-hero-card-body h2,
.rn-faq-question,
.section-title {
    font-family: 'Playfair Display', 'Sora', Georgia, serif !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
}

/* Eyebrow/category labels stay sans-serif */
.rn-eyebrow,
.rn-post-category,
.rn-carousel-eyebrow,
.rn-carousel-meta-tag,
.badge {
    font-family: 'DM Sans', 'Inter', system-ui, sans-serif !important;
}

/* Keep body/paragraph text readable with Inter */
body,
p,
span,
a,
li,
label,
input,
textarea,
button,
.rn-panel-text,
.rn-richtext,
.rn-post-excerpt,
.rn-post-meta,
.rn-page-subtitle,
.rn-carousel-excerpt {
    font-family: 'DM Sans', 'Inter', system-ui, sans-serif;
}

/* ── TASK 2: Center Alignment (except hero sections) ── */
.rn-section-heading,
.rn-section-heading.rn-section-heading-left,
div.rn-section-heading,
div.rn-section-heading.rn-section-heading-left {
    text-align: center !important;
}

.rn-page-subtitle,
p.rn-page-subtitle,
.rn-page-subtitle-sm,
p.rn-page-subtitle-sm {
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
}

/* Center all eyebrows site-wide */
.rn-eyebrow,
p.rn-eyebrow {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
}

/* Center all section content text */
.rn-page > .main-container > .rn-section-heading ~ *:not(.rn-post-grid):not(.rn-category-grid):not(.rn-blog-layout):not(.rn-contact-layout):not(.rn-split):not(.rn-home-featured-layout):not(.rn-faq-container):not(.card-grid):not(.rn-author-grid):not(.rn-trending-slider-wrapper) {
    text-align: center;
}

/* Section heading eyebrow centering */
.rn-section-heading .rn-eyebrow {
    display: block !important;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
}

/* Center home section heads */
.rn-home-section-head {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
}

.rn-home-section-head > div {
    text-align: center;
}

/* EXCEPTION: Hero sections keep their alignment */
.rn-hero-carousel .rn-carousel-content,
.rn-categories-page-hero .main-container,
.hero-section .hero-text,
.rn-home-hero .rn-home-hero-copy {
    text-align: left !important;
}

/* Center FAQ container */
.rn-faq-container {
    max-width: 800px;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Center review/testimonial grids */
.rn-reviews-grid {
    text-align: center;
}

.rn-review-card {
    text-align: left;
}

/* ── TASK 1: Full Responsiveness ── */

/* === Global box-sizing fix === */
*, *::before, *::after {
    box-sizing: border-box;
}

/* === Fluid container === */
.main-container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 40px);
}

/* === Buttons: never overflow === */
.btn {
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* === Images: always fluid === */
img {
    max-width: 100%;
    height: auto;
}

/* === Newsletter form responsiveness === */
.rn-newsletter-form {
    width: 100% !important;
    max-width: 100%;
}

.rn-newsletter-form input {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
}

/* === Contact form inputs === */
.rn-contact-form input,
.rn-contact-form textarea {
    width: 100%;
    box-sizing: border-box;
}

/* === Hero section bullet lists: prevent overflow === */
.rn-categories-page-hero ul,
.rn-categories-page-hero li {
    max-width: 100%;
    overflow-wrap: break-word;
}

/* ═══════════════════════════════════
   BREAKPOINT: Large Desktop (1400px+)
   ═══════════════════════════════════ */
@media (min-width: 1400px) {
    .main-container {
        max-width: 1400px;
    }
    .rn-post-grid-home {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .rn-home-hero-card img {
        height: 400px;
    }
}

/* ═══════════════════════════════════
   BREAKPOINT: Laptop (max 1200px)
   ═══════════════════════════════════ */
@media (max-width: 1200px) {
    .rn-home-hero-layout {
        gap: 24px;
    }
    .rn-home-featured-layout {
        gap: 20px;
    }
    .rn-split {
        gap: 40px !important;
    }
}

/* ═══════════════════════════════════
   BREAKPOINT: Tablet (max 991px)
   ═══════════════════════════════════ */
@media (max-width: 991px) {
    /* Hero carousel */
    .rn-carousel-layout {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: 30px !important;
    }
    .rn-carousel-content { order: 1; }
    .rn-carousel-media {
        order: 2;
        max-height: 350px;
        margin: 0 auto;
        width: 100%;
    }
    .rn-carousel-excerpt,
    .rn-carousel-meta {
        margin-left: auto;
        margin-right: auto;
    }
    .rn-home-hero-actions {
        justify-content: center;
    }
    .rn-hero-carousel {
        padding: 80px 0 60px !important;
        min-height: auto !important;
    }

    /* Post grids */
    .rn-post-grid-home {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    /* Home hero */
    .rn-home-hero-layout {
        grid-template-columns: 1fr !important;
    }
    .rn-home-hero-card img {
        height: 280px;
    }

    /* Featured layout */
    .rn-home-featured-layout {
        grid-template-columns: 1fr !important;
    }

    /* Split layouts */
    .rn-split {
        grid-template-columns: 1fr !important;
    }

    /* Contact layout */
    .rn-contact-layout {
        grid-template-columns: 1fr !important;
    }

    /* Blog layout */
    .rn-blog-layout,
    .rn-article-layout {
        grid-template-columns: 1fr !important;
    }
    .rn-article-aside {
        position: static !important;
    }

    /* Contact highlights */
    .rn-contact-highlights {
        grid-template-columns: 1fr !important;
    }

    /* Category grid */
    .rn-category-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    }

    /* Page hero: flex on tablet */
    .rn-categories-page-hero > .main-container > div {
        flex-direction: column !important;
    }
    .rn-categories-page-hero > .main-container > div > div:first-child {
        max-width: 100% !important;
        flex: 1 1 100% !important;
    }
    .rn-categories-page-hero > .main-container > div > div:last-child {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    /* Trending slider */
    .rn-trending-slider-wrapper > * {
        flex: 0 0 calc(50% - 12px) !important;
    }
}

/* ═══════════════════════════════════
   BREAKPOINT: Mobile Navbar (max 980px)
   ═══════════════════════════════════ */
@media (max-width: 980px) {
    .rn-menu-btn {
        display: block !important;
    }
    .rn-nav {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        right: 12px;
        left: 12px;
        background: #fff;
        border: 1px solid var(--rn-border, #e8e8e8);
        border-radius: 16px;
        box-shadow: 0 12px 40px rgba(0,0,0,0.12);
        flex-direction: column;
        align-items: stretch;
        width: auto;
        padding: 12px;
        z-index: 1200;
    }
    .rn-nav.active {
        display: flex !important;
    }
    .rn-nav a {
        width: 100%;
        text-align: center;
        padding: 12px 16px;
    }
    .rn-nav-group,
    .rn-nav-actions {
        position: static !important;
        transform: none !important;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    .rn-nav-actions {
        margin: 8px 0 0;
        gap: 8px;
    }
    .rn-start-cta,
    .rn-nav .rn-nav-cta {
        text-align: center !important;
        width: 100%;
    }

    /* Post grid */
    .rn-post-grid {
        grid-template-columns: 1fr !important;
    }

    /* Search form */
    .rn-search-form {
        grid-template-columns: 1fr !important;
        flex-direction: column;
        max-width: 100% !important;
    }
    .rn-search-form button {
        position: static !important;
        width: 100%;
        padding: 14px !important;
        border-radius: 12px !important;
    }
    .rn-search-form input {
        border-radius: 12px !important;
    }

    /* Author grid */
    .rn-author-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* ═══════════════════════════════════
   BREAKPOINT: Small Tablet (max 768px)
   ═══════════════════════════════════ */
@media (max-width: 768px) {
    /* Page sections */
    .rn-page {
        padding: 60px 0 !important;
    }

    /* Title scaling */
    .rn-page-title {
        font-size: clamp(28px, 5vw, 42px) !important;
    }
    .rn-page-title-sm {
        font-size: clamp(24px, 4vw, 32px) !important;
    }

    /* Section headers */
    .rn-section-heading {
        margin-bottom: 40px !important;
    }

    /* Post grid */
    .rn-post-grid-home {
        grid-template-columns: 1fr !important;
    }

    /* Featured items */
    .rn-home-featured-item {
        grid-template-columns: 100px minmax(0, 1fr) !important;
    }
    .rn-home-featured-item img {
        height: 80px !important;
    }

    /* Footer */
    .rn-footer-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
        padding: 28px 16px !important;
    }
    .rn-footer-bottom {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center;
        gap: 16px;
        padding: 12px 16px 18px !important;
    }
    .rn-footer-socials {
        justify-content: center;
    }

    /* Roadmap grid */
    .rn-roadmap-grid {
        grid-template-columns: 1fr !important;
    }

    /* Category card */
    .rn-category-card {
        min-height: 200px !important;
    }

    /* Author grid on small tablet */
    .rn-author-grid {
        grid-template-columns: 1fr !important;
    }

    /* Blog detail */
    .blog-title,
    .blog-excerpt,
    .blog-author,
    .blog-meta,
    .blog-tags,
    .blog-share,
    .blog-content {
        padding: 0 16px !important;
    }

    /* Contact map */
    .rn-contact-map {
        height: 280px !important;
    }

    /* Hero section grids for inner page heros */
    .rn-categories-page-hero .main-container > div[style*="grid"] {
        grid-template-columns: 1fr !important;
    }
}

/* ═══════════════════════════════════
   BREAKPOINT: Mobile (max 600px)
   ═══════════════════════════════════ */
@media (max-width: 600px) {
    /* Global spacing */
    .rn-page {
        padding: 40px 0 !important;
    }
    .main-container {
        padding: 0 14px !important;
    }

    /* Page title */
    .rn-page-title {
        font-size: clamp(24px, 6vw, 36px) !important;
        margin-bottom: 16px !important;
    }
    .rn-page-subtitle {
        font-size: 16px !important;
    }

    /* Navbar brand */
    .rn-brand img {
        height: 48px !important;
    }
    .rn-header-inner {
        min-height: 64px !important;
    }

    /* Hero sections */
    .rn-hero-carousel {
        padding: 60px 0 50px !important;
        min-height: auto !important;
    }
    .rn-carousel-title {
        font-size: clamp(24px, 6vw, 36px) !important;
    }
    .rn-carousel-excerpt {
        font-size: 15px !important;
    }

    /* Inner page hero */
    .rn-categories-page-hero {
        min-height: 60vh !important;
        padding: 30px 0 40px !important;
    }
    .rn-categories-page-hero h1 {
        font-size: clamp(28px, 7vw, 42px) !important;
    }
    .rn-categories-page-hero p.rn-page-subtitle {
        font-size: 16px !important;
    }
    .rn-categories-page-hero ul li {
        font-size: 14px;
    }

    /* Hero buttons */
    .rn-home-hero-actions,
    .hero-buttons {
        flex-direction: column !important;
        width: 100%;
    }
    .rn-home-hero-actions .btn,
    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    /* Hero stat cards in inner pages */
    .rn-categories-page-hero div[style*="flex:0 1 420px"] {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    /* Cards */
    .rn-post-card {
        border-radius: 16px !important;
    }
    .rn-post-content {
        padding: 18px !important;
    }
    .rn-post-title {
        font-size: 1.15rem !important;
    }

    /* Category grid */
    .rn-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }
    .rn-category-card {
        min-height: 160px !important;
        aspect-ratio: auto !important;
    }
    .rn-category-name {
        font-size: 0.9rem !important;
        padding: 8px !important;
        margin: 10px !important;
        width: calc(100% - 20px) !important;
    }

    /* Glass panels / process cards */
    .glass-panel,
    .process-card {
        padding: 24px !important;
    }

    /* Contact cards */
    .rn-contact-card {
        padding: 18px !important;
    }
    .rn-contact-form-card {
        padding: 24px !important;
    }

    /* FAQ */
    .rn-faq-question {
        padding: 16px 18px !important;
        font-size: 1rem !important;
    }
    .rn-faq-answer {
        padding: 16px 18px !important;
    }

    /* Review cards */
    .rn-review-card {
        padding: 24px !important;
    }

    /* Trending slider */
    .rn-trending-slider-wrapper > * {
        flex: 0 0 85% !important;
    }

    /* Blog detail */
    .blog-featured-img {
        max-height: 200px !important;
    }
    .blog-title {
        font-size: 1.6rem !important;
    }

    /* Article */
    .rn-article-body {
        padding: 16px !important;
    }
    .rn-article-title {
        font-size: 24px !important;
    }

    /* Newsletter inline forms */
    .rn-newsletter-form[style*="flex-direction:row"],
    form[style*="flex-direction:row"] {
        flex-direction: column !important;
    }

    /* Back to top */
    #rn-back-top {
        bottom: 16px !important;
        right: 16px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 16px !important;
    }

    /* Footer */
    .rn-footer {
        margin-top: 24px !important;
    }
    .rn-footer-logo {
        height: 56px !important;
    }

    /* Pagination */
    .rn-pagination {
        gap: 8px !important;
        flex-wrap: wrap;
        justify-content: center;
    }
    .rn-page-link {
        width: 38px !important;
        height: 38px !important;
        font-size: 13px !important;
    }

    /* Stats sections */
    div[style*="grid-template-columns:repeat(auto-fit,minmax(160px"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }

    /* Buttons ensure no overflow */
    .btn {
        padding: 12px 24px !important;
        font-size: 14px !important;
    }

    /* Contact department grid */
    div[style*="grid-template-columns: repeat(auto-fit, minmax(280px"] {
        grid-template-columns: 1fr !important;
    }

    /* About page split */
    div[style*="grid-template-columns: 1fr 1fr; gap: 60px"] {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    /* About decorative offset border */
    .rn-split-media > div[style*="position: absolute"] {
        display: none !important;
    }

    /* Hero content flex */
    div[style*="flex:1 1 500px"] {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }

    /* Fix blog/categories hero stats overlap */
    div[style*="display:flex"][style*="flex-wrap:wrap"][style*="gap:20px"] {
        gap: 12px !important;
        justify-content: space-around !important;
    }
    div[style*="display:flex"][style*="flex-wrap:wrap"][style*="gap:20px"] > div {
        min-width: 60px;
    }
    div[style*="display:flex"][style*="flex-wrap:wrap"][style*="gap:20px"] > div > div:first-child {
        font-size: 22px !important;
    }
}

/* ═══════════════════════════════════
   BREAKPOINT: Extra Small (max 400px)
   ═══════════════════════════════════ */
@media (max-width: 400px) {
    .rn-page-title {
        font-size: 22px !important;
    }
    .rn-carousel-title {
        font-size: 22px !important;
    }
    .rn-category-grid {
        grid-template-columns: 1fr !important;
    }
    .hero-content {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
    .hero-text h1 {
        font-size: 32px !important;
    }
    div[style*="grid-template-columns:repeat(auto-fit,minmax(160px"] {
        grid-template-columns: 1fr 1fr !important;
    }
    .rn-categories-page-hero {
        min-height: 50vh !important;
    }
}

/* ═══════════════════════════════════
   Landscape phones
   ═══════════════════════════════════ */
@media (max-height: 500px) and (orientation: landscape) {
    .rn-hero-carousel,
    .rn-categories-page-hero {
        min-height: auto !important;
        padding: 40px 0 !important;
    }
}

/* ═══════════════════════════════════
   ADDITIONAL POLISH
   ═══════════════════════════════════ */

/* Smooth scroll for whole page */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

/* Prevent horizontal overflow globally */
body {
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fluid typography for body */
body {
    font-size: clamp(15px, 1.6vw, 17px);
    line-height: 1.65;
}

/* Luxury heading weight scale */
h1 { font-weight: 800; }
h2 { font-weight: 700; }
h3 { font-weight: 700; }
h4 { font-weight: 600; }
h5 { font-weight: 600; }
h6 { font-weight: 600; }

/* Enhanced card border radius consistency */
.rn-panel,
.rn-contact-card,
.rn-article-card {
    border-radius: 20px;
}

/* Ensure iframes are responsive */
iframe {
    max-width: 100%;
}

/* Fix for About page inline grid on mobile */
@media (max-width: 768px) {
    div[style*="display: grid; grid-template-columns: 1fr 1fr; gap: 60px"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
    div[style*="display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr))"] {
        grid-template-columns: 1fr !important;
    }
    div[style*="grid-template-columns: repeat(auto-fit, minmax(300px, 1fr))"] {
        grid-template-columns: 1fr !important;
    }
    div[style*="grid-template-columns: repeat(auto-fit, minmax(220px, 1fr))"] {
        grid-template-columns: 1fr !important;
    }
}

/* Fix newsletter form inline layout on mobile */
@media (max-width: 600px) {
    form[style*="display:flex"][style*="gap:12px"][style*="flex-wrap:wrap"] {
        flex-direction: column !important;
    }
    form[style*="display:flex"][style*="gap:12px"][style*="flex-wrap:wrap"] input {
        min-width: 100% !important;
        border-radius: 12px !important;
    }
    form[style*="display:flex"][style*="gap:12px"][style*="flex-wrap:wrap"] button {
        width: 100% !important;
        border-radius: 12px !important;
    }
}

/* Start Here page hero fix */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }
    .hero-text h1 {
        font-size: clamp(28px, 6vw, 48px) !important;
    }
    .hero-section {
        padding: 60px 0 !important;
    }
}
