/*
Theme Name: ETchamber WP
Theme URI: https://example.com/
Author: Aliakbar Soleimani - 09139002087
Author URI: https://example.com/
Description: A modern WordPress theme for the Tehran E-Commerce Association, converted from a React SPA.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: custom-logo, custom-menu, featured-images, post-formats, theme-options, threaded-comments
Text Domain: etchamber-wp
*/


@font-face {
    font-family: 'Anjomanweb';
    src: url('https://etchamber.ir/wp-content/themes/khorshid-etchamber/dist/fonts/Anjoman-Regular_fc8493dd.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Anjomanweb';
    src: url('https://etchamber.ir/wp-content/themes/khorshid-etchamber/dist/fonts/Anjoman-Bold_f42350aa.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family: 'Anjomanweb', 'Tahoma', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #f9fafb; /* bg-gray-50 */
}
::selection {
    background-color: #004a99;
    color: white;
}
.material-icons-outlined {
    vertical-align: middle;
}

/* --- WordPress Navigation Menu Styles --- */

/* Base menu item styling */
#desktop-navigation .menu-item > a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
    font-weight: 600;
    color: #4b5563; /* text-gray-600 */
    transition: color 0.3s;
}
#desktop-navigation .menu-item > a:hover {
    color: #004a99;
}

/* Underline effect */
#desktop-navigation .menu-item > a .underline {
    position: absolute;
    bottom: 14px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #004a99;
    transform: scaleX(0);
    transition: transform 0.3s ease-out;
}
#desktop-navigation .menu-item > a:hover .underline {
    transform: scaleX(1);
}

/* Arrow icon */
#desktop-navigation .menu-item-has-children > a > .material-icons-outlined {
    transition: transform 0.2s;
}
#desktop-navigation .menu-item-has-children:hover > a > .material-icons-outlined {
    transform: rotate(180deg);
}

/* Active menu item */
#desktop-navigation .current-menu-item > a,
#desktop-navigation .current-menu-ancestor > a {
    color: #004a99;
}


/* Sub-menu panel base styles */
.sub-menu-container {
    display: none;
    position: absolute;
    top: 100%;
    right: 50%;
    transform: translateX(50%);
    padding-top: 1rem;
    z-index: 50;
    animation: panel-fade-in-down 0.2s ease-out forwards;
}

.menu-item-has-children:hover > .sub-menu-container {
    display: block;
}

.sub-menu-content {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    border: 1px solid #f3f4f6; /* border-gray-100 */
    padding: 0.5rem;
}

/* Dropdown specific styles */
.sub-menu-container.is-dropdown {
    width: 14rem; /* w-56 */
}
.sub-menu-container.is-dropdown a {
    display: block;
    width: 100%;
    text-align: right;
    padding: 0.625rem 1rem; /* px-4 py-2.5 */
    border-radius: 0.375rem; /* rounded-md */
    color: #374151; /* text-gray-700 */
    font-weight: 600;
    transition: all 0.2s;
}
.sub-menu-container.is-dropdown a:hover {
    background-color: #f3f4f6; /* bg-gray-100 */
    color: #004a99;
}

/* Mega menu specific styles */
.sub-menu-container.is-mega-menu {
    width: 35rem; /* w-[560px] */
}
.sub-menu-container.is-mega-menu .sub-menu-content {
    padding: 1rem;
}
.sub-menu-container.is-mega-menu .grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}
.sub-menu-container.is-mega-menu a.mega-menu-item {
    display: flex;
    align-items: flex-start;
    text-align: right;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}
.sub-menu-container.is-mega-menu a.mega-menu-item:hover {
    background-color: #f3f4f6; /* bg-gray-100 */
}
.sub-menu-container.is-mega-menu a.mega-menu-item .icon-wrapper {
    flex-shrink: 0;
    background-color: #eff6ff; /* bg-blue-50 */
    color: #004a99;
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}
.sub-menu-container.is-mega-menu a.mega-menu-item:hover .icon-wrapper {
    background-color: #dbeafe; /* bg-blue-100 */
}
.sub-menu-container.is-mega-menu h4 {
    font-weight: 700;
    color: #1f2937; /* text-gray-800 */
}
.sub-menu-container.is-mega-menu p {
    font-size: 0.875rem;
    color: #4b5563; /* text-gray-600 */
    margin-top: 0.25rem;
}



/* --- General & Modal Styles --- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fade-in 0.2s ease-out forwards;
}
.modal-content {
    background-color: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    animation: slide-up 0.3s ease-out forwards;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.membership-form-modal .modal-content {
    max-width: 42rem;
    width: 100%;
    margin-top: auto;
    margin-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    /*align-items: flex-end; !* for RTL *!*/
}

.analyst-modal .modal-content {
    width: 100%;
    max-width: 64rem;
    height: 90vh;
}

.member-story-modal .modal-content {
    width: 100%;
    max-width: 48rem;
}

.line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}
.animate-flip-down {
    animation: flip-down 0.5s ease-out forwards;
    transform-origin: top;
}


/* --- Comments Area --- */
.comment-list, .comment-list ol.children {
    list-style: none;
    padding: 0;
}
.comment-list .children {
    padding-right: 1.5rem; /* Indent replies */
    margin-top: 2rem;
    margin-bottom: 0;
    border-right: 2px solid #f3f4f6; /* border-gray-100 */
}
.comment-list li:last-child > .children {
    border-image-source: linear-gradient(to bottom, #f3f4f6, transparent);
    border-image-slice: 1;
}

/* Style for author of the post */
.bypostauthor > .comment-body > .flex-grow {
    background-color: #eff6ff; /* bg-blue-50 */
    border-radius: 0.75rem;
    padding: 1rem;
    border: 1px solid #dbeafe; /* border-blue-200 */
}
.comment-awaiting-moderation {
    color: #ca8a04; /* text-yellow-600 */
    background-color: #fefce8; /* bg-yellow-50 */
    border: 1px solid #fef08a; /* border-yellow-200 */
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-style: italic;
    font-size: 0.875rem;
}

/* Comments Pagination */
.comments-pagination ul {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style-type: none;
    padding: 0;
}
.comments-pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem; /* w-10 */
    height: 2.5rem; /* h-10 */
    padding: 0 0.75rem;
    background-color: #ffffff; /* bg-white */
    color: #374151; /* text-gray-700 */
    font-weight: 600;
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    border: 1px solid #e5e7eb; /* border-gray-200 */
    transition: all 0.2s ease-in-out;
    text-decoration: none;
}
.comments-pagination .page-numbers:hover {
    background-color: #f3f4f6; /* bg-gray-100 */
}
.comments-pagination .page-numbers.current {
    background-color: #004a99;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    border-color: #004a99;
}
.comments-pagination .screen-reader-text {
    display: none;
}
.comment-form-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.comment-form-comment {
    grid-column: span 2;
}

/* Animation keyframes */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes flip-down {
    from { transform: perspective(150px) rotateX(-90deg); opacity: 0; }
    to { transform: perspective(150px) rotateX(0deg); opacity: 1; }
}
@keyframes slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes panel-fade-in-down {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-panel-fade-in-down { animation: panel-fade-in-down 0.2s ease-out forwards; }

.animated-section {
    transition: all 0.7s ease-out;
    opacity: 0;
    transform: translateY(32px);
}

.animated-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none;  scrollbar-width: none; }

.prose p { margin-bottom: 1.5rem; }
.prose h1, .prose h2, .prose h3 { font-weight: bold; margin-top: 2em; margin-bottom: 1em; color: #1f2937}


/* --- Hamburger Menu Styles --- */

/* Prevents background scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Main panel container (hidden by default) */
#mobile-menu-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    visibility: hidden; /* Hidden when not active */
    transition: visibility 0.3s;
}

/* When menu is visible, make the container visible */
#mobile-menu-panel.is-visible {
    visibility: visible;
}

/* Semi-transparent overlay */
#mobile-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

#mobile-menu-panel.is-visible #mobile-menu-overlay {
    opacity: 1;
}

/* The actual menu content that slides in */
#mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0; /* Change to 'left: 0;' for slide-in from left */
    width: 80%;
    max-width: 320px;
    height: 100%;
    background-color: white;
    box-shadow: -2px 0 16px rgba(0,0,0,0.1);
    transform: translateX(100%); /* Hides it off-screen to the right */
    /* Change to 'translateX(-100%)' if sliding from left */
    transition: transform 0.3s ease-in-out;
    padding: 1.5rem;
    overflow-y: auto;
}

#mobile-menu-panel.is-visible #mobile-menu-content {
    transform: translateX(0); /* Slides it into view */
}

/* Styling for the cloned list and items */
.mobile-nav-list {
    display: flex;
    flex-direction: column;
}

.mobile-nav-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0.5rem;
    font-weight: 600;
    border-bottom: 1px solid #f3f4f6; /* gray-100 */
}

/* Submenu is hidden by default */
.mobile-nav-list .sub-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
    margin-right: 1rem;
    padding-right: 0.5rem;
    border-right: 2px solid #e5e7eb; /* gray-200 */
}

/* When the parent li has class 'open', the submenu expands */
.mobile-nav-list .menu-item-has-children.open > .sub-menu {
    max-height: 500px;
    margin-top: 0.5rem;
}

/* Rotate the icon when the submenu is open */
.mobile-nav-list .menu-item-has-children.open > a i {
    transform: rotate(180deg);
}