/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    line-height: 1.7;
    font-size: 16px;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

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

ul {
    list-style: none;
}

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

/* Prevent long words/emails from overflowing */
p, li, a, address, h1, h2, h3 {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ===== Accessibility: Skip Link ===== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: #f50057;
    color: #fff;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 0 0 6px 6px;
    z-index: 10000;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* ===== Accessibility: Screen reader only text ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== Accessibility: Global Focus Styles ===== */
:focus-visible {
    outline: 3px solid #f50057;
    outline-offset: 3px;
}

/* White focus ring on dark backgrounds */
.hero :focus-visible,
.contact :focus-visible,
.footer :focus-visible {
    outline-color: #fff;
}

/* ===== Header ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: background 0.3s, box-shadow 0.3s;
    background: transparent;
}

.header.scrolled {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 2px;
    transition: color 0.3s;
    padding: 8px 4px;
    white-space: nowrap;
}

.header.scrolled .logo {
    color: #f50057;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 26px;
    color: #fff;
    cursor: pointer;
    transition: color 0.3s;
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
}

.header.scrolled .nav-toggle {
    color: #333;
}

.nav-links {
    display: flex;
    gap: 10px;
}

.nav-links a {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
    position: relative;
    padding: 10px 12px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 12px;
    right: 12px;
    width: auto;
    height: 2px;
    background: #f50057;
    transform: scaleX(0);
    transition: transform 0.3s;
}

.nav-links a:hover::after {
    transform: scaleX(1);
}

.header.scrolled .nav-links a {
    color: #333;
}

.header.scrolled .nav-links a:hover {
    color: #f50057;
}

/* ===== Hero ===== */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #1a1a2e url('images/npb-light-dark-1-scaled.jpg') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(20, 20, 40, 0.85), rgba(15, 52, 96, 0.75));
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 80px 30px 40px;
}

.hero-content h1 {
    font-size: clamp(24px, 4.2vw, 44px);
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    letter-spacing: 1px;
    white-space: nowrap;
}

.hero-subtitle {
    font-size: clamp(16px, 2.8vw, 22px);
    color: #ff6b9d;
    font-weight: 500;
    margin-bottom: 20px;
}

.hero-tagline {
    font-size: clamp(15px, 2vw, 17px);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 14px 32px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 3px;
    transition: all 0.3s;
    cursor: pointer;
    min-height: 44px;
    text-align: center;
}

.btn-filled {
    background: #f50057;
    color: #fff;
    border: 2px solid #f50057;
}

.btn-filled:hover {
    background: #ff5983;
    border-color: #ff5983;
}

.btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
}

.btn-outline:hover {
    background: #fff;
    color: #333;
}

/* ===== Services ===== */
.services {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 30px;
}

.services > h2 {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 700;
    color: #1a1a2e;
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    padding-bottom: 15px;
}

.services > h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #f50057;
    border-radius: 2px;
}

.service-block {
    display: flex;
    align-items: center;
    gap: 50px;
    margin-bottom: 70px;
}

.service-block:last-child {
    margin-bottom: 0;
}

.service-block.reverse {
    flex-direction: row-reverse;
}

.service-image {
    flex: 0 0 40%;
    min-width: 0;
}

/* Full-size images (law-2.jpg) */
.service-image img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Book cover display for small images */
.service-image.book-display {
    height: 280px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.service-image.book-display img {
    width: auto;
    height: auto;
    max-height: 220px;
    max-width: 180px;
    object-fit: contain;
    position: relative;
    z-index: 1;
    border-radius: 0;
    box-shadow: none;
    mix-blend-mode: multiply;
}

/* Light backgrounds so multiply removes white without darkening colors */
.book-bg-travail {
    background: #f0eeeb;
}

.book-bg-protection {
    background: #f0eeeb;
}

.book-bg-etrangers {
    background: #f0eeeb;
}

.book-bg-mineurs {
    background: #f0eeeb;
}

/* Gradient fallback for droit de la famille (no photo on original site) */
.service-image-placeholder {
    width: 100%;
    height: 280px;
    border-radius: 6px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.service-image-placeholder.famille {
    background: linear-gradient(135deg, #4a1942 0%, #6a1b4d 50%, #c85c8e 100%);
    position: relative;
}
.service-image-placeholder.famille::after {
    content: "\2764";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    color: rgba(255, 255, 255, 0.2);
}

.service-text {
    flex: 1;
    min-width: 0;
}

.service-text h3 {
    font-size: clamp(20px, 3vw, 30px);
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 18px;
    position: relative;
    padding-bottom: 12px;
}

.service-text h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: #f50057;
    border-radius: 2px;
}

.service-text p {
    font-size: 16px;
    color: #444;
    margin-bottom: 15px;
    line-height: 1.8;
}

.service-text ul {
    list-style: disc;
    padding-left: 20px;
}

.service-text ul li {
    font-size: 16px;
    color: #444;
    margin-bottom: 8px;
    line-height: 1.7;
}

.service-text ul li strong {
    color: #222;
}

/* ===== Contact ===== */
.contact {
    position: relative;
    padding: 100px 30px;
    text-align: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    background-attachment: fixed;
}

.contact-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 20, 40, 0.6);
}

.contact-content {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-content h2 {
    font-size: clamp(24px, 4vw, 40px);
    font-weight: 700;
    color: #fff;
    margin-bottom: 50px;
    letter-spacing: 1px;
}

.contact-content h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: #f50057;
    margin: 15px auto 0;
    border-radius: 2px;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.contact-card {
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 40px 25px;
    transition: transform 0.3s, background 0.3s;
}

.contact-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.12);
}

.contact-icon {
    font-size: 36px;
    margin-bottom: 15px;
    color: #ff6b9d;
}

.contact-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-card a {
    font-size: 16px;
    color: #ddd;
    transition: color 0.3s;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.3);
    text-underline-offset: 3px;
    padding: 4px 2px;
}

.contact-card a:hover {
    color: #ff6b9d;
    text-decoration-color: #ff6b9d;
}

.contact-card address {
    font-style: normal;
}

.contact-card p {
    font-size: 16px;
    color: #ddd;
    margin-bottom: 5px;
}

/* ===== Footer ===== */
.footer {
    background: #111;
    padding: 30px;
    text-align: center;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    position: relative;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.75);
    font-size: 18px;
    transition: all 0.3s;
}

.footer-social a:hover {
    border-color: #ff6b9d;
    color: #ff6b9d;
}

.footer-copy {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    max-width: 80%;
}

.back-to-top {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.75);
    font-size: 18px;
    transition: all 0.3s;
}

.back-to-top:hover {
    border-color: #ff6b9d;
    color: #ff6b9d;
}

/* =============================================
   RESPONSIVE BREAKPOINTS
   ============================================= */

/* ----- Tablet landscape / small desktop (<=992px) ----- */
@media (max-width: 992px) {
    .service-block,
    .service-block.reverse {
        flex-direction: column;
        gap: 30px;
    }

    .service-image {
        flex: none;
        width: 100%;
    }

    .service-image img,
    .service-image-placeholder,
    .service-image.book-display {
        height: 240px;
    }

    .service-image.book-display img {
        max-height: 190px;
    }

    .services {
        padding: 60px 30px;
    }

    .services > h2 {
        margin-bottom: 45px;
    }

    .service-block {
        margin-bottom: 50px;
    }

    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* Third card spans full width centered */
    .contact-card:last-child {
        grid-column: 1 / -1;
        max-width: 340px;
        justify-self: center;
    }

    .contact {
        padding: 70px 30px;
    }

    .contact-content h2 {
        margin-bottom: 35px;
    }
}

/* ----- Tablet portrait / large mobile (<=768px) ----- */
@media (max-width: 768px) {
    /* Header */
    .header-inner {
        padding: 12px 20px;
    }

    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 10px 20px;
        gap: 0;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        color: #333 !important;
        padding: 12px 16px;
        width: 100%;
    }

    .nav-links a:hover {
        color: #f50057 !important;
    }

    .nav-links a::after {
        display: none;
    }

    /* Hero */
    .hero {
        min-height: 100vh;
        min-height: 100svh;
        background-attachment: scroll;
    }

    .hero-content {
        padding: 70px 20px 30px;
    }

    .hero-tagline {
        margin-bottom: 30px;
    }

    /* Services */
    .services {
        padding: 50px 20px;
    }

    .service-block {
        margin-bottom: 40px;
    }

    .service-image img,
    .service-image-placeholder,
    .service-image.book-display {
        height: 200px;
    }

    .service-image.book-display img {
        max-height: 160px;
    }

    .service-text p,
    .service-text ul li {
        font-size: 15px;
    }

    /* Contact */
    .contact {
        padding: 60px 20px;
        background-attachment: scroll;
    }

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

    .contact-card:last-child {
        max-width: none;
    }

    .contact-card {
        padding: 30px 20px;
    }

    /* Footer */
    .footer {
        padding: 25px 20px;
    }

    .back-to-top {
        position: static;
        transform: none;
        margin-top: 5px;
    }

    .footer-copy {
        max-width: 100%;
    }
}

/* ----- Mobile (<=480px) ----- */
@media (max-width: 480px) {
    /* Header */
    .header-inner {
        padding: 10px 16px;
    }

    .logo {
        font-size: 20px;
        letter-spacing: 1px;
    }

    /* Hero */
    .hero-content {
        padding: 60px 16px 24px;
    }

    .hero-tagline {
        margin-bottom: 24px;
        line-height: 1.7;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 13px;
        letter-spacing: 1px;
    }

    /* Services */
    .services {
        padding: 40px 16px;
    }

    .services > h2 {
        margin-bottom: 35px;
    }

    .service-block {
        gap: 20px;
        margin-bottom: 35px;
    }

    .service-image img,
    .service-image-placeholder,
    .service-image.book-display {
        height: 180px;
    }

    .service-image.book-display img {
        max-height: 140px;
    }

    .service-image-placeholder::after {
        font-size: 60px !important;
    }

    .service-text h3 {
        margin-bottom: 14px;
        padding-bottom: 10px;
    }

    .service-text p {
        font-size: 15px;
        margin-bottom: 12px;
    }

    .service-text ul {
        padding-left: 16px;
    }

    .service-text ul li {
        font-size: 15px;
        margin-bottom: 6px;
    }

    /* Contact */
    .contact {
        padding: 50px 16px;
    }

    .contact-content h2 {
        margin-bottom: 30px;
    }

    .contact-grid {
        gap: 16px;
    }

    .contact-card {
        padding: 25px 16px;
    }

    .contact-icon {
        font-size: 30px;
        margin-bottom: 10px;
    }

    .contact-card h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .contact-card a,
    .contact-card p {
        font-size: 14px;
    }

    /* Footer */
    .footer {
        padding: 20px 16px;
    }

    .footer-copy {
        font-size: 13px;
    }
}

/* ----- Small mobile (<=360px) ----- */
@media (max-width: 360px) {
    .hero-content {
        padding: 60px 12px 20px;
    }

    .services {
        padding: 35px 12px;
    }

    .contact {
        padding: 40px 12px;
    }

    .service-image img,
    .service-image-placeholder,
    .service-image.book-display {
        height: 150px;
    }

    .service-image.book-display img {
        max-height: 115px;
    }

    .contact-card {
        padding: 20px 12px;
    }
}

/* ===== iOS / mobile: disable fixed backgrounds ===== */
@supports (-webkit-touch-callout: none) {
    .hero,
    .contact {
        background-attachment: scroll;
    }
}

/* ===== Accessibility: Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    html {
        scroll-behavior: auto;
    }

    .contact-card:hover {
        transform: none;
    }
}

/* ===== Landscape phones ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 80px 20px 40px;
    }

    .hero-content {
        padding: 20px;
    }

    .hero-tagline {
        margin-bottom: 20px;
    }
}
