
/* ===== TEXT ALIGNMENT - Natural flow, no forced justify ===== */
/* 
   NOTE: We removed global text-align: justify because it creates 
   ugly word-spacing gaps, especially in Persian (cursive script).
   Body text now flows naturally. Only short overlay subtitles 
   use justify for better line distribution inside image boxes.
*/

/* All body text - natural alignment (left for EN, right for FA) */
body p,
.about-text p,
.contact-info-list p span,
.contact-details p span,
.address-block p span,
.step-description,
.quote-box p,
.card-item p,
.service-card p,
.ports-description p,
.port-country-ports,
.no-ports p,
.no-services p,
.footer-col p span,
.footer-desc {
    text-align: inherit;
    text-justify: none;
    -webkit-hyphens: none;
    hyphens: none;
}

/* Persian (RTL) - right-align all paragraphs for natural reading */
body[dir="rtl"] p,
body[dir="rtl"] .about-text p,
body[dir="rtl"] .contact-info-list p span,
body[dir="rtl"] .contact-details p span,
body[dir="rtl"] .step-description,
body[dir="rtl"] .quote-box p,
body[dir="rtl"] .card-item p,
body[dir="rtl"] .service-card p,
body[dir="rtl"] .ports-description p {
    text-align: right;
}

/* Overlay subtitles - gentle justify ONLY on desktop (768px+) */
/* On mobile, justify creates too much word spacing with short lines */
@media (min-width: 769px) {
    .slide-overlay-text .slide-subtitle,
    .ports-overlay-text .ports-subtitle,
    .services-overlay-text .services-subtitle {
        text-align: justify;
        text-justify: inter-word;
    }

    body[dir="rtl"] .slide-overlay-text .slide-subtitle,
    body[dir="rtl"] .ports-overlay-text .ports-subtitle,
    body[dir="rtl"] .services-overlay-text .services-subtitle {
        text-align: justify;
        text-align-last: right;
    }
}

/* On mobile: overlay subtitles align naturally */
@media (max-width: 768px) {
    .slide-overlay-text .slide-subtitle,
    .ports-overlay-text .ports-subtitle,
    .services-overlay-text .services-subtitle {
        text-align: left;
    }

    body[dir="rtl"] .slide-overlay-text .slide-subtitle,
    body[dir="rtl"] .ports-overlay-text .ports-subtitle,
    body[dir="rtl"] .services-overlay-text .services-subtitle {
        text-align: right;
    }
}

/* Headings and short labels - keep centered or left/right, NOT justified */
h1, h2, h3, h4, h5, h6,
.section-title,
.slide-title,
.ports-title,
.services-title,
.contact-info-box h3,
.contact-details h4,
.footer-col h5,
.badge-group span,
.port-name-tag,
.nav-links a,
.lang-btn,
.btn-send,
.btn-next,
.btn-view-all {
    text-align: inherit;
    text-justify: none;
    -webkit-hyphens: none;
    hyphens: none;
}

/* Hero subtitle - always centered */
.hero .subhead {
    text-align: center !important;
    text-justify: none !important;
    -webkit-hyphens: none !important;
    hyphens: none !important;
}

/* ===== iOS SAFARI FIXES ===== */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Force compositing layer to prevent iOS miscalculating container width */
.slide-image-box,
.ports-image-box,
.services-image-box {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    overflow: hidden;
    isolation: isolate;
}

/* Constrain overlay text so it never breaks out */
.slide-overlay-text,
.ports-overlay-text,
.services-overlay-text {
    max-width: calc(100% - 32px);
    left: 16px;
    right: 16px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Clamp font sizes so iOS respects bounds on first paint */
.slide-overlay-text .slide-title,
.ports-overlay-text .ports-title,
.services-overlay-text .services-title {
    font-size: clamp(1rem, 4.5vw, 1.8rem);
    line-height: 1.2;
    max-width: 100%;
}

.slide-overlay-text .slide-subtitle,
.ports-overlay-text .ports-subtitle,
.services-overlay-text .services-subtitle {
    font-size: clamp(0.8rem, 3.5vw, 1rem);
    line-height: 1.4;
    max-width: 100%;
}

/* Tighter mobile values */
@media (max-width: 768px) {
    .slide-overlay-text .slide-title,
    .ports-overlay-text .ports-title,
    .services-overlay-text .services-title {
        font-size: clamp(0.95rem, 5vw, 1.3rem);
    }

    .slide-overlay-text .slide-subtitle,
    .ports-overlay-text .ports-subtitle,
    .services-overlay-text .services-subtitle {
        font-size: clamp(0.75rem, 4vw, 0.9rem);
    }
}

@media (max-width: 480px) {
    .slide-overlay-text .slide-title,
    .ports-overlay-text .ports-title,
    .services-overlay-text .services-title {
        font-size: clamp(0.85rem, 5.5vw, 1.1rem);
    }

    .slide-overlay-text .slide-subtitle,
    .ports-overlay-text .ports-subtitle,
    .services-overlay-text .services-subtitle {
        font-size: clamp(0.7rem, 4.5vw, 0.8rem);
    }

    .slide-image-box,
    .ports-image-box,
    .services-image-box {
        height: 160px;
    }
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    color: #1e293b;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: transparent !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== NAVBAR ===== */
.navbar {
    color: white;
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 700;
}

.logo span {
    font-weight: 300;
    color: #aac9f0;
}

.logo small {
    color: #9bbad4;
    font-size: 0.7rem;
    display: block;
}

.nav-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.nav-links a {
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: 0.2s;
    color: #d4e3f0;
}

.nav-links a:hover,
.nav-links a.active {
    background: #1f4b6e;
    color: white;
}

.lang-switch {
    display: flex;
    gap: 6px;
}

.lang-btn {
    background: transparent;
    border: 1px solid #3b5f7a;
    color: #d4e3f0;
    padding: 4px 14px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

.lang-btn.active {
    background: #2a6b9c;
    border-color: #2a6b9c;
    color: white;
}

.lang-btn:hover {
    background: #1f4b6e;
    border-color: #1f4b6e;
    color: white;
}

/* ===== HERO ===== */
.hero {
    background: transparent !important;
    padding: 50px 0 40px;
    border-radius: 0 0 40px 40px;
    margin-bottom: 10px;
}

.hero-content {
    text-align: center;
}

.hero h2 {
    font-size: 2.4rem;
    font-weight: 700;
    color: #0a283f;
}

.hero .subhead {
    font-size: 1.15rem;
    color: #2a4a66;
    max-width: 650px;
    margin: 6px auto;
}

.hero .tagline {
    font-size: 0.95rem;
    color: #2f5370;
    background: rgba(255,255,255,0.7);
    padding: 6px 28px;
    border-radius: 40px;
    display: inline-block;
    backdrop-filter: blur(2px);
    margin-top: 10px;
}

/* ===== SECTION TITLE ===== */
.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 30px 0 24px;
    color: #0b2a4a;
    border-left: 6px solid #2a6b9c;
    padding-left: 18px;
}

.section-title i {
    margin-right: 12px;
}

/* ===== SERVICE GRID ===== */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin: 20px 0 30px;
}

/* Service card styles are now controlled by PHP in header.php */
.service-card {
    padding: 24px 16px 20px;
    border-radius: 24px;
    box-shadow: 0 6px 20px rgba(0, 20, 40, 0.05);
    text-align: center;
    transition: 0.25s;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 20, 40, 0.1);
}

.service-card i {
    font-size: 2.4rem;
    margin-bottom: 10px;
}

.service-card h3 {
    font-size: 1.15rem;
    margin-bottom: 4px;
    color: #0b2a4a;
}

.service-card p {
    color: #334e6a;
    font-size: 0.9rem;
}

/* ===== ABOUT PAGE ===== */
.about-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 36px;
    margin: 20px 0;
}

.about-text {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 24px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.about-text p {
    margin-bottom: 16px;
    font-size: 1.02rem;
}

.badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.badge-group span {
    background: rgba(220, 233, 245, 0.8);
    padding: 6px 18px;
    border-radius: 40px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(5px);
}

.map-wrapper {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    border: 1px solid rgba(255, 255, 255, 0.3);
    height: 320px;
}

.map-wrapper iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* ===== CONTACT ===== */
.contact-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 20px 0;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(212, 224, 235, 0.5);
    border-radius: 16px;
    font-size: 1rem;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    transition: 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: #2a6b9c;
    outline: none;
    box-shadow: 0 0 0 3px rgba(42,107,156,0.1);
}

.contact-form button {
    background: #0b2a4a;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.contact-form button:hover {
    background: #1f4b6e;
}

.contact-info-box {
    border-radius: 24px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.contact-info-box h3 {
    margin-bottom: 16px;
}

.contact-info-box p {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 12px 0;
}

.contact-info-box i {
    width: 30px;
}

/* ===== ADDRESS BLOCK ===== */
.address-block {
    border-radius: 24px;
    padding: 24px;
    margin-top: 20px;
    border-left: 4px solid #2a6b9c;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.address-block p {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 8px 0;
}

.address-block i {
    width: 28px;
}

.contact-details {
    border-radius: 24px;
    padding: 24px;
    margin-top: 20px;
    border-left: 4px solid #2a6b9c;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.contact-details p {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 8px 0;
}

.contact-details i {
    width: 28px;
}

/* ===== FOOTER ===== */
.footer {
    background: #0b1f31;
    color: #cbdae8;
    padding: 28px 0 20px;
    margin-top: auto;
    border-top: 1px solid #1d3b53;
}

.footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.footer small {
    color: #8aa3bb;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 820px) {
    .about-grid {
        grid-template-columns: 1fr;
    }
    .contact-row {
        grid-template-columns: 1fr;
    }
    .map-wrapper {
        height: 240px;
    }
    .navbar .container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .nav-links {
        justify-content: center;
    }
    .lang-switch {
        justify-content: center;
    }
    .hero h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .grid-4 {
        grid-template-columns: 1fr 1fr;
    }
    .logo h1 {
        font-size: 1.2rem;
    }
}

/* ===== PERSIAN (RTL) ===== */
body[dir="rtl"] .section-title {
    border-left: none;
    border-right: 6px solid var(--secondary);
    padding-left: 0;
    padding-right: 18px;
}

body[dir="rtl"] .section-title i {
    margin-right: 0;
    margin-left: 12px;
}

body[dir="rtl"] .address-block p,
body[dir="rtl"] .contact-details p,
body[dir="rtl"] .contact-info-box p {
    flex-direction: row-reverse;
}

body[dir="rtl"] .badge-group span {
    flex-direction: row-reverse;
}

body[dir="rtl"] .navbar .container {
    flex-direction: row-reverse;
}

/* Phone Row - Side by side like Name/Last Name */
.phone-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 10px;
    width: 100%;
}

.full-width {
    width: 100%;
}

.country-code-select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid rgba(212, 224, 235, 0.5);
    border-radius: 10px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    transition: 0.2s;
    color: #1e293b;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.country-code-select:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(42,107,156,0.1);
}

.phone-number-input {
    width: 100%;
    padding: 11px 15px;
    border: 1px solid rgba(212, 224, 235, 0.5);
    border-radius: 10px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    transition: 0.2s;
    color: #1e293b;
    direction: ltr;
}

.phone-number-input:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(42,107,156,0.1);
    background: rgba(255, 255, 255, 0.95);
}