/* ==========================================================================
   IMPORTS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Montserrat:wght@600;700&display=swap');

/* ==========================================================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ========================================================================== */

:root {
    /* Colors - Primary Palette */
    --primary-color: #1F4B4B;
    --primary-dark: #133737;
    --secondary-color: #C77D2E;
    --secondary-dark: #9A5B20;
    --accent: #E07A5F;

    /* Colors - Text & Background */
    --text-color: #0F1722;
    --text-light: #6B7280;
    --background-color: #FFFFFF;
    --surface: #F7F4EF;
    --white: #FFFFFF;

    /* Colors - Borders & Shadows */
    --border-color: #ECE8E1;
    --shadow: 0 2px 10px rgba(16, 24, 40, 0.06);
    --shadow-hover: 0 6px 30px rgba(16, 24, 40, 0.08);

    /* Colors - Overlays */
    --overlay-white-95: rgba(255, 255, 255, 0.95);
    --overlay-white-85: rgba(255, 255, 255, 0.85);
    --overlay-white-70: rgba(255, 255, 255, 0.7);
    --overlay-black-95: rgba(0, 0, 0, 0.95);
    --overlay-black-60: rgba(0, 0, 0, 0.6);

    /* Spacing */
    --section-padding: 3rem 0;
    --container-max-width: 1200px;
    --container-padding: 0 20px;

    /* Typography */
    --font-family-body: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-family-heading: 'Montserrat', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;

    /* Transitions */
    --transition-base: 0.3s ease;
    --transition-fast: 0.15s ease;
    --header-fade-duration: 240ms;

    /* Header */
    --header-bg: rgba(247, 244, 239, 0.98);
}


/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-body);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--surface);
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    font-weight: 600;
}

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

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

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--container-padding);
}

section {
    padding: var(--section-padding);
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

:focus-visible {
    outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    box-shadow: 0 0 0 4px rgba(47, 67, 90, 0.12);
    border-radius: 6px;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */

header {
    background-color: var(--header-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color var(--header-fade-duration) ease, 
                box-shadow var(--header-fade-duration) ease, 
                color var(--header-fade-duration) ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

/* Logo */
.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    transition: color var(--header-fade-duration) ease;
}

.logo span {
    color: var(--secondary-color);
}

/* Navigation Links */
.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color var(--transition-base), 
                color var(--transition-base);
    color: var(--text-color);
}

/* Dropdown Menu */
.nav-links .dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    border-radius: 6px;
    padding: 0.25rem 0;
    min-width: 180px;
    z-index: 1100;
    border: 1px solid var(--border-color);
}

.nav-links .dropdown li {
    list-style: none;
}

.nav-links .dropdown a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-color);
    transition: background-color var(--transition-base), color var(--transition-base);
}

.nav-links .dropdown a:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* When menu is open, links should be readable on the white background */
.nav-links.active a {
    color: var(--text-color);
}

/* Only open dropdowns when their parent has been toggled open */
.nav-links li.has-dropdown.open > .dropdown {
    display: block;
}

.nav-links li.has-dropdown:hover > .dropdown {
    display: block;
}

.nav-links li.has-dropdown > a::after {
    content: '▾';
    margin-left: 0.4rem;
    font-size: 0.8rem;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    transition: all var(--transition-base), 
                background-color var(--header-fade-duration) ease;
}

/* ==========================================================================
   HEADER VARIANTS (Page-Specific Styles)
   ========================================================================== */

/* Overlay Header (Homepage & Gallery) */
body.home header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background-color: transparent;
    box-shadow: none;
    z-index: 1000;
}

body.home .logo,
body.gallery .logo {
    color: var(--white);
}

body.home .nav-links a,
body.gallery .nav-links a {
    color: var(--overlay-white-95);
}

body.home .hamburger span,
body.gallery .hamburger span {
    background-color: var(--white);
}

/* Dropdown Override for Overlay Headers */
body.home .nav-links .dropdown a,
body.gallery .nav-links .dropdown a,
body.services-page.has-hero .nav-links .dropdown a {
    color: var(--text-color);
}

/* When header is overlayed (homepage/gallery/services with hero),
   ensure hovered dropdown items use the same hover treatment as main nav */
/* Hover styling for dropdown items is handled globally below to avoid duplicates. */

/* Services Page Header */
body.services-page header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: none;
    z-index: 1000;
}

body.services-page .logo {
    color: var(--primary-color);
}

body.services-page .nav-links a {
    color: var(--text-color);
}

body.services-page .hamburger span {
    background-color: var(--primary-color);
}

/* Services Page with Hero */
body.services-page.has-hero .nav-links a {
    color: var(--overlay-white-95);
}

body.services-page.has-hero .logo {
    color: var(--white);
}

body.services-page.has-hero .hamburger span {
    background-color: var(--white);
}

/* ==========================================================================
   HERO SECTIONS
   ========================================================================== */

/* Base Hero Styles */
.hero,
.page-hero {
    position: relative;
    color: var(--white);
    display: flex;
    align-items: center;
    padding: 0;
    text-align: center;
    overflow: hidden;
}

.hero {
    min-height: 110vh;
    justify-content: center;
}

.page-hero {
    min-height: 64vh;
    padding: 3rem 0;
    text-align: left;
}

.hero > .container,
.page-hero > .container {
    position: relative;
    z-index: 2;
}

/* Hero Typography */
.hero h1,
.page-hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
    animation: fadeInUp 0.8s ease;
}

body.home .hero h1 {
    text-shadow: 0 5px 14px rgba(0, 0, 0, 0.32);
}

.hero p,
.page-hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.hero p {
    max-width: 600px;
    margin: 0 auto 2rem;
    animation: fadeInUp 0.8s ease 0.2s both;
}

/* Hero Backgrounds */
.home-photo-background,
.services-photo-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
    z-index: 0;
    pointer-events: none;
}

.home-photo-background {
    background-image: url('../zillow_images/zillow_images_1812/image-1_front.jpg');
}

.services-photo-background {
    background-image: url('../zillow_images/zillow_images_1812/image-12.jpg');
    background-position: center 20%;
}

/* Hero Overlays */
body.home .hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.08) 50%, rgba(0, 0, 0, 0.18) 100%);
    z-index: 1;
    pointer-events: none;
}

.page-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 1;
}

.home-photo-background::after,
.services-photo-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 58, 33, 0.3);
    z-index: 1;
    opacity: 0;
    transition: opacity 320ms ease, backdrop-filter 320ms ease;
}

/* Scroll Effects */
.home .home-photo-background {
    transition: filter 360ms ease, opacity 360ms ease;
}

.home.scrolled .home-photo-background {
    filter: brightness(0.86) saturate(0.95);
}

.home.scrolled .home-photo-background::after {
    opacity: 0.45;
}

.home .about {
    transition: padding-top 320ms ease, transform 320ms ease;
}

.home.scrolled .about {
    padding-top: 2rem;
}

/* Hero Buttons */
.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.4s both;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    width: 100%;
    max-width: 280px;
    text-align: center;
}

.btn-primary {
    background-color: var(--secondary-dark);
    color: var(--white);
    margin-top: 1.5rem;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-secondary:hover {
    background-color: var(--white);
    color: var(--primary-color);
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */

.section-title {
    text-align: left;
    padding-left: 2rem;
    padding-top: 1rem;
    margin-bottom: 0;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.section-title p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 3rem 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-header h1 {
    color: var(--accent);
    font-size: 2.5rem;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.page-header p {
    opacity: 0.9;
    font-size: 1.1rem;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.page-header .container.contact-header-container,
.contact-info-section .container.contact-container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.contact-header-container h4,
.contact-header-container {
    color: var(--secondary-color);
}

/* ==========================================================================
   SERVICE SECTIONS
   ========================================================================== */

/* Service Tabs */
.service-tabs {
    margin-top: 1rem;
    padding: 2rem;
}

.tabs-bar {
    display: flex;
    gap: 0.5rem;
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    width: 100vw;
    box-sizing: border-box;
}

.tabs-bar .container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0.5rem 0.5rem 0 0.5rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 1rem 1rem 1.5rem 1rem;
    border-radius: 8px 8px 0 0;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-color);
    cursor: pointer;
    transition: background 180ms ease, color 180ms ease, transform 120ms ease;
}

.tab-btn:hover {
    transform: translateY(-2px);
}

.tab-btn.active,
.tab-btn[aria-selected="true"] {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
}

.tabs-panels {
    background: transparent;
}

.tab-panel {
    display: block;
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

.tab-panel.active {
    opacity: 1;
}

.tab-panel[hidden] {
    display: none;
}

/* Service Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem;
}

.services .services-grid {
    grid-template-columns: repeat(2, 1fr);
}

/* Service Cards */
.service-card {
    background: var(--white);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: var(--shadow);
    text-align: left;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    position: relative;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.service-card h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.service-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Service Carousel */
.service-carousel {
    position: relative;
    width: 100%;
    height: 340px;
    overflow: hidden;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.service-carousel .carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.35s ease;
}

.service-carousel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
    cursor: pointer;
}

/* Carousel Controls */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

/* Carousel Caption */
.caption-overlay {
    position: absolute;
    left: 0;
    bottom: 12px;
    background: rgba(0, 0, 0, 0.5);
    color: var(--white);
    padding: 8px 12px 8px 10px;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 0 12px 12px 0;
    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.24);
    max-width: 72%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    z-index: 4;
}

/* Zoom Button */
.zoom-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--white);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    border: none;
    cursor: zoom-in;
    z-index: 6;
    transition: transform 0.12s ease, background 0.12s ease;
}

.zoom-btn:hover {
    transform: scale(1.06);
    background: rgba(0, 0, 0, 0.72);
}

.zoom-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--white);
    stroke-width: 1.6;
    fill: none;
}

.zoom-btn::after {
    content: '';
    position: absolute;
    right: 46px;
    top: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.zoom-btn:hover::after {
    content: 'View gallery';
    opacity: 1;
    transform: translateY(0);
}

.service-intro-text {
    color: var(--text-color);
    font-size: 1.1rem;
    padding-left: 3rem;
    padding-right: 3rem;
}

/* ==========================================================================
   ABOUT SECTION
   ========================================================================== */

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.about-text p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.about-features {
    list-style: none;
}

.about-features li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.about-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
}

.about-image {
    position: relative;
    overflow: visible;
}

.about-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.about-image-placeholder {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    aspect-ratio: 3/2;
    width: 100%;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.25rem;
}

/* ==========================================================================
   CONTACT SECTION
   ========================================================================== */

.contact-info-section,
.contact {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.contact {
    padding: 1.5rem 1.25rem;
    background: linear-gradient(180deg, rgba(247, 244, 239, 0.4), rgba(255, 255, 255, 0));
}

.contact-info {
    text-align: left;
    /* padding: 2rem; */
    max-width: 920px;
    margin: 0 auto;
}

.contact-info h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.contact-info p {
    color: var(--text-light);
}

.contact-details {
    list-style: none;
}

.contact-details li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.contact-details li:last-child {
    border-bottom: none;
}

/* Contact Form */
.contact-form {
    max-width: 820px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(16, 24, 40, 0.06);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
}

.contact-form h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.contact-form form {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr;
}

.contact-form .form-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 0.75rem;
    align-items: center;
}

.contact-form .form-row.full {
    grid-template-columns: 1fr;
    align-items: start;
}

.contact-form .form-row.full label,
.contact-form .form-row.full textarea,
.contact-form .form-row.full .btn {
    grid-column: 1 / -1;
}

.contact-form label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-color);
    background: var(--white);
    transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 6px 18px rgba(31, 75, 75, 0.08);
}

.contact-form .btn {
    grid-column: 1 / -1;
    justify-self: start;
    padding: 0.9rem 1.4rem;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    border: none;
    cursor: pointer;
    font-weight: 700;
    box-shadow: var(--shadow-hover);
    transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.contact-form .btn:hover {
    transform: translateY(-2px);
    opacity: 0.98;
}

.contact-container .contact-info {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

footer {
    background-color: var(--primary-dark);
    color: var(--white);
    padding: 2rem 0 1.5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.footer-section p,
.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.footer-section a:hover {
    color: var(--secondary-color);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    padding: 0.3rem 0;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ==========================================================================
   LIGHTBOX
   ========================================================================== */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80%;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
}

.lightbox-placeholder {
    width: 80vw;
    max-width: 800px;
    height: 60vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--white);
    gap: 1rem;
}

.lightbox-placeholder span {
    font-size: 5rem;
}

.lightbox-placeholder p {
    font-size: 1.25rem;
    opacity: 0.9;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2.5rem;
    color: var(--white);
    background: transparent;
    border: transparent;
    cursor: pointer;
    z-index: 2001;
    transition: color var(--transition-base);
}

.lightbox-close:hover {
    color: var(--secondary-color);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    background: transparent;
    border: transparent;
    color: var(--white);
    cursor: pointer;
    padding: 1rem;
    z-index: 2001;
    transition: color var(--transition-base);
}

.lightbox-nav:hover {
    color: var(--secondary-color);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-counter {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

/* Mobile (600px and below) */
@media (max-width: 600px) {
    .caption-overlay {
        bottom: 8px;
        padding: 6px 10px 6px 8px;
        font-size: 0.9rem;
    }

    .zoom-btn {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
    }

    .zoom-btn svg {
        width: 16px;
        height: 16px;
    }

    .home-photo-background,
    .services-photo-background {
        background-position: center top;
        background-size: cover;
    }

    body.home .about-content {
        grid-template-columns: 1fr;
    }

    body.home .about-text {
        order: 0;
    }

    body.home .about-image {
        order: 1;
    }

    .hero {
        min-height: 48vh;
    }

    .page-hero {
        min-height: 38vh;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .hero h1,
    .page-hero h1 {
        font-size: 1.6rem;
        line-height: 1.15;
        margin-bottom: 0.6rem;
    }

    .hero p,
    .page-hero p {
        font-size: 0.95rem;
        max-width: 100%;
        margin-bottom: 1rem;
    }
}

/* Tablet (768px and below) */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background-color: var(--white);
        flex-direction: column;
        align-items: center;
        padding: 2rem;
        gap: 1rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-base);
        box-shadow: var(--shadow);
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

     /* Mobile hover/active visuals are handled by the global hover/active
         rule further down to keep styling consistent and avoid duplication. */

    .nav-links .dropdown {
        position: static;
        display: none;
        box-shadow: none;
        background: transparent;
        padding: 0;
    }

    /* On mobile, only show a dropdown when its parent li has the `.open` class.
       Avoid automatically expanding every dropdown when the menu opens. */
    .nav-links li.has-dropdown.open > .dropdown {
        display: block;
    }

    .nav-links .dropdown a {
        padding-left: 2rem;
    }

    /* When the mobile menu is open, always use readable (dark) link text
       because the mobile menu background is white. This prevents white-on-white
       text on overlay pages (home/gallery/services with hero). */
    body.home .nav-links.active a,
    body.gallery .nav-links.active a,
    body.services-page.has-hero .nav-links.active a {
        color: var(--text-color);
    }

    /* Ensure hovered or selected nav items (including dropdown children)
       display white text on primary background everywhere. This should
       override the default link color but not the non-hover state. */
    .nav-links a:hover,
    .nav-links a.active,
    .nav-links .dropdown a:hover,
    .nav-links .dropdown a.active {
        background-color: var(--primary-color);
        color: var(--white);
    }

    /* Also cover :active and focus states so taps on mobile show white-on-primary */
    .nav-links a:active,
    .nav-links a:focus,
    .nav-links a:focus-visible,
    .nav-links .dropdown a:active,
    .nav-links .dropdown a:focus {
        background-color: var(--primary-color);
        color: var(--white);
    }

    /* Highly specific overrides for overlay pages when the mobile menu is open.
       This ensures the open mobile menu on the home/gallery/services pages
       shows the same highlighted (white-on-primary) appearance as other pages. */
    body.home .nav-links.active a:hover,
    body.home .nav-links.active a.active,
    body.home .nav-links.active a:focus,
    body.home .nav-links.active .dropdown a:hover,
    body.home .nav-links.active .dropdown a.active,
    body.home .nav-links.active .dropdown a:focus,
    body.gallery .nav-links.active a:hover,
    body.gallery .nav-links.active a.active,
    body.gallery .nav-links.active a:focus,
    body.gallery .nav-links.active .dropdown a:hover,
    body.gallery .nav-links.active .dropdown a.active,
    body.gallery .nav-links.active .dropdown a:focus,
    body.services-page.has-hero .nav-links.active a:hover,
    body.services-page.has-hero .nav-links.active a.active,
    body.services-page.has-hero .nav-links.active a:focus,
    body.services-page.has-hero .nav-links.active .dropdown a:hover,
    body.services-page.has-hero .nav-links.active .dropdown a.active,
    body.services-page.has-hero .nav-links.active .dropdown a:focus {
        background-color: var(--primary-color) !important;
        color: var(--white) !important;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .section-title h2 {
        font-size: 1.5rem;
    }

    .tabs-bar {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1 1 calc(50% - 8px);
        /* Keep the tab row height consistent on small screens */
        height: 48px;
        max-height: 48px;
        line-height: 1.1;
        padding: 0.5rem 0.6rem;
        /* Reduce font size slightly on smaller screens */
        font-size: clamp(0.85rem, 3.2vw, 1rem);
        /* Allow wrapping at spaces only (don't break words) */
        white-space: normal;
        word-break: normal;
        overflow: hidden;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .service-carousel {
        height: 220px;
    }

    .about-image {
        order: -1;
    }

    .page-header .container.contact-header-container,
    .contact-info-section .container.contact-container {
        /* Reduce side padding on small screens so paragraphs have more readable width */
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .contact {
        padding: 1.25rem 0;
    }

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

    .contact-form textarea {
        min-height: 140px;
    }

    /* Mobile-specific contact form fixes:
       - Stack label above the input by forcing a single column on each form-row
       - Make inputs and textarea full-width and use box-sizing to avoid overflow
       - Reduce contact-form padding to prevent the form from exceeding viewport
       - Prevent horizontal swiping caused by small-overflowing elements
    */
    .contact-form {
        width: 100%;
        max-width: 100%;
        padding: 1.25rem;
        box-sizing: border-box;
    }

    .contact-form .form-row {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .contact-form label {
        display: block;
        margin-bottom: 0.4rem;
    }

    .contact-form input[type="text"],
    .contact-form input[type="email"],
    .contact-form input[type="tel"],
    .contact-form textarea {
        width: 100%;
        box-sizing: border-box;
    }

    /* Prevent horizontal overflow / swipe on small screens */
    html, body {
        overflow-x: hidden;
    }

    /* Mobile: make tabs bar visually full-bleed and centered in the viewport.
       Use left:50% + transform to avoid layout issues from container padding, and
       reduce inner container padding so the tabs meet the screen edge. */
    .tabs-bar {
        position: relative;
        left: 50%;
        transform: translateX(-50%);
        width: 100vw;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
        border-radius: 0; /* flush edges on mobile */
        padding-left: 0;
        padding-right: 0;
        overflow: hidden;
    }

    /* Remove extra horizontal padding from the inner container so content aligns
       with the full-bleed edges while keeping a little breathing room for tabs */
    .tabs-bar .container {
        padding-left: 0;
        padding-right: 0;
        margin-left: 0;
        margin-right: 0;
        display: flex;
        gap: 0.25rem;
        align-items: center;
        /* allow scrolling as a fallback if buttons can't shrink enough */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Mobile tab sizing: keep the simpler two-column layout defined earlier
       (see the `.tab-btn { flex: 1 1 calc(50% - 8px); }` above) to avoid complex
       wrapping behaviors that caused layout issues on some devices. */

    /* Ensure contact details (email/phone) wrap cleanly on small screens */
    .contact-details li {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .contact-details li strong {
        /* make the label sit above the value on small screens */
        flex: 0 0 100%;
        margin-bottom: 0.2rem;
    }

    .contact-details li a {
        flex: 0 0 100%;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
}

/* Tablet Landscape (780px and above) */
@media (min-width: 780px) {
    .page-header .container.contact-header-container,
    .contact-info-section .container.contact-container,
    .contact {
        padding-left: 2.5rem;
        padding-right: 2.5rem;
    }

    .contact-info-section {
        padding-top: 1rem;
    }

    .page-header + .contact-info-section .contact-container {
        padding-top: 1.5rem;
    }

    .page-header + .contact-info-section .contact-info {
        padding-top: 0.75rem;
    }
}

/* Small Desktop (900px and below) */
@media (max-width: 900px) {
    .hero {
        min-height: 60vh;
    }

    .service-carousel {
        height: 220px;
    }

    .contact-container .contact-info {
        padding-left: 3rem;
        padding-right: 3rem;
        max-width: 840px;
    }
}

/* Desktop (1200px and above) */
@media (min-width: 1200px) {
    .service-carousel {
        height: 300px;
    }

    .page-header .container.contact-header-container,
    .contact-info-section .container.contact-container {
        padding-left: 0;
        padding-right: 0;
        max-width: 1100px;
        margin: 0 auto;
    }

    .contact {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .contact-container .contact-info {
        max-width: 1100px;
        margin: 0 auto;
    }
}
