/*
Theme Name:  Thistle
Theme URI:   http://localhost:8888/thistle
Description: Custom starter theme for Thistle
Author:      Your Name
Author URI:  http://localhost:8888/thistle
Version:     1.0.0
Text Domain: thistle
License:     GPL-2.0-or-later
*/

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

/* === Base === */
:root {
    --color-primary: #0073aa;
    --color-text:    #FFFFFF;
    --color-text-dark: #2D424A;
    --color-bg:      #2D424A;
    --color-border:  #ddd;
    --font-base:     system-ui, -apple-system, sans-serif;
    --max-width:     1200px;
}

html, body {
    scroll-behavior: smooth;
}

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

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

a { color: var(--color-text); }
a:hover { text-decoration: none; }

h2 {
    font-size: 24px;
    font-weight: 300;
}

.d-none {
    display: none;
}

@media (min-width: 768px) {
    .d-md-block {
        display: block;
    }

    .d-md-none {
        display: none;
    }
}

/* === Layout === */
.site { display: flex; flex-direction: column; min-height: 100vh; }
.site-content { flex: 1; }

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

/* === Header === */
.header-inner {
    display: flex;
    gap: 2rem;
    width: 100%;
}

.site-header {
    background: var(--color-bg);
    padding: 1rem 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-title a { font-size: 1.5rem; font-weight: 500; text-decoration: none; color: var(--color-text); }
.site-description { font-size: 0.875rem; color: #666; }

.site-title svg {
    height: 1.5rem;
    margin: 0.5rem 0 0 0;
    width: auto;
}

.site-branding {
    border-top: 1px solid var(--color-text);
    flex: 3;
    flex-shrink: 0;
}

/* === Navigation === */
.main-navigation {
    border-top: 1px solid var(--color-text);
    flex: 1;
    flex-shrink: 0;
}
.main-navigation ul { list-style: none; display: flex; flex-direction: column; }
.main-navigation a {
    text-decoration: none;
    font-weight: 500;
    color: var(--color-text);
    position: relative;
    padding-left: 0;
    transition: padding-left 0.2s ease;
}
.main-navigation a::before {
    content: '→';
    position: absolute;
    left: 0;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.main-navigation a:hover {
    padding-left: 1.25rem;
}
.main-navigation a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* Hamburger button — hidden on desktop */
.menu-toggle {
    display: none;
}

.screen-reader-text {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

html.menu-open,
body.menu-open {
    overflow-y: hidden;
}

/* === Main === */
.site-main { padding: 0; }

/* === Posts === */
.entry-title { font-size: 1.75rem; margin-bottom: 0.5rem; }
.entry-title a { text-decoration: none; color: var(--color-text); }
.entry-meta { font-size: 0.875rem; color: #666; margin-bottom: 1rem; }
.entry-content { line-height: 1.8; }
.entry-content p { margin-bottom: 1rem; }
.entry-heading { line-height: 1.2; margin: 0 0 64px 0; max-width: calc(75% - 2rem); }
.entry-heading h1 {
    font-size: 40px;
    font-weight: 300;
}

/* === Logo Animation === */
.wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

#kaleido {
    border-radius: 50%;
    overflow: hidden;
    display: block;
    width: min(100%, 560px);
    aspect-ratio: 1 / 1;
    cursor: crosshair;
    user-select: none;
    -webkit-user-select: none;
}

.services {
    display: flex;
    gap: 2rem;
}

.service-description {
    border-top: 1px solid var(--color-text);
    flex: 3;
    flex-shrink: 0;
}

.service-description p {
    font-size: 32px;
    font-weight: 300;
    line-height: 1.2;
    margin: 32px 32px 0 0;
}

.service-list {
    border-top: 1px solid var(--color-text);
    flex: 1;
    flex-shrink: 0;
}

.service-list ul {
    list-style-type: none;
}

section {
    padding: 3rem 0;
}

section:has(#kaleido) {
    padding: 0;
}

#clients h2,
#clients p {
    color: var(--color-text-dark);
}

.clients {
    display: flex;
    gap: 2rem;
}

.client-heading {
    flex: 3;
}

.client-description {
    flex: 1;
}

.client-description p {
    font-size: 24px;
    line-height: 1.2;
}

/* === Full Bleed === */
.full-bleed {
    width: 100vw;
    margin-left: calc(50% - 50vw);
}

/* === Client Logo Slider === */
.client-slider {
    overflow: hidden;
    width: 100vw;
    padding: 6rem 0 2rem 0;
}

.slide {
    display: flex;
    align-items: center;
    width: max-content;
    animation: logo-marquee 48s linear infinite;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.slide img {
    height: 60px;
    width: auto;
    max-width: none;
    flex-shrink: 0;
    object-fit: contain;
    margin-right: 4rem;
}

@keyframes logo-marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .slide { animation: none; }
}

.contact {
    display: flex;
    gap: 2rem;
}

.contact-heading {
    flex: 3;
}

.contact-description {
    flex: 1;
}

.contact-description p {
    font-size: 24px;
    line-height: 1.2;
}

.form-row {
    display: flex;
    gap: 2rem;
}

.form-row + .form-row {
    margin: 32px 0 0 0;
}

.contact-form {
    margin: 96px auto 96px auto;
    max-width: 800px;
}

.contact-form label {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.contact-form .submit-wrap {
    margin: 32px 0 0 0;
}

.contact-form input:not([type="submit"]) {
    background: none;
    border: none;
    border-bottom: 1px solid var(--color-text);
    color: var(--color-text);
    font-size: 24px;
    width: 100%;
}

.contact-form input:focus {
    outline: none;
}

/* Arrow before submit button */
.submit-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
}

.submit-wrap::before {
    content: '→';
    font-size: 1.4em;
    color: var(--color-text);
}

.contact-form input[type="submit"] {
    background: none;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    font-size: 16px;
}

/* === Footer === */
.site-footer {
    background: #99C0BC;
    padding: 1rem 0 4rem 0;
}

.footer-inner {
    display: flex;
    gap: 2rem;
}

.footer-branding {
    border-top: 1px solid var(--color-text);
    flex: 3;
    flex-shrink: 0;
}

.footer-branding .site-title a {
    font-size: 1.5rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--color-text);
}

.footer-copy {
    border-top: 1px solid var(--color-text);
    flex: 1;
    flex-shrink: 0;
    color: var(--color-text);
}

.footer-copy p {
    font-weight: 300;
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: row;
        align-items: center;
    }

    .site-branding {
        border-top: none;
        flex: 1;
    }

    .main-navigation {
        border-top: none;
        flex: none;
        position: relative;
    }

    /* Hamburger button */
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 56px;
        height: 20px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        margin: 0.75rem 0;
        position: relative;
        z-index: 1000;
    }

    .menu-toggle span:not(.screen-reader-text) {
        display: block;
        width: 100%;
        height: 2px;
        background: var(--color-text);
        border-radius: 2px;
        transition: transform 0.25s, opacity 0.25s;
    }

    /* Animate to X when open */
    .menu-toggle[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .menu-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* Hide menu by default on mobile */
    #primary-menu {
        display: none;
    }

    #primary-menu.is-open {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        position: fixed;
        inset: 0;
        background: var(--color-bg);
        z-index: 999;
    }

    #primary-menu a {
        font-size: 24px;
    }

    .entry-heading {
        max-width: 100%;
    }

    .entry-heading h1 {
        font-size: 24px;
    }

    .services, .clients, .contact {
        flex-direction: column;
    }
    
    .service-description h2 {
        font-size: 20px;
    }

    .service-list {
        font-size: 16px;
        margin: 32px 0 0 33%;
    }

    .service-description p {
        font-size: 24px;
    }
    
    .client-heading h2 {
        font-size: 20px;
    }

    .client-description {
        border-top: 1px solid var(--color-text-dark);
        margin: 32px 0 0 33%;
    }

    .client-description p {
        font-size: 24px;
    }
    
    .contact-heading h2 {
        font-size: 20px;
    }

    .contact-description {
        border-top: 1px solid var(--color-text);
        margin: 32px 0 0 33%;
    }
    
    .contact-form .form-row {
        display: flex;
        flex-direction: column;
    }

    .footer-inner {
        flex-direction: column;
        gap: 0;
    }

    .footer-copy {
        border-top: none;
    }
}
