:root {
    --background: 40 25% 97%;
    --foreground: 220 20% 15%;

    --card: 0 0% 100%;
    --card-foreground: 220 20% 15%;

    --popover: 0 0% 100%;
    --popover-foreground: 220 20% 15%;

    --primary: 215 60% 35%;
    --primary-foreground: 0 0% 100%;

    --secondary: 40 30% 92%;
    --secondary-foreground: 220 20% 15%;

    --muted: 40 20% 94%;
    --muted-foreground: 220 10% 45%;

    --accent: 35 70% 55%;
    --accent-foreground: 220 20% 10%;

    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;

    --border: 40 15% 88%;
    --input: 40 15% 88%;
    --ring: 215 60% 35%;

    --radius: 0.75rem;
    --gold: 42 75% 50%;
    --gold-light: 42 60% 70%;
    --navy: 215 60% 25%;
    --navy-light: 215 40% 45%;
}

/* Global typography: keep the existing type scale while making it more readable. */
html {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body{
    font-family: PeydaWebFaNum, Tahoma, Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.75;
}

p {
    font-size: 1rem;
    line-height: 1.85;
    text-align: justify;
    text-justify: inter-word;
}

/* Form controls do not inherit typography consistently across browsers. */
button,
input,
select,
textarea {
    font: inherit;
}

@media (max-width: 767px) {
    html {
        font-size: 14px;
    }

    p {
        line-height: 1.8;
    }
}

/* Cap only widget-specific display titles; component headings keep their own scale. */
.elementor-widget-container .main-title {
    font-size: clamp(1.5rem, 3vw, 2.25rem) !important;
    line-height: 1.4 !important;
}

.elementor-widget-container .title-heading {
    font-size: clamp(1.25rem, 2.25vw, 1.75rem) !important;
    line-height: 1.45 !important;
}

/* Home display headings are capped without enlarging card and timeline titles. */
.home .elementor-widget-container .kerman-title,
.home .elementor-widget-container h2.text-3xl {
    font-size: clamp(1.75rem, 3vw, 2.25rem) !important;
    line-height: 1.4 !important;
}

.home .elementor-widget-container .content-title {
    font-size: clamp(1.4rem, 2vw, 1.75rem) !important;
    line-height: 1.45 !important;
}

/* Some company widgets render directly in the template, outside Elementor's wrapper. */
.single-company h1,
.single-company h2.text-4xl {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem) !important;
    line-height: 1.3 !important;
}

.single-company .main-title {
    font-size: clamp(1.5rem, 3vw, 2.25rem) !important;
    line-height: 1.4 !important;
}

.single-company .org-title h2,
.single-company .media-section .section-header h2,
.single-company .articles-section .section-header h2 {
    font-size: clamp(1.5rem, 2.5vw, 2rem) !important;
    line-height: 1.4 !important;
}

.single-company .ceo-content h3 {
    font-size: clamp(1.4rem, 2vw, 1.75rem) !important;
    line-height: 1.45 !important;
}

a{
    cursor: pointer;
}
.limit-line-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.limit-line-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.limit-line-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.limit-line-4 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.limit-line-5 {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.limit-line-6 {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.navbar-header{
    background: white;
}

/* استایل‌های منوی اصلی */
#main-menu .navbar-nav .menu-item a {
    padding-top: 32px;
    padding-bottom: 32px;
    position: relative;
}

#main-menu .menu-item-has-children {
    position: relative;
}

#main-menu .menu-item-has-children a {
    display: flex;
}

.navbar-default .nav li a {
    opacity: 1;
    margin: 0;
    padding: 0 14px;
    line-height: 1;
    transition: opacity 0.25s ease;
    font-weight: 500;
}

/* کاهش opacity برای تمام آیتم‌ها هنگام هاور روی منو */
.navbar-default .nav:hover li a {
    opacity: 0.3;
}

/* opacity کامل برای آیتم هاور شده و والد آن */
.navbar-default .nav li:hover > a,
.navbar-default .nav li.menu-item-has-children:hover > a {
    opacity: 1 !important;
}

/* opacity کامل برای تمام آیتم‌های داخل dropdown باز شده */
.navbar-default .nav li.menu-item-has-children:hover .dropdown-menu li a {
    opacity: 1 !important;
}

/* استایل dropdown */
#main-menu .dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 220px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 1000;
}

#main-menu .menu-item-has-children:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* استایل آیتم‌های dropdown */
#main-menu .dropdown-menu .menu-item > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 16px;
    color: #333;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
}

/* خط زیر آیتم‌های dropdown با انیمیشن */
#main-menu .dropdown-menu .menu-item > a::before {
    content: "";
    position: absolute;
    bottom: 3px;
    right: 16px;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

#main-menu .dropdown-menu .menu-item > a:hover::before {
    width: calc(100% - 32px);
}

#main-menu .dropdown-menu .menu-item > a:hover {
    color: #111;
    /*background-color: rgba(102, 126, 234, 0.05);*/
}

/* فلش برای آیتم‌های سطح اول که زیرمنو دارند */
#main-menu > ul > .menu-item-has-children > a::after {
    content: url('data:image/svg+xml,<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.7071 14.7071C12.3166 15.0976 11.6834 15.0976 11.2929 14.7071L6.29289 9.70711C5.90237 9.31658 5.90237 8.68342 6.29289 8.29289C6.68342 7.90237 7.31658 7.90237 7.70711 8.29289L12 12.5858L16.2929 8.29289C16.6834 7.90237 17.3166 7.90237 17.7071 8.29289C18.0976 8.68342 18.0976 9.31658 17.7071 9.70711L12.7071 14.7071Z" fill="%23000000"/></svg>');
    width: 20px;
    height: 20px;
    opacity: 0.6;
    transition: transform 0.2s ease;
    margin-right: 10px;
    display: inline-block;
}

/* فلش برای آیتم‌های داخل dropdown که زیرمنو دارند */
#main-menu .dropdown-menu .menu-item-has-children > a::after {
    content: "›";
    font-size: 18px;
    font-weight: bold;
    transition: transform 0.2s ease;
    margin-right: auto;
    padding-left: 2px;
}

/* انیمیشن فلش هنگام هاور - سطح اول */
#main-menu > ul > .menu-item-has-children:hover > a::after {
    transform: translateY(3px);
}

/* انیمیشن فلش هنگام هاور - dropdown */
#main-menu .dropdown-menu .menu-item-has-children:hover > a::after {
    transform: translateX(-3px);
}

/* زیرمنوی تو در تو */
#main-menu .dropdown-menu .menu-item-has-children > .dropdown-menu {
    top: 0;
    right: calc(100% + 10px);
    transform: translateX(10px);
}

#main-menu .dropdown-menu .menu-item-has-children:hover > .dropdown-menu {
    transform: translateX(0);
}

/* ناحیه هاور بزرگتر برای منوهای دارای فرزند */
#main-menu .menu-item-has-children::before {
    content: "";
    position: absolute;
    inset: -10px;
}

/* استایل‌های جستجو */
.main-nav-extra-content {
    display: flex;
    position: relative;
}

.topbar-search {
    display: inline-block;
    position: relative;
    z-index: 100;
}

.toggle-search {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: all 0.3s ease;
}

.toggle-search:hover {
    opacity: 0.7;
}

.topbar-search-container {
    position: absolute;
    left: 0;
    top: calc(100% + 10px);
    background-color: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 25px 98px 0 rgba(0,0,0,0.1);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease-in-out;
    min-width: 280px;
}

.topbar-search-container.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.topbar-search-container form {
    height: 40px;
    position: relative;
    display: flex;
    align-items: center;
}

.topbar-search .search-form label {
    margin-bottom: 0;
    flex: 1;
}

.topbar-search .search-form .search-field {
    background-color: #f5f5f5;
    border: none;
    border-radius: 6px;
    line-height: 40px;
    height: 40px;
    margin: 0;
    font-size: 14px;
    padding: 0 15px 0 50px;
    font-weight: 400;
    width: 100%;
    transition: all 0.2s ease;
}

.topbar-search .search-form .search-field:focus {
    outline: none;
    background-color: #ebebeb;
}

.topbar-search .search-form .search-submit {
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    height: 32px;
    width: 32px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.topbar-search .search-form .search-submit:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.chevron {
    position: absolute;
    width: 28px;
    height: 8px;
    opacity: 0;
    transform: scale3d(0.5, 0.5, 0.5);
    animation: move 3s ease-out infinite;
}

.chevron:first-child {
    animation: move 3s ease-out 1s infinite;
}

.chevron:nth-child(2) {
    animation: move 3s ease-out 2s infinite;
}

.chevron:before,
.chevron:after {
    content: ' ';
    position: absolute;
    top: 0;
    height: 100%;
    width: 51%;
    background: #fff;
}

.chevron:before {
    left: 0;
    transform: skew(0deg, 30deg);
}

.chevron:after {
    right: 0;
    width: 50%;
    transform: skew(0deg, -30deg);
}

@keyframes move {
    25% {
        opacity: 1;

    }
    33% {
        opacity: 1;
        transform: translateY(30px);
    }
    67% {
        opacity: 1;
        transform: translateY(40px);
    }
    100% {
        opacity: 0;
        transform: translateY(55px) scale3d(0.5, 0.5, 0.5);
    }
}
@keyframes pulse {
    to {
        opacity: 1;
    }
}

.border-border {
    border-color: hsl(var(--border));
}
.bg-gold {
    background-color: hsl(var(--gold));
}
.bg-primary {
    background-color: hsl(var(--primary));
}
.hover\:bg-primary\/90:hover {
    background-color: hsl(var(--primary) / 0.9);
}
.transition-colors {
    transition-property: color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, -webkit-text-decoration-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}
.ring-offset-background {
    --tw-ring-offset-color: hsl(var(--background));
}
.text-primary-foreground {
    color: hsl(var(--primary-foreground));
}
.bg-primary\/10 {
    background-color: hsl(var(--primary) / 0.1);
}
.section-padding {
    padding:4rem 1rem
}
@media (min-width: 768px) {
    .section-padding {
        padding:4rem 2rem
    }
}
.container-custom {
    margin-left: auto;
    margin-right: auto;
    max-width: 80rem;
}
.bg-foreground {
    background-color: hsl(var(--foreground));
    color: white;
}
.text-primary-foreground\/90 {
    color: hsl(var(--primary-foreground) / 0.9);
}

.topbar-search {
    position: relative;
}

.toggle-search {
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar-search-container {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    margin-top: 10px;
}

.topbar-search-container.active {
    opacity: 1;
    visibility: visible;
}

.search-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-field {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    font-size: 14px;
}

.search-field:focus {
    border-color: #25bdad;
}

.search-submit {
    background: #25bdad;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.search-submit:hover {
    background: #1da89a;
}

.search-submit svg {
    fill: white;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
