/**
 * Alyssa Theme Custom Styles
 * Based on Tailwind CSS with custom design system
 */

/* Import Tailwind via CDN - will be loaded in functions.php */
/* Custom styles that extend Tailwind */

body {
    background-color: #FAF9F6;
    color: #2E4634;
    overflow-x: hidden;
}

/* Default selection color for body */
body::selection,
body ::selection {
    background-color: #FF8C42;
    color: #2E4634;
}

html {
    scroll-behavior: smooth;
}

/* --- Logo Styling (Mask Effect) --- */
.logo-container {
    position: relative;
    display: inline-block;
    font-family: "Playfair Display", serif;
    font-weight: 900;
    font-size: 2.25rem;
    line-height: 1;
    letter-spacing: -0.02em;
}

.logo-text-base {
    color: #2E4634;
    position: relative;
    z-index: 1;
}

.logo-mask {
    position: absolute;
    top: 50%;
    left: -12px;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background-color: #FF3B3B;
    border-radius: 50%;
    overflow: hidden;
    z-index: 2;
}

.logo-text-overlay {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: #FAF9F6;
    white-space: nowrap;
}

.group:hover .logo-mask {
    transform: translateY(-50%) scale(1.1);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- UI Elements --- */
.img-zoom-container {
    overflow: hidden;
}

.img-zoom-container img {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.group:hover .img-zoom-container img {
    transform: scale(1.08);
}

.btn-pill {
    border-radius: 9999px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(255, 59, 59, 0.4);
}

/* Custom Navigation Hover */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background-color: #FF3B3B;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.nav-link:hover::after {
    transform: translateX(-50%) scale(1);
}

/* Desktop Menu Dropdown Submenu - Compact spacing */
nav .sub-menu,
nav ul.sub-menu {
    padding: 0.375rem 0 !important;
    margin: 0 !important;
    min-width: 200px;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(46, 70, 52, 0.1);
    margin-top: 0.5rem !important;
}

nav .sub-menu li,
nav ul.sub-menu li {
    margin: 0 !important;
    padding: 0 !important;
}

nav .sub-menu a,
nav ul.sub-menu a {
    display: block;
    padding: 0.375rem 1.25rem !important;
    font-size: 0.875rem;
    line-height: 1.3;
    text-decoration: none;
    color: #2E4634;
    transition: all 0.2s ease;
}

nav .sub-menu a:hover,
nav ul.sub-menu a:hover {
    background-color: rgba(255, 59, 59, 0.05);
    color: #FF3B3B;
    padding-left: 1.5rem;
}

/* Animation Classes */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal.delay-100 {
    transition-delay: 0.1s;
}

.reveal.delay-200 {
    transition-delay: 0.2s;
}

.reveal.delay-300 {
    transition-delay: 0.3s;
}

/* Creative Card Styles */
.creative-card {
    background: white;
    border-radius: 2rem;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.creative-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -5px rgba(46, 70, 52, 0.08);
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Hero Grid Specifics */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .hero-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 320px);
    }
}

@media (min-width: 1024px) {
    .hero-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(2, 280px);
    }
    
    .hero-item-main {
        grid-column: span 2;
        grid-row: span 2;
    }
    
    .hero-item-tall {
        grid-column: span 1;
        grid-row: span 2;
    }
    
    .hero-item-std {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* Article Typography */
.article-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    font-size: 1.125rem;
    color: #4b5563;
}

.article-content h2 {
    font-family: "Playfair Display", serif;
    font-size: 2rem;
    font-weight: 700;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    color: #2E4634;
}

.article-content h3 {
    font-family: "Playfair Display", serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #2E4634;
}

/* Article Links - Make them distinct from text */
.article-content a {
    color: #FF3B3B;
    text-decoration: underline;
    text-decoration-color: #FF3B3B;
    text-underline-offset: 3px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.article-content a:hover {
    color: #FF8C42;
    text-decoration-color: #FF8C42;
    text-decoration-thickness: 2px;
}

.article-content a:visited {
    color: #8DA090;
    text-decoration-color: #8DA090;
}

.article-content a:focus {
    outline: 2px solid #FF3B3B;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Ensure author avatar is visible */
.avatar,
img.avatar {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
}

/* Fix category tags in sidebar - ensure text is always visible */
.sidebar-card a.bg-cream {
    color: #2E4634 !important;
    background-color: #FAF9F6 !important; /* cream background */
}

/* Category hover effects match design file - colored backgrounds on hover */
.sidebar-card a.bg-cream:hover {
    color: #FAF9F6 !important; /* white text on hover */
}

.first-letter-styled::first-letter {
    float: left;
    font-family: "Playfair Display", serif;
    font-size: 4rem;
    line-height: 0.8;
    font-weight: 700;
    color: #FF3B3B;
    margin-right: 0.75rem;
    margin-top: 0.25rem;
}

.article-content blockquote {
    border-left: 4px solid #FF8C42;
    padding-left: 1.5rem;
    margin: 2.5rem 0;
    font-family: "Playfair Display", serif;
    font-style: italic;
    font-size: 1.5rem;
    color: #2E4634;
    background: #fff;
    padding: 2rem;
    border-radius: 0 2rem 2rem 0;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
}

/* Sidebar Card */
.sidebar-card {
    background: white;
    border-radius: 2rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(46, 70, 52, 0.05);
}

/* Sidebar Links - Simple hover effects (reverted) */
.sidebar-card a {
    transition: all 0.3s ease;
}

/* Category Tags in Sidebar - Match design file */
.sidebar-card a.bg-cream {
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Mobile Menu - Modern, Elegant Design */
.mobile-menu-container {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.99), rgba(250, 249, 246, 0.99));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(46, 70, 52, 0.1);
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.mobile-menu-container:not(.hidden) {
    transform: translateY(0);
    opacity: 1;
}

.mobile-menu-content {
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay:not(.hidden) {
    opacity: 1;
}

/* Mobile menu items - Elegant styling */
.mobile-menu-item {
    position: relative;
    display: block;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(46, 70, 52, 0.08);
    margin-bottom: 0.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #FF3B3B, #FF8C42);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 59, 59, 0.05), rgba(255, 140, 66, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-item:hover,
.mobile-menu-item:focus {
    background: rgba(232, 237, 233, 0.8);
    border-color: rgba(255, 59, 59, 0.2);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(46, 70, 52, 0.08);
}

.mobile-menu-item:hover::before,
.mobile-menu-item:focus::before {
    transform: scaleY(1);
}

.mobile-menu-item:hover::after,
.mobile-menu-item:focus::after {
    opacity: 1;
}

.mobile-menu-item:active {
    transform: translateX(2px) scale(0.98);
}

/* Ensure mobile menu toggle is clickable - FIXED */
.mobile-menu-toggle-btn {
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 100 !important;
    position: relative !important;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    border: none !important;
    outline: none !important;
    background-color: #FF3B3B !important; /* vivid-red - always red */
    -webkit-tap-highlight-color: rgba(255, 59, 59, 0.2);
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.mobile-menu-toggle-btn:hover {
    background-color: rgba(255, 59, 59, 0.9) !important;
    box-shadow: 0 10px 25px -5px rgba(255, 59, 59, 0.4) !important;
    transform: translateY(-2px);
}

.mobile-menu-toggle-btn:active {
    transform: scale(0.95) translateY(0);
}

.mobile-menu-toggle-btn:focus {
    outline: 2px solid #FF3B3B;
    outline-offset: 2px;
}

.mobile-menu-toggle-btn i {
    pointer-events: none !important;
    transition: transform 0.3s ease;
    display: block !important;
    width: 24px !important;
    height: 24px !important;
}

.mobile-menu-toggle-btn[aria-expanded="true"] i {
    transform: rotate(90deg);
}

#mobile-menu-toggle {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Search toggle button - always red background */
#search-toggle {
    background-color: #FF3B3B !important; /* vivid-red - always red */
}

#search-toggle:hover {
    background-color: rgba(255, 59, 59, 0.9) !important;
}

/* Search Overlay */
#search-overlay {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#search-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

/* Pagination Styles */
.page-numbers {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
}

.page-numbers li {
    margin: 0;
}

.page-numbers a,
.page-numbers span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    border: 1px solid #e5e7eb;
    color: #2E4634;
    font-weight: 700;
    font-size: 1.125rem;
    transition: all 0.3s ease;
}

.page-numbers .current {
    background-color: #2E4634;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(46, 70, 52, 0.2);
}

.page-numbers a:hover {
    background-color: #E8EDE9;
    border-color: #E8EDE9;
}

/* Responsive Typography */
@media (max-width: 640px) {
    .logo-container {
        font-size: 1.75rem;
    }
    
    .hero-grid {
        gap: 1rem;
    }
    
    .article-content h2 {
        font-size: 1.5rem;
    }
    
    .article-content h3 {
        font-size: 1.25rem;
    }
}

/* WordPress Specific Adjustments */
.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.alignleft {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1.5rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5rem;
}

/* Ensure images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Remove login links completely */
a[href*="wp-login"],
a[href*="wp-admin"],
a[href*="login"] {
    display: none !important;
}

/* Selection colors - different for white backgrounds */
.sidebar-card::selection,
.sidebar-card ::selection,
.creative-card::selection,
.creative-card ::selection,
.bg-white::selection,
.bg-white ::selection,
.white::selection,
.white ::selection {
    background-color: #FF8C42;
    color: #2E4634;
}

/* Ensure icons are visible on all backgrounds */
[data-lucide] {
    color: currentColor;
    stroke: currentColor;
}

/* Fix icon colors in specific contexts - ensure visibility */
.bg-pistachio-light [data-lucide],
.bg-cream [data-lucide],
.bg-white [data-lucide] {
    color: #2E4634;
    stroke: #2E4634;
}

.bg-pistachio-dark [data-lucide],
.text-white [data-lucide] {
    color: #FAF9F6;
    stroke: #FAF9F6;
}

/* Fix hover states to ensure contrast */
.bg-pistachio-light:hover [data-lucide],
.bg-cream:hover [data-lucide],
.bg-white:hover [data-lucide] {
    color: #2E4634;
    stroke: #2E4634;
}

/* Ensure hover states maintain visibility */
.hover\:bg-pistachio-light:hover [data-lucide],
.hover\:bg-cream:hover [data-lucide] {
    color: #2E4634;
    stroke: #2E4634;
}

.hover\:bg-vivid-red:hover [data-lucide],
.hover\:bg-pistachio-dark:hover [data-lucide] {
    color: #FAF9F6;
    stroke: #FAF9F6;
}

/* Fix text colors in hover states for better contrast */
.hover\:bg-pistachio-light:hover {
    background-color: #E8EDE9;
}

.hover\:bg-cream:hover {
    background-color: #FAF9F6;
}

/* Ensure buttons with icons have proper contrast */
button[data-lucide],
a[data-lucide] {
    color: inherit;
}

/* Fix icon visibility in rounded backgrounds */
.rounded-full.bg-pistachio-light [data-lucide],
.rounded-full.bg-cream [data-lucide],
.rounded-full.bg-white [data-lucide] {
    color: #2E4634;
    stroke: #2E4634;
}

.rounded-full.bg-pistachio-dark [data-lucide],
.rounded-full.bg-vivid-red [data-lucide] {
    color: #FAF9F6;
    stroke: #FAF9F6;
}
