@import "../common/mobile-cta.css";
@import "../common/sticky-call.css";

@font-face {
    font-family: 'TehranPlumber-font';
    src: url('/common/fonts/TehranPlumber-font.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

:root {
    --header-height: 0;
    /* Responsive typography scale */
    --font-step-0: clamp(1rem, 0.5vw + 0.875rem, 1.125rem);
    --font-step-1: clamp(1.25rem, 1vw + 1rem, 1.5rem);
    --font-step-2: clamp(1.5rem, 2vw + 1rem, 2.25rem);
    --font-step-3: clamp(2rem, 3vw + 1.5rem, 3rem);

    /* Spacing scale */
    --space-1: clamp(0.25rem, 0.5vw, 0.5rem);
    --space-2: clamp(0.5rem, 1vw, 1rem);
    --space-3: clamp(0.75rem, 1.5vw, 1.5rem);
    --space-4: clamp(1rem, 2vw, 2rem);
    --space-5: clamp(1.5rem, 3vw, 3rem);
    --space-6: clamp(2rem, 4vw, 4rem);
    --space-7: clamp(3rem, 6vw, 6rem);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html { font-size: 100%; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'TehranPlumber-font', 'Vazirmatn', sans-serif;
}

html {
    /* Prevent horizontal scrolling on mobile */
    overflow-x: hidden;
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

:where([id]) {
    scroll-margin-block-start: var(--header-height);
}

section,
h1,
h2,
h3,
h4,
h5,
h6 {
    scroll-margin-top: var(--header-height);
}

img {
    max-width: 100%;
    height: auto;
}

body {
    font-family: 'TehranPlumber-font', Vazirmatn, sans-serif;
    font-size: var(--font-step-0);
    margin: 0;
    background: var(--bg);
    color: var(--text);
    text-align: right;
    direction: rtl;
    padding-top: var(--header-height);
    padding-bottom: env(safe-area-inset-bottom);
    overflow-x: hidden;
}

main {
    padding-bottom: env(safe-area-inset-bottom);
}

p {
    font-size: var(--font-step-0);
    line-height: 1.7;
    max-width: 75ch;
    margin-inline-start: auto;
    margin-inline-end: auto;
    overflow-wrap: anywhere;
}

td,
th {
    overflow-wrap: anywhere;
}

button,
input {
    font-size: var(--font-step-0);
    padding-block: var(--space-2);
    padding-inline: var(--space-3);
}

@media (max-width: 480px) {
    button:not(.sticky-hamburger):not(.theme-toggle),
    input,
    label {
        width: 100%;
    }
}

a[class*="btn"],
button[class*="btn"] {
    border: 1px solid rgba(255, 0, 0, 0.6);
    box-shadow: 0 0 4px rgba(255, 0, 0, 0.4);
    animation: redGlowPulse 3s ease-in-out infinite;
}

.cta-btn {
    background: var(--accent);
    color: var(--bg);
    padding: var(--space-2) var(--space-4);
    border-radius: 8px;
    font-weight: 700;
    font-size: var(--font-step-1);
    box-shadow: 0 0 12px rgba(255, 196, 44, 0.65);
}

/* generic call-to-action link used in hero sections */
.cta {
    margin-top: var(--space-5);
    display: inline-block;
}

.phone-btn {
    width: 180px;
    height: 48px;
    background: var(--accent);
    color: var(--bg);
    font-weight: 700;
    font-size: var(--font-step-0);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 6px;
    box-shadow: 0 0 12px rgba(255, 196, 44, 0.65);
    margin-inline-start: var(--space-6);
}

.container {
    max-width: clamp(320px, 92vw, 1280px);
    margin-inline: auto;
}

.hero {
    position: relative;
    padding-block: 0 var(--space-7);
    padding-inline: var(--space-4);
    text-align: center;
    min-block-size: 100svh;
    min-block-size: calc(100svh - var(--header-height));
}

.hero picture {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero picture img,
.hero video {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.hero h1 {
    font-size: var(--font-step-3);
    font-weight: 700;
    margin-bottom: var(--space-4);
}

.hero p {
    font-size: var(--font-step-0);
    margin-bottom: var(--space-3);
}

.hero ul {
    list-style: none;
    padding: 0;
}

.hero ul li {
    margin: 0 0;
}

.section {
    padding: var(--space-6) var(--space-4);
}

.districts {
    padding: var(--space-6) var(--space-4);
}

.section h2 {
    font-size: var(--font-step-2);
    margin-bottom: var(--space-3);
    text-align: center;
}

.services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-6);
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--space-5);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 2px var(--card-ring);
    color: var(--text);
}

.locations {
    display: grid;
    /* Responsive columns that adapt with available space */
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-4);
}

.district h3 {
    margin: var(--space-2) 0;
    font-size: var(--font-step-1);
    font-weight: bold;
}

.district h3 a {
    font-size: inherit;
    color: inherit;
}

.district ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.district a {
    color: var(--primary);
    text-decoration: none;
    font-size: var(--font-step-0);
}

.locations a {
    color: var(--primary);
    text-decoration: none;
    display: block;
    margin: var(--space-1) 0;
    font-size: var(--font-step-0);
}

footer {
    /*background: var(--card-bg) url('./images/tehranplumber-footer-background-wave.webp') center bottom no-repeat;*/
    background-size: cover;
    padding: var(--space-6);
    color: var(--text);
    font-size: var(--font-step-0);
    text-align: center;
}

@media (max-width: 600px) {
    .hero {
        padding: var(--space-7) var(--space-4);
    }

    .hero h1 {
        font-size: var(--font-step-3);
    }

    .cta-btn {
        padding: var(--space-2) var(--space-4);
    }
}

@media (max-width: 768px) {
    .section {
        padding: var(--space-6) var(--space-4);
    }

    .districts {
        padding: var(--space-6) var(--space-4);
    }

    .services {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: var(--space-4);
    }

    .card h3 {
        font-size: var(--font-step-1);
    }
}


@media (max-width: 768px) {
    body {
        padding-bottom: calc(var(--space-7) + var(--space-5) + env(safe-area-inset-bottom));
    }

    main {
        padding-bottom: calc(var(--space-7) + var(--space-5) + env(safe-area-inset-bottom));
    }
}

.to-top {
    position: fixed;
    bottom: var(--space-5);
    inset-inline-end: var(--space-5);
    padding: var(--space-2);
    min-block-size: 44px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--text);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    z-index: 1100;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.to-top.visible {
    display: flex;
}

/* Align FAQ paragraphs with questions and enlarge question headings */
#faq p,
.faq-pricing p {
    margin-inline-end: 0;
    margin-inline-start: 0;
    max-width: none;
    /* Indent answers with eight characters */
    text-indent: 4ch;
    /* Reduce distance from question to answer by 25% */
    margin-top: 0.75em;
    font-size: var(--font-step-0);
}

#faq h3 {
    font-size: var(--font-step-1);
    margin-bottom: 0.75em;
}

/* Phone icon attention animation */
@keyframes phone-shake {
    0%, 100% {
        transform: rotate(0);
    }
    20%, 60% {
        transform: rotate(-15deg);
    }
    40%, 80% {
        transform: rotate(15deg);
    }
}

.phone-shake {
    display: inline-block;
    animation: phone-shake 0.6s ease;
}

/* ensure tel icons inline-block */
a[href^="tel"] span[aria-hidden="true"] {
    display: inline-block;
}


/* Gradient text animation */
.gradient-animate {
    background-image: linear-gradient(90deg, #007aff, #af52de, #ff3b30, #ffcc00, #34c759, #007aff);
    background-size: 300% 100%;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    color: transparent !important;
    display: inline-block;
    animation: gradientFlow 5s linear infinite;
}

html:not(.theme-dark) .gradient-animate {
    background-image: linear-gradient(90deg, #0051a8, #8135c7, #d32b2f, #e6a700, #2aa34b, #0051a8);
}

@keyframes gradientFlow {
    0% {
        background-position: 0 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.blink {
    animation: blink 1s linear infinite;
}

.bg-card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    margin-top: var(--space-6);
    padding: var(--space-7) var(--space-3);
    color: var(--text);
}

html:not(.theme-dark) .bg-card {
    color: var(--text);
}

.bg-white {
    background: #fff;
    color: var(--text);
}

.white-title {
    color: var(--text);
}

/* simple wrapper for prominent CTA buttons */
.cta-container {
    text-align: center;
    margin-top: var(--space-6);
}

.cta-glow {
    box-shadow: 0 0 12px rgba(0, 153, 255, 0.6), 0 0 24px rgba(0, 153, 255, 0.4);
    animation: water-glow 3s ease-in-out infinite;
}

@keyframes water-glow {
    0%, 100% {
        box-shadow: 0 0 12px rgba(0, 153, 255, 0.6), 0 0 24px rgba(0, 153, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 153, 255, 0.9), 0 0 40px rgba(0, 153, 255, 0.6);
    }
}

.wave-gradient {
    background-image: linear-gradient(90deg, #0af, #6cf, #0af);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    display: inline-block;
    animation: waveGradient 4s linear infinite;
}

@keyframes gradientRipple {
    0% {
        background-position: 0 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

@keyframes warmGlow {
    0%, 100% {
        box-shadow: 0 0 8px rgba(255, 224, 0, 0.4), 0 0 20px rgba(255, 0, 0, 0.25);
    }
    50% {
        box-shadow: 0 0 16px rgba(255, 224, 0, 0.8), 0 0 32px rgba(255, 0, 0, 0.5);
    }
}

.footer-cta {
    animation: warmGlow 3s ease-in-out infinite;
}

@keyframes redGlowPulse {
    0%, 100% {
        box-shadow: 0 0 4px rgba(255, 0, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 12px rgba(255, 0, 0, 0.8);
    }
}

/* combine gradient flow with wave motion */
.gradient-wavy {
    background-image: linear-gradient(90deg, #007aff, #af52de, #ff3b30, #ffcc00, #34c759, #007aff);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    animation: gradientFlow 5s linear infinite, waveGradient 6s linear infinite;
}

.wave-title {
    font-size: var(--font-step-3);
    text-align: center;
}

html:not(.theme-dark) .gradient-wavy {
    background-image: linear-gradient(90deg, #0051a8, #8135c7, #d32b2f, #e6a700, #2aa34b, #0051a8);
}

@keyframes waveGradient {
    0% {
        background-position: 0 50%;
    }
    100% {
        background-position: -200% 50%;
    }
}

.related-neighborhoods, .other-regions {
    padding: var(--space-7) var(--space-6);
}

.related-neighborhoods h2,
.other-regions h2 {
    text-align: center;
    font-size: var(--font-step-2);
    margin-bottom: var(--space-5);
}

.neighborhood-grid,
.other-regions .region-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    max-width: 900px;
    margin: 0 auto;
}

.neighborhood-card,
.region-card {
    display: block;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--space-4) var(--space-4);
    text-align: center;
    text-decoration: none;
    color: var(--text);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15), 0 0 0 2px var(--card-ring);
    transition: .25s;
}

.neighborhood-card:hover,
.region-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

@media (max-width: 768px) {
    .neighborhood-grid,
    .other-regions .region-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .neighborhood-grid,
    .other-regions .region-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero .btn-primary {
        white-space: nowrap;
        font-size: var(--font-step-1);
        padding: calc(var(--space-2) + var(--space-1)) var(--space-4);
    }
}

@media (max-width: 300px) {
    .services,
    .locations,
    .neighborhood-grid,
    .other-regions .region-grid {
        grid-template-columns: 1fr;
    }

    .card,
    .neighborhood-card,
    .region-card {
        padding: var(--space-3);
    }

    .card h3,
    .neighborhood-card h3,
    .region-card h3 {
        font-size: 1rem;
        overflow-wrap: anywhere;
    }

    .card p,
    .neighborhood-card p,
    .region-card p {
        font-size: 0.875rem;
        overflow-wrap: anywhere;
    }
}
