/* ============================================================
   Global Genealogy — Main Stylesheet
   ============================================================ */

/* Google Fonts loaded via <link> in HTML:
   Playfair Display (headings) + PT Sans (body/nav)           */

/* ------------------------------------------------------------
   Custom properties                                    [1]
   ------------------------------------------------------------ */

:root {
    --color-dark:         #241C07;
    --color-mid:          #5F5239;
    --color-tan:          #A18864;
    --color-rust:         #8C411F;
    --color-cream:        #D8C4BC;
    --color-tagline:      #4E5B63;
    --color-tagline-span: #787551;

    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body:    'PT Sans', sans-serif;
}

/* ------------------------------------------------------------
   Reset & Base
   ------------------------------------------------------------ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-dark);
    font-family: var(--font-body);
    color: var(--color-cream);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;  /* [5] */
}

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

a {
    color: var(--color-tan);
    text-decoration: none;
    font-weight: bold;
}

a:hover {
    color: var(--color-cream);
}

ul {
    list-style: none;
}

/* ------------------------------------------------------------
   Layout
   ------------------------------------------------------------ */

.site-wrapper {
    max-width: 1140px;
    margin: 0 auto;
    background-color: var(--color-mid);
    overflow: hidden;
    min-height: 100vh;  /* [6] fill viewport on short pages */
}

/* ------------------------------------------------------------
   Header
   ------------------------------------------------------------ */

.site-header {
    background: url(../img/somers-header.jpg) top left no-repeat #fff;
    background-size: auto 100%;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    gap: 20px;
}

.site-header .logo a {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.site-header .logo img {
    max-height: 72px;
    width: auto;
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.65rem;
    color: var(--color-dark);
    line-height: 1.2;
    letter-spacing: 1px;
}

.site-header .header-right {
    text-align: right;
    flex-shrink: 0;
}

.site-header .tagline h2 {
    font-family: var(--font-heading);
    font-weight: 400;
    font-style: italic;
    font-size: 1.5rem;
    letter-spacing: 3px;
    line-height: 1.4;
    color: var(--color-tagline);
}

.site-header .tagline h2 span {
    color: var(--color-tagline-span);
    display: block;
}

/* [2] Phone number in header */
.header-phone {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-rust);
    letter-spacing: 0.5px;
    margin-top: 6px;
    text-align: right;
}

/* ------------------------------------------------------------
   Navigation
   ------------------------------------------------------------ */

.site-nav {
    background-color: var(--color-mid);
    border-bottom: 3px solid var(--color-dark);
}

.site-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav ul li a {
    display: block;
    color: #fff;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    padding: 12px 32px;
    border-bottom: 3px solid transparent;
    transition: background-color 0.2s, border-color 0.2s;
    margin-bottom: -3px;
}

.site-nav ul li a:hover {
    background-color: var(--color-dark);
    color: #fff;
    border-bottom-color: transparent;
}

.site-nav ul li a.active {
    color: #fff;
    border-bottom-color: var(--color-tan);
    background-color: transparent;
}

/* ------------------------------------------------------------
   Page Content Wrapper
   ------------------------------------------------------------ */

.page-content {
    background-color: var(--color-mid);
}

/* ------------------------------------------------------------
   Home Page Hero
   ------------------------------------------------------------ */

.home-hero {
    display: flex;
    align-items: stretch;
    background-color: var(--color-mid);
}

.home-hero .hero-image {
    flex: 0 0 58%;
    overflow: hidden;
    position: relative;
}

.home-hero .hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
    display: block;
}

/* Gradient fade from image into text panel */
.home-hero .hero-image::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 35%;
    background: linear-gradient(to right, transparent, var(--color-mid));
    pointer-events: none;
}

.home-hero .hero-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 40px 48px 8px;
    background-color: var(--color-mid);
}

.home-hero .hero-text h1 {
    font-family: var(--font-heading);
    font-weight: 400;
    font-style: italic;
    font-size: 1.4rem;
    color: var(--color-cream);
    letter-spacing: 1.5px;
    line-height: 1.7;
    margin-bottom: 36px;
}

/* Ghost button CTA */
.cta-btn {
    display: inline-block;
    align-self: flex-end;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--color-cream);
    border: 1px solid var(--color-cream);
    padding: 10px 24px;
    text-decoration: none;
    transition: background-color 0.25s, color 0.25s;
    margin-right: 20px;
}

.cta-btn:hover {
    background-color: var(--color-cream);
    color: var(--color-dark);
}

/* ------------------------------------------------------------
   Interior Page Hero (two-column header section)
   ------------------------------------------------------------ */

.interior-hero {
    display: flex;
    align-items: flex-start;
    background-color: var(--color-mid);
    gap: 0;
    position: relative;
    z-index: 1;
}

.interior-hero .interior-text {
    flex: 1;
    padding: 48px 40px 40px;
}

.interior-hero .interior-image {
    flex: 0 0 42%;
    padding: 30px 30px 0 0;
}

.interior-hero .interior-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Globe background variant */
.interior-hero.has-globe {
    background: var(--color-mid) url(../img/globe.png) top right no-repeat;
}

/* ------------------------------------------------------------
   Page Sections
   ------------------------------------------------------------ */

.section-dark {
    background-color: var(--color-dark);
    padding: 40px;
    position: relative;
    z-index: 1;
}

.country-section,
.leaf-list-section {
    position: relative;
    z-index: 1;
}

/* Angled top edge */
.section-rust {
    background-color: var(--color-rust);
    padding: 40px;
    position: relative;
    z-index: 2;
    clip-path: polygon(0 48px, 100% 0, 100% 100%, 0 100%);
    margin-top: -48px;
    padding-top: 88px;
}

.section-rust.two-col {
    display: flex;
    gap: 40px;
}

.section-rust.two-col > * {
    flex: 1;
}

/* ------------------------------------------------------------
   Typography — Interior Pages
   ------------------------------------------------------------ */

h1.page-title {
    font-family: var(--font-heading);
    font-weight: 400;
    font-style: italic;
    font-size: 2.6rem;
    color: var(--color-cream);
    letter-spacing: 2px;
    line-height: 1.2;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--color-tan);
    display: inline-block; /* border only spans the heading width */
}

.body-text {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-cream);
    letter-spacing: 0.5px;
    line-height: 1.8;
    margin-bottom: 20px;
    max-width: 65ch;
}

.body-text p + p {
    margin-top: 16px;
}

.interior-text > .body-text:first-of-type {
    font-size: 1.05rem;
}

/* Animated underline for content links */
.body-text a,
.testimonial-body a,
.office-card a,
.country-intro a {
    position: relative;
    text-decoration: none;
    color: var(--color-tan);
    font-weight: bold;
}

.body-text a::after,
.testimonial-body a::after,
.office-card a::after,
.country-intro a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background-color: var(--color-cream);
    transition: width 0.3s ease;
}

.body-text a:hover::after,
.testimonial-body a:hover::after,
.office-card a:hover::after,
.country-intro a:hover::after {
    width: 100%;
}

/* ------------------------------------------------------------
   Country Tags
   ------------------------------------------------------------ */

.country-section {
    background-color: var(--color-mid);
    padding: 32px 40px 56px;
}

.country-intro {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-cream);
    letter-spacing: 0.5px;
    line-height: 1.8;
    margin-bottom: 28px;
    max-width: 65ch;
}

.country-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
}

.country-tag {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-style: italic;
    color: var(--color-cream);
    letter-spacing: 0.8px;
    border: 1px solid var(--color-tan);
    border-radius: 3px;
    padding: 5px 14px;
    transition: background-color 0.2s, color 0.2s;
    display: inline-block;
}

.country-tag:hover {
    background-color: var(--color-tan);
    color: var(--color-dark);
}

/* ------------------------------------------------------------
   Leaf List (research page)
   ------------------------------------------------------------ */

.leaf-list-section {
    background-color: var(--color-mid);
    padding: 8px 40px 56px;
}

.leaf-list-section > p {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-cream);
    letter-spacing: 0.5px;
    line-height: 1.8;
    margin-bottom: 20px;
    padding-top: 24px;
    max-width: 65ch;
}

.leaf-list-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 40px;
}

.leaf-list {
    list-style: url(../img/leafbullet.png);
    padding-left: 24px;
}

.leaf-list li {
    font-family: var(--font-body);
    font-size: 1rem;
    font-style: italic;
    color: var(--color-cream);
    letter-spacing: 0.5px;
    line-height: 1.8;
    margin-bottom: 16px;
    padding-left: 8px;
}

/* ------------------------------------------------------------
   Testimonials
   ------------------------------------------------------------ */

.testimonials-list {
    padding: 0;
}

.testimonial {
    position: relative;
    margin-bottom: 48px;
    padding-bottom: 40px;
    padding-left: 56px;
    border-bottom: 1px solid rgba(216, 196, 188, 0.2);
}

.testimonial:last-child {
    border-bottom: none;
}

.testimonial::before {
    content: '\201C';
    font-family: var(--font-heading);
    font-size: 6rem;
    line-height: 1;
    color: var(--color-tan);
    opacity: 0.5;
    position: absolute;
    top: -8px;
    left: 0;
    pointer-events: none;
}

.testimonial-category {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-tan);
    margin-bottom: 14px;
}

.testimonial-body {
    font-family: var(--font-body);
    font-size: 1rem;
    font-style: italic;
    color: var(--color-cream);
    letter-spacing: 0.5px;
    line-height: 1.9;
    margin-bottom: 16px;
    max-width: 65ch;
}

.testimonial-author {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-tan);
    font-weight: 700;
    letter-spacing: 1px;
}

/* ------------------------------------------------------------
   Contact Page
   ------------------------------------------------------------ */

.contact-page {
    position: relative;
    padding: 48px 40px;
}

.contact-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url(../img/bgcontact.jpg) top center no-repeat var(--color-tan);
    background-size: cover;
    opacity: 0.4;
    z-index: 0;
}

.contact-page > * {
    position: relative;
    z-index: 1;
}

.contact-intro {
    max-width: 400px;
    margin-bottom: 40px;
}

.contact-intro p {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--color-cream);
    line-height: 1.8;
}

.contact-intro p span {
    font-size: 1.3rem;
    font-weight: 700;
    display: block;
    margin-bottom: 12px;
}

.contact-offices {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.office-card {
    background-color: rgba(36, 28, 7, 0.85);
    flex: 1;
    min-width: 240px;
    padding: 28px 32px;
    border-top: 3px solid var(--color-rust);
}

.office-card h3 {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-tan);
    margin-bottom: 16px;
}

.office-card p {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-cream);
    line-height: 1.8;
    letter-spacing: 0.3px;
}

.office-card a {
    color: var(--color-tan);
    font-weight: bold;
}

.office-card a:hover {
    color: var(--color-cream);
}

/* ------------------------------------------------------------
   Responsive — Tablet (~900px)
   ------------------------------------------------------------ */

@media (max-width: 900px) {

    .site-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px 24px;
        background-size: cover;
    }

    .site-header .header-right {
        text-align: center;
    }

    .site-header .tagline h2 span {
        display: inline;
    }

    .header-phone {
        text-align: center;
    }

    .home-hero {
        flex-direction: column;
    }

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

    .home-hero .hero-image::after {
        display: none;
    }

    .home-hero .hero-text {
        padding: 32px 24px;
    }

    .interior-hero {
        flex-direction: column;
    }

    .interior-hero .interior-image {
        flex: none;
        width: 100%;
        padding: 0 24px 24px;
    }

    .interior-hero .interior-text {
        padding: 32px 24px 24px;
    }

    .leaf-list-grid {
        grid-template-columns: 1fr;
    }

    .section-rust.two-col {
        flex-direction: column;
        gap: 0;
    }

    .section-dark,
    .section-rust,
    .country-section,
    .leaf-list-section {
        padding: 24px;
    }

    .section-rust {
        clip-path: polygon(0 28px, 100% 0, 100% 100%, 0 100%);
        margin-top: -28px;
        padding-top: 60px;
    }

    .contact-offices {
        flex-direction: column;
    }

    h1.page-title {
        font-size: 2rem;
    }
}

/* ------------------------------------------------------------
   Responsive — Mobile (~480px)
   ------------------------------------------------------------ */

@media (max-width: 480px) {

    .site-nav ul {
        flex-direction: column;
    }

    .site-nav ul li a {
        padding: 12px 20px;
        border-bottom: 2px solid var(--color-dark);
        border-left: none;
        text-align: center;
        margin-bottom: 0;
    }

    .site-nav ul li a.active {
        border-bottom-color: var(--color-tan);
    }

    .home-hero .hero-text h1 {
        font-size: 1.2rem;
    }

    h1.page-title {
        font-size: 1.7rem;
    }

    .country-tags {
        gap: 8px;
    }

    .testimonial {
        padding-left: 40px;
    }

    .testimonial::before {
        font-size: 4.5rem;
    }

    .contact-page {
        padding: 24px 20px;
    }

    .section-rust {
        clip-path: none;
        margin-top: 0;
        padding-top: 40px;
    }
}
