/**
 * Imdad Portal - Custom CSS
 * Pakistani Government Schemes Portal Theme
 *
 * Styles that cannot be achieved with Tailwind utility classes alone.
 * WordPress-specific overrides, focus styles, print styles, etc.
 */

/* ============================================================
 * WORDPRESS ADMIN BAR OFFSET
 * ============================================================ */
body.admin-bar {
    padding-top: 32px;
}

body.admin-bar .site-header,
body.admin-bar header[role="banner"],
body.admin-bar #masthead {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar {
        padding-top: 46px;
    }

    body.admin-bar .site-header,
    body.admin-bar header[role="banner"],
    body.admin-bar #masthead {
        top: 46px;
    }
}

@media screen and (max-width: 600px) {
    body.admin-bar .site-header,
    body.admin-bar header[role="banner"],
    body.admin-bar #masthead {
        top: 0;
        position: relative;
    }
}

/* ============================================================
 * CUSTOM SELECTION COLORS
 * ============================================================ */
::selection {
    background-color: #166534;
    color: #ffffff;
}

::-moz-selection {
    background-color: #166534;
    color: #ffffff;
}

/* ============================================================
 * FOCUS STYLES - Matching original design
 * ============================================================ */
/* Keyboard navigation focus rings */
body.keyboard-nav *:focus {
    outline: 2px solid #166534;
    outline-offset: 2px;
}

body.keyboard-nav *:focus:not(:focus-visible) {
    outline: none;
}

body.keyboard-nav *:focus-visible {
    outline: 2px solid #166534;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Custom focus for interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #166534;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Remove default focus outline for mouse users */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
    outline: none;
}

/* Custom input focus styles */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: #166534;
    box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.15);
}

/* ============================================================
 * HEADER SCROLL EFFECT
 * ============================================================ */
.site-header,
header[role="banner"],
#masthead {
    transition: box-shadow 0.3s ease,
                background-color 0.3s ease,
                backdrop-filter 0.3s ease;
}

/* ============================================================
 * MOBILE MENU
 * ============================================================ */
.mobile-menu,
.mobile-nav,
#mobile-menu {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.mobile-menu.is-open,
.mobile-nav.is-open,
#mobile-menu.is-open {
    transform: translateX(0);
}

.mobile-menu-overlay,
.menu-overlay,
#mobile-overlay {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.is-visible,
.menu-overlay.is-visible,
#mobile-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Hamburger animation */
.mobile-menu-toggle .hamburger-line,
.menu-toggle .hamburger-line {
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.is-active .hamburger-line:nth-child(1),
.menu-toggle.is-active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.is-active .hamburger-line:nth-child(2),
.menu-toggle.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.is-active .hamburger-line:nth-child(3),
.menu-toggle.is-active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ============================================================
 * MOBILE BOTTOM NAVIGATION
 * ============================================================ */
.mobile-bottom-nav,
.bottom-nav,
#mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: linear-gradient(135deg,#065f46 0%,#059669 55%,#0d9488 100%) !important;
    border-top: 1.5px solid rgba(255,255,255,.15);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 6px 0;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
}

.mobile-bottom-nav .nav-item,
.mobile-bottom-nav .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 12px;
    font-size: 10px;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    transition: color 0.2s ease;
    position: relative;
}

.mobile-bottom-nav .nav-item.active,
.mobile-bottom-nav .bottom-nav-item.active {
    color: #ffffff;
}

.mobile-bottom-nav .nav-item.active svg,
.mobile-bottom-nav .bottom-nav-item.active svg {
    color: #166534;
}

.nav-indicator,
.bottom-nav-indicator {
    position: absolute;
    top: 0;
    height: 3px;
    background: #166534;
    border-radius: 0 0 3px 3px;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: calc(100% / 5);
}

/* Bottom padding via footer spacer, not body - prevents white gap */
/* body:has padding-bottom intentionally removed; .imdad-footer-mobile-spacer handles clearance */

/* ============================================================
 * ANIMATED COUNTERS
 * ============================================================ */
[data-counter],
.animated-counter {
    font-variant-numeric: tabular-nums;
}

/* ============================================================
 * INTERSECTION OBSERVER ANIMATIONS
 * ============================================================ */
.observe-animate,
[data-animate] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.observe-animate.visible,
[data-animate].visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animation variants */
[data-animate="fade-up"] {
    transform: translateY(24px);
}

[data-animate="fade-down"] {
    transform: translateY(-24px);
}

[data-animate="fade-left"] {
    transform: translateX(24px);
}

[data-animate="fade-right"] {
    transform: translateX(-24px);
}

[data-animate="zoom-in"] {
    transform: scale(0.9);
}

[data-animate="zoom-in"].visible {
    transform: scale(1);
}

/* Staggered animation delays */
[data-animate-delay="100"] { transition-delay: 100ms; }
[data-animate-delay="200"] { transition-delay: 200ms; }
[data-animate-delay="300"] { transition-delay: 300ms; }
[data-animate-delay="400"] { transition-delay: 400ms; }
[data-animate-delay="500"] { transition-delay: 500ms; }
[data-animate-delay="600"] { transition-delay: 600ms; }
[data-animate-delay="700"] { transition-delay: 700ms; }
[data-animate-delay="800"] { transition-delay: 800ms; }

/* ============================================================
 * BACK TO TOP BUTTON
 * ============================================================ */
.back-to-top,
#back-to-top {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity 0.3s ease,
                transform 0.3s ease,
                background-color 0.2s ease;
}

.back-to-top.visible,
#back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover,
#back-to-top:hover {
    background-color: #166534;
}

/* ============================================================
 * SEARCH SUGGESTIONS
 * ============================================================ */
.search-suggestions,
#search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    z-index: 50;
    max-height: 320px;
    overflow-y: auto;
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.search-suggestions[style*="display: block"],
#search-suggestions[style*="display: block"] {
    opacity: 1;
    visibility: visible;
}

.suggestion-item:hover {
    background: #f0fdf4 !important;
}

/* ============================================================
 * MOBILE FILTER SHEET
 * ============================================================ */
.mobile-filter-sheet,
#mobile-filter-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
}

.mobile-filter-sheet.is-open,
#mobile-filter-sheet.is-open {
    transform: translateY(0);
}

.filter-overlay,
#filter-overlay {
    position: fixed;
    inset: 0;
    z-index: 49;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.filter-overlay[style*="opacity: 1"],
#filter-overlay[style*="opacity: 1"] {
    pointer-events: auto;
}

/* ============================================================
 * SCHEME CARDS
 * ============================================================ */
.scheme-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.scheme-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.scheme-card .save-scheme-btn.is-saved svg,
.scheme-card .bookmark-btn.is-saved svg {
    fill: #16a34a;
    color: #16a34a;
}

/* ============================================================
 * ACCORDION / COLLAPSIBLE
 * ============================================================ */
.accordion-content,
.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-trigger .accordion-icon,
[data-accordion] .accordion-icon {
    transition: transform 0.3s ease;
}

.accordion-trigger.is-open .accordion-icon,
[data-accordion].is-open .accordion-icon {
    transform: rotate(180deg);
}

/* ============================================================
 * ANNOUNCEMENT TICKER
 * ============================================================ */
.announcement-ticker,
#announcement-ticker {
    overflow: hidden;
}

.ticker-content,
.ticker-track {
    display: inline-flex;
    white-space: nowrap;
}

/* Desktop marquee */
@media (min-width: 768px) {
    .ticker-content,
    .ticker-track {
        animation: ticker-scroll 30s linear infinite;
    }

    .ticker-content:hover,
    .ticker-track:hover {
        animation-play-state: paused;
    }
}

@keyframes ticker-scroll {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Mobile: horizontal scroll */
@media (max-width: 767px) {
    .ticker-content,
    .ticker-track {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .ticker-content::-webkit-scrollbar,
    .ticker-track::-webkit-scrollbar {
        display: none;
    }
}

/* ============================================================
 * TOAST NOTIFICATIONS
 * ============================================================ */
.imdad-toast {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ============================================================
 * ELIGIBILITY CHECKER
 * ============================================================ */
.eligibility-step {
    display: none;
}

.eligibility-step.is-active {
    display: block;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress bar for eligibility checker */
.eligibility-progress-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 99px;
    overflow: hidden;
}

.eligibility-progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #166534, #22c55e);
    border-radius: 99px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading animation for eligibility check */
.eligibility-loading .loading-stage {
    display: none;
}

.eligibility-loading .loading-stage.is-active {
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeInUp 0.3s ease;
}

.eligibility-loading .loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: #166534;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Eligibility result cards */
.eligibility-result-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.eligibility-result-card.eligible {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.eligibility-result-card.not-eligible {
    border-color: #fecaca;
    background: #fef2f2;
}

.eligibility-result-card.maybe-eligible {
    border-color: #fef08a;
    background: #fefce8;
}

/* ============================================================
 * PAGINATION
 * ============================================================ */
.browse-pagination .page-link,
.browse-pagination [data-page] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.browse-pagination .page-link:hover,
.browse-pagination [data-page]:hover {
    background: #f0fdf4;
    border-color: #166534;
    color: #166534;
}

.browse-pagination .page-link.active,
.browse-pagination [data-page].active {
    background: #166534;
    border-color: #166534;
    color: #ffffff;
}

/* ============================================================
 * LEGAL SECTION (Footer, Mobile)
 * ============================================================ */
.legal-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.legal-content.is-expanded {
    /* max-height set via JS */
}

.legal-read-more {
    color: #166534;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    background: none;
    padding: 0;
    font-size: 14px;
}

.legal-read-more:hover {
    text-decoration: underline;
}

/* Hide read more on desktop */
@media (min-width: 768px) {
    .legal-content {
        max-height: none !important;
        overflow: visible !important;
    }

    .legal-read-more,
    [data-legal-toggle] {
        display: none !important;
    }
}

/* ============================================================
 * CUSTOM SCROLLBAR
 * ============================================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f9fafb;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f9fafb;
}

/* Max height scroll containers */
.max-h-scroll {
    max-height: 400px;
    overflow-y: auto;
}

.max-h-scroll::-webkit-scrollbar {
    width: 6px;
}

.max-h-scroll::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 99px;
}

/* ============================================================
 * WORDPRESS SPECIFIC OVERRIDES
 * ============================================================ */

/* Alignments */
.alignleft {
    float: left;
    margin-right: 1.5em;
    margin-bottom: 1.5em;
}

.alignright {
    float: right;
    margin-left: 1.5em;
    margin-bottom: 1.5em;
}

.aligncenter {
    clear: both;
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5em;
}

/* WordPress captions */
.wp-caption {
    max-width: 100%;
    margin-bottom: 1.5em;
}

.wp-caption-text {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.55);
    text-align: center;
    padding: 0.5rem 0;
}

/* WordPress gallery */
.gallery {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 640px) {
    .gallery-columns-3,
    .gallery-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* WordPress images */
img.size-auto,
img.size-full,
img.size-large,
img.size-medium {
    max-width: 100%;
    height: auto;
}

/* Post content styles */
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
}

.entry-content h1 { font-size: 2rem; }
.entry-content h2 { font-size: 1.625rem; }
.entry-content h3 { font-size: 1.375rem; }
.entry-content h4 { font-size: 1.125rem; }

.entry-content p {
    margin-bottom: 1em;
    line-height: 1.75;
    color: #374151;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.entry-content li {
    margin-bottom: 0.25em;
    line-height: 1.75;
}

.entry-content a {
    color: #166534;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.entry-content a:hover {
    color: #14532d;
}

.entry-content blockquote {
    border-left: 4px solid #166534;
    padding-left: 1rem;
    margin: 1.5em 0;
    font-style: italic;
    color: #4b5563;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5em;
}

.entry-content th,
.entry-content td {
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    text-align: left;
}

.entry-content th {
    background: #f9fafb;
    font-weight: 600;
}

/* Screen reader text (WordPress) */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* WordPress pagination */
.nav-links {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 2rem 0;
}

.nav-links .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-links .page-numbers:hover {
    background: #f0fdf4;
    border-color: #166534;
    color: #166534;
}

.nav-links .page-numbers.current {
    background: #166534;
    border-color: #166534;
    color: #ffffff;
}

/* Comments */
.comment-list {
    list-style: none;
    padding: 0;
}

.comment-body {
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 1rem;
}

/* ============================================================
 * UTILITY CLASSES
 * ============================================================ */

/* Hide scrollbar but keep scroll functionality */
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Green gradient text */
.text-gradient-green {
    background: linear-gradient(135deg, #166534, #22c55e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card hover effect */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Pulse animation for live indicators */
.pulse-green {
    animation: pulseGreen 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulseGreen {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================================
 * PRINT STYLES
 * ============================================================ */
@media print {
    /* Reset colors */
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Show links */
    a,
    a:visited {
        text-decoration: underline;
    }

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.875rem;
        font-weight: normal;
    }

    a[href^="#"]:after,
    a[href^="javascript:"]:after {
        content: "";
    }

    /* Abbreviations */
    abbr[title]:after {
        content: " (" attr(title) ")";
    }

    /* Page breaks */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
    }

    img {
        page-break-inside: avoid;
        max-width: 100% !important;
    }

    p, h2, h3 {
        orphans: 3;
        widows: 3;
    }

    h2, h3 {
        page-break-after: avoid;
    }

    /* Hide non-essential elements */
    .site-header,
    header[role="banner"],
    #masthead,
    .mobile-bottom-nav,
    .bottom-nav,
    #mobile-bottom-nav,
    .mobile-menu,
    .mobile-nav,
    #mobile-menu,
    .back-to-top,
    #back-to-top,
    .share-btn,
    [data-share],
    .save-scheme-btn,
    [data-save-scheme],
    .bookmark-btn,
    .announcement-ticker,
    #announcement-ticker,
    .mobile-menu-toggle,
    .menu-toggle,
    .filter-toggle-btn,
    #mobile-filter-toggle,
    .mobile-filter-sheet,
    #mobile-filter-sheet,
    .filter-overlay,
    #filter-overlay,
    #imdad-toast-container,
    .eligibility-form,
    #eligibility-checker,
    .search-suggestions,
    #search-suggestions,
    .browse-pagination,
    #browse-pagination,
    .browse-filters,
    #browse-filters,
    nav.pagination,
    #comments,
    .comment-respond,
    .widget,
    .sidebar,
    #secondary,
    .footer-widgets,
    .social-links,
    .ticker-pause,
    .ticker-control,
    .legal-read-more,
    [data-legal-toggle] {
        display: none !important;
    }

    /* Show main content full width */
    .site-content,
    main[role="main"],
    #primary {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Footer minimal */
    .site-footer,
    footer[role="contentinfo"],
    #colophon {
        border-top: 1px solid #000;
        padding-top: 12px;
        margin-top: 24px;
    }

    /* Print URL at bottom */
    body:after {
        content: "Source: " attr(data-url);
        display: block;
        font-size: 10px;
        color: #666;
        margin-top: 24px;
        padding-top: 12px;
        border-top: 1px solid #ccc;
    }

    /* Remove backgrounds */
    body {
        background: #fff !important;
        font-size: 12pt;
    }

    /* Ensure content doesn't overflow */
    .entry-content,
    .page-content {
        overflow: visible !important;
    }
}

/* ============================================================
 * DARK MODE SUPPORT
 * ============================================================ */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --imdad-primary: #22c55e;
        --imdad-primary-dark: #16a34a;
        --imdad-bg: #111827;
        --imdad-surface: #1f2937;
        --imdad-text: #f9fafb;
        --imdad-text-muted: #9ca3af;
        --imdad-border: #374151;
    }
}

[data-theme="dark"] {
    --imdad-primary: #22c55e;
    --imdad-primary-dark: #16a34a;
    --imdad-bg: #111827;
    --imdad-surface: #1f2937;
    --imdad-text: #f9fafb;
    --imdad-text-muted: #9ca3af;
    --imdad-border: #374151;
}

/* ============================================================
 * 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;
    }

    .observe-animate,
    [data-animate] {
        opacity: 1 !important;
        transform: none !important;
    }

    .ticker-content,
    .ticker-track {
        animation: none !important;
    }
}

/* ============================================================
 * SAFE AREA INSETS (iOS Notch)
 * ============================================================ */
@supports (padding: env(safe-area-inset-bottom)) {
    .mobile-bottom-nav,
    .bottom-nav,
    #mobile-bottom-nav {
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }

    .site-footer,
    footer[role="contentinfo"],
    #colophon {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
}
/* ===================================================
   IMDAD CATEGORY CARDS — Perfect Circles v3
   =================================================== */

/* Card wrapper — no background, just padding + hover */
.ec-cat-item {
    cursor: pointer;
    border-radius: 16px;
    background: transparent;
}
.ec-cat-item:hover {
    background: #f8fdf9;
}

/* THE CIRCLE — fixed size, always round, clips image */
.ec-cat-circle {
    position:relative;
    width:72px; height:72px;
    border-radius:50%;
    overflow:hidden;
    flex-shrink:0;
    background-color:color-mix(in srgb,var(--cc,#059669) 12%,white);
    border:2.5px solid color-mix(in srgb,var(--cc,#059669) 22%,white);
    box-shadow:0 3px 10px rgba(0,0,0,0.07);
    transition:transform .28s ease,box-shadow .28s ease;
    display:flex;align-items:center;justify-content:center;
}
.ec-cat-item:hover .ec-cat-circle {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 10px 28px rgba(0,0,0,0.13);
}

/* Image inside circle — fills 100%, no distortion */
.ec-cat-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;      /* fills circle, crops smartly from center */
    object-position: center center;
    display: block;
    transition: transform 0.4s ease;
}
.ec-cat-item:hover .ec-cat-img {
    transform: scale(1.08);
}

/* Icon fallback — shown when no image */
.ec-cat-icon {
    width: 40px;
    height: 40px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}
.ec-cat-item:hover .ec-cat-icon {
    transform: scale(1.12);
}

/* When image errors out, show icon-friendly bg */
.ec-cat-circle.ec-cat-no-img {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive sizes */

}
