/* ---------------------------------------------------------------------------
   Contact page (contact.jsp).

   Loaded after index.css / public-polish.css, so it uses that token family
   (--bg-primary, --card-bg, --text-*, --accent-*, --polish-*).
--------------------------------------------------------------------------- */

.contact-hero {
    position: relative;
    background: var(--polish-hero-grad, linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)));
    color: #fff;
    padding: 7rem 0 8rem;
    text-align: center;
    overflow: hidden;
}

.contact-hero-content {
    max-width: 760px;
    margin: 0 auto;
}

.contact-title {
    font-size: clamp(2.4rem, 6vw, 4.4rem);
    font-weight: 800;
    margin: 1rem 0 1rem;
}

.contact-subtitle {
    font-size: 1.18rem;
    opacity: 0.94;
    max-width: 620px;
    margin: 0 auto;
}

.contact-section {
    padding: 5rem 0;
    background: var(--bg-primary);
}

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: stretch;
}

.contact-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--polish-radius-md, 16px);
    box-shadow: var(--polish-shadow-lg, 0 14px 38px var(--shadow));
    padding: 2rem;
}

.contact-panel-heading {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.contact-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 1.15rem;
}

/* The dark palette's accent is a light teal — white on it fails contrast, so
   punch the glyph out in the page background colour instead. */
[data-theme="dark"] .contact-icon {
    color: var(--bg-primary);
}

.contact-panel h2 {
    font-size: 1.45rem;
    margin: 0 0 0.4rem;
    color: var(--text-primary);
    letter-spacing: 0;
}

.contact-panel p,
.contact-panel address {
    color: var(--text-secondary);
    margin: 0;
    font-style: normal;
    line-height: 1.75;
}

.contact-phone {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--accent-primary);
    text-decoration: none;
    font-size: clamp(1.55rem, 4vw, 2.45rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
    /* Keeps the tap target at 44px even at the smallest clamp step. */
    min-height: 2.75rem;
    /* Marked dir="ltr" in the markup: isolate it so a surrounding Persian
       sentence can never reorder the digits. */
    unicode-bidi: isolate;
    transition: color 0.2s ease;
}

.contact-phone:hover {
    color: var(--accent-secondary);
}

.contact-social-wrap {
    margin-top: 4rem;
}

.contact-social-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.contact-social-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 3.5rem;
    padding: 0.85rem 1.1rem;
    border-radius: var(--polish-radius-md, 12px);
    background: var(--card-bg);
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.contact-social-card i {
    font-size: 2rem;
}

.contact-social-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
}

.telegram-card:hover {
    color: #229ed9;
}

.instagram-card:hover {
    color: #e1306c;
}

.linkedin-card:hover {
    color: #0a66c2;
}

/* Brand blues/pinks go muddy on the dark card surface; use the same lifted
   tints public-polish.css uses for the footer social icons. */
[data-theme="dark"] .telegram-card:hover,
[data-theme="dark"] .linkedin-card:hover {
    color: #6db8ff;
}

[data-theme="dark"] .instagram-card:hover {
    color: #ff8fb1;
}

/* --- RTL / Persian typography -------------------------------------------
   `flex-direction: row-reverse` used to be applied here, which double-flips
   an already-mirrored row and pushed the icons back to the LTR side. Rows
   mirror themselves under dir="rtl"; only the type details need help.
------------------------------------------------------------------------- */

[dir="rtl"] .contact-title,
[dir="rtl"] .contact-panel h2 {
    letter-spacing: normal;
}

[dir="rtl"] .contact-panel p,
[dir="rtl"] .contact-panel address,
[dir="rtl"] .contact-subtitle {
    line-height: 2;
}

@media (max-width: 800px) {
    .contact-hero {
        padding: 5rem 0 6.5rem;
    }

    .contact-section {
        padding: 3.5rem 0;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    /* Two up still fits comfortably on a tablet; one up wastes the row. */
    .contact-social-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .contact-panel {
        padding: 1.4rem;
    }

    .contact-panel-heading {
        flex-direction: column;
    }

    .contact-social-grid {
        grid-template-columns: 1fr;
    }

    .contact-social-card {
        min-height: 104px;
    }
}
