/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  Default GeneratePress child theme
 Author:       Tom Usborne
 Author URI:   https://tomusborne.com
 Template:     generatepress
 Version:      0.1
*/

/* ============================================
   THICKROPE DESIGN SYSTEM
   Ink Black + Rope Tan palette
   Syne (headings) + DM Sans (body)
============================================ */

/* --- COLOUR TOKENS --- */
:root {
    --tr-black:        #1C1C1C;
    --tr-tan:          #C8A87A;
    --tr-terracotta:   #D68A5C;
    --tr-cream:        #FFFDF7;
    --tr-warm-white:   #F9F6F0;
    --tr-sand:         #E8DDD0;
    --tr-driftwood:    #6B5D4A;
    --tr-subtle:       #9A8A74;
    --tr-hire-orange:  #E8632A;
    --tr-hire-hover:   #F07A45;
    --tr-diy-green:    #2E7D52;
}

/* --- BASE TYPOGRAPHY --- */
body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--tr-cream);
    color: var(--tr-black);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    color: var(--tr-black);
}

/* --- SHARED BLOCK CLASSES --- */

/* Dark hero band — service + industry pages */
.tr-hero-dark {
    background-color: var(--tr-black);
    color: var(--tr-cream);
    padding: 52px 40px;
}

.tr-hero-dark h1,
.tr-hero-dark h2 {
    color: var(--tr-cream);
}

/* Tan accent on dark backgrounds */
.tr-hero-dark .tr-accent {
    color: var(--tr-tan);
}

/* Warm white hero — location pages */
.tr-hero-warm {
    background-color: var(--tr-warm-white);
    padding: 44px 40px;
}

/* Eyebrow labels */
.tr-eyebrow {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--tr-driftwood);
    margin-bottom: 12px;
    display: block;
}

/* Rope Tan lettering only on Ink Black (7.6:1); it is 2.2:1 on light grounds */
.tr-hero-dark .tr-eyebrow {
    color: var(--tr-tan);
}

/* Pull quote */
.tr-pull-quote {
    border-left: 3px solid var(--tr-tan);
    padding: 12px 16px;
    background-color: var(--tr-warm-white);
    border-radius: 0 8px 8px 0;
    margin: 24px 0;
}

.tr-pull-quote p {
    font-style: italic;
    color: var(--tr-driftwood);
    line-height: 1.7;
    margin: 0;
}

/* DIY nudge block */
.tr-diy-nudge {
    background-color: var(--tr-warm-white);
    border: 1px solid var(--tr-sand);
    border-radius: 12px;
    padding: 18px 20px;
    margin: 24px 0;
}

/* Local context block (location pages) */
.tr-local-block {
    background-color: var(--tr-warm-white);
    border: 1px solid var(--tr-sand);
    border-radius: 12px;
    padding: 20px 24px;
    margin: 24px 0;
}

/* Stat card */
.tr-stat-card {
    background-color: var(--tr-cream);
    border: 1px solid var(--tr-sand);
    border-radius: 12px;
    padding: 16px;
}

.tr-stat-card .tr-stat-num {
    font-family: 'Syne', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--tr-black);
    line-height: 1;
    margin-bottom: 4px;
    display: block;
}

.tr-stat-card .tr-stat-desc {
    font-size: 0.8125rem;
    color: var(--tr-driftwood);
    line-height: 1.45;
}

/* --- CTA BUTTONS --- */

/* Hire-me — orange, functional only */
/* Ink Black label: white on orange is 3.4:1 and fails at this size */
.tr-cta-hire {
    background-color: var(--tr-hire-orange);
    color: var(--tr-black);
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    padding: 14px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
}

/* Lighter, not darker, so the Ink label keeps contrast (6.2:1) */
.tr-cta-hire:hover,
.tr-cta-hire:focus {
    background-color: var(--tr-hire-hover);
    color: var(--tr-black);
}

/* DIY — green, functional only */
.tr-cta-diy {
    background-color: var(--tr-diy-green);
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    padding: 14px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
}

.tr-cta-diy:hover {
    background-color: #256644;
    color: #fff;
}

/* Nav CTA — black bg, tan text */
.tr-cta-nav {
    background-color: var(--tr-black);
    color: var(--tr-tan);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 8px;
    display: inline-block;
    text-decoration: none;
}

/* Hover lifts the label to Cream (16.8:1) rather than shifting to an off-palette grey */
.tr-cta-nav:hover {
    background-color: var(--tr-black);
    color: var(--tr-cream);
}

/* --- FOOTER CTA BAND --- */
.tr-dual-cta {
    background-color: var(--tr-tan);
    padding: 48px 40px;
}

.tr-dual-cta h2 {
    color: var(--tr-black);
}

/* White on tan is 2.25:1; emphasis stays Ink with a cream bar behind, like the town-name mark */
.tr-dual-cta em {
    color: var(--tr-black);
    font-style: normal;
    background-image: linear-gradient(var(--tr-cream), var(--tr-cream));
    background-repeat: no-repeat;
    background-position: 0 88%;
    background-size: 100% 0.32em;
}

/* --- INFO STRIP --- */
.tr-info-strip {
    background-color: var(--tr-black);
    padding: 12px 40px;
}

.tr-info-strip p,
.tr-info-strip span {
    font-size: 0.8125rem;
    color: var(--tr-subtle);
}

.tr-info-strip strong {
    color: var(--tr-tan);
}

/* --- SERVICE PILL TAGS --- */
.tr-service-pill {
    font-size: 12px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 99px;
    border: 1px solid var(--tr-sand);
    background-color: var(--tr-cream);
    color: var(--tr-driftwood);
    display: inline-block;
}

/* --- SINCE 2001 BADGE --- */
.tr-since-badge {
    background-color: var(--tr-warm-white);
    border: 1px solid var(--tr-sand);
    border-radius: 12px;
    padding: 14px 16px;
    text-align: center;
}

.tr-since-badge .tr-since-num {
    font-family: 'Syne', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--tr-black);
    display: block;
    line-height: 1;
}

.tr-since-badge .tr-since-label {
    font-size: 0.8125rem;
    color: var(--tr-driftwood);
    margin-top: 4px;
    display: block;
}

/* ============================================
   NAVIGATION
============================================ */

/* Nav background. The header stays in view while the page scrolls. */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--tr-cream);
    border-bottom: 1px solid var(--tr-sand);
}

/* Below the WordPress admin bar when logged in (fixed from 601px up) */
.admin-bar .site-header {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}

@media (max-width: 600px) {
    .admin-bar .site-header {
        top: 0;
    }
}

/* Compact, so the sticky header doesn't eat the screen: 85px tall on desktop */
:root {
    --tr-header-height: 85px;
}

.inside-header {
    padding-block: 10px;
}

.site-logo .header-image {
    width: auto;
    height: 52px;
}

.main-navigation .main-nav > ul > li > a {
    line-height: 48px;
}

/* Jump links and skip links land below the sticky header, not under it */
html {
    scroll-padding-top: calc(var(--tr-header-height) + 16px);
}

/* Nav links */
.main-navigation a {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: var(--tr-driftwood);
    text-decoration: none;
    padding: 8px 12px;
}

.main-navigation a:hover {
    color: var(--tr-black);
}

/* Active nav item, and Services while on one of its pages */
.main-navigation .current-menu-item > a,
.main-navigation .current-menu-ancestor > a {
    color: var(--tr-black);
    font-weight: 500;
}

/* Services dropdown: a Cream card on a Sand hairline, flat like every card */
.main-navigation .main-nav ul ul {
    width: 260px;
    padding: 8px;
    background-color: var(--tr-cream);
    border: 1px solid var(--tr-sand);
    border-radius: 12px;
    box-shadow: none;
}

.main-navigation .main-nav ul ul li a {
    padding: 10px 12px;
    font-size: 15px;
    line-height: 1.35;
    color: var(--tr-black);
    background-color: transparent;
    border-radius: 8px;
}

.main-navigation .main-nav ul ul li:hover > a,
.main-navigation .main-nav ul ul li > a:focus,
.main-navigation .main-nav ul ul li.current-menu-item > a {
    color: var(--tr-black);
    background-color: var(--tr-warm-white);
}

/* PPC and Social media sit apart, as complementary services */
.main-navigation .main-nav ul ul li.tr-menu-group-start {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--tr-sand);
}

.main-navigation .main-nav ul ul li.tr-menu-group-start::before {
    content: "Complementary services";
    display: block;
    padding: 4px 12px 2px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--tr-driftwood);
}

/* Mobile menu: the open list scrolls inside the sticky header */
@media (max-width: 768px) {
    .main-navigation.toggled .main-nav > ul {
        max-height: calc(100vh - var(--tr-header-height, 72px));
        max-height: calc(100dvh - var(--tr-header-height, 72px));
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-bottom: 16px;
    }

    .main-navigation .main-nav ul ul {
        width: auto;
        padding: 0 0 0 16px;
        border: 0;
        border-radius: 0;
    }

    /* 48px tap rows */
    .main-navigation .main-nav ul li a,
    .main-navigation .main-nav > ul > li > a,
    .main-navigation .main-nav > ul > li.menu-item-free-audit > a {
        font-size: 16px;
        line-height: 24px;
        padding-block: 12px;
    }

    .main-navigation .main-nav ul ul li a {
        padding-block: 12px;
    }

    .menu-item-free-audit {
        padding: 8px 12px 0;
    }

    .menu-item-free-audit a {
        display: inline-flex;
        margin-left: 0;
        padding: 12px 20px;
    }
}

/* Brand focus ring on nav links (browser default otherwise) */
.main-navigation a:focus-visible {
    outline: 3px solid var(--tr-black);
    outline-offset: 3px;
    border-radius: 8px;
}

/* Free audit button in nav */
@media (min-width: 769px) {
    .main-navigation .main-nav > ul > li.menu-item-free-audit > a {
        line-height: 44px;
    }
}

.menu-item-free-audit a {
    background-color: var(--tr-black);
    color: var(--tr-tan) !important;
    font-weight: 500;
    padding: 2px 18px;
    border-radius: 8px;
    margin-left: 8px;
}

.menu-item-free-audit a:hover {
    background-color: var(--tr-black);
    color: var(--tr-cream) !important;
}

/* ============================================
   FOOTER CTA BLOCK
============================================ */

.tr-dual-cta h2,
.tr-dual-cta h3 {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    color: var(--tr-black);
    font-size: 20px;
    line-height: 1.2;
}

.tr-dual-cta h2 {
    margin-top: 8px;
    margin-bottom: 8px;
}

/* ============================================
   SITE FOOTER (inc/site-footer.php)
   Compact: contact details, then five short link
   groups. Warm White against the Cream page and
   the Ink Black CTA bands above it.
============================================ */

.site-footer {
    background-color: var(--tr-warm-white);
    color: var(--tr-black);
    border-top: 1px solid var(--tr-sand);
}

.tr-footer {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.tr-footer__wrap {
    max-width: 1200px;
    margin-inline: auto;
    padding: clamp(48px, 6vw, 72px) clamp(16px, 4vw, 40px) 24px;
}

.tr-footer__grid {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: 40px clamp(24px, 4vw, 56px);
}

.tr-footer :where(p) {
    margin: 0;
}

.tr-footer :where(ul) {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Contact column */
.tr-footer__name {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 1.25rem;
    line-height: 1.25;
    letter-spacing: -0.015em;
    text-wrap: balance;
}

.tr-footer__intro {
    margin-top: 8px;
    color: var(--tr-driftwood);
}

.tr-footer__address {
    margin: 20px 0 0;
    font-style: normal;
}

.tr-footer__social {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    margin-top: 16px;
}

.tr-footer__sa {
    margin-top: 12px;
}

/* Link groups: titles are paragraphs styled as small labels, not headings */
.tr-footer__nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px 24px;
}

.tr-footer__title {
    margin-bottom: 10px;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--tr-driftwood);
}

.tr-footer__group li + li {
    margin-top: 6px;
}

.tr-footer__bar {
    margin-top: clamp(40px, 5vw, 56px);
    padding-top: 20px;
    font-size: 0.875rem;
    color: var(--tr-driftwood);
    border-top: 1px solid var(--tr-sand);
}

/* Links: Ink, with the terracotta underline appearing on hover */
.tr-footer a {
    color: var(--tr-black);
    text-decoration-line: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.22em;
}

.tr-footer a:hover,
.tr-footer a[aria-current="page"] {
    color: var(--tr-black);
    text-decoration-color: var(--tr-terracotta);
}

/* "Cookie settings" opens a dialog, so it is a button dressed as a link */
.tr-footer .tr-link-button,
.tr-footer .tr-link-button:hover,
.tr-footer .tr-link-button:focus {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--tr-black);
    cursor: pointer;
    text-decoration-line: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.22em;
}

.tr-footer .tr-link-button:hover {
    text-decoration-color: var(--tr-terracotta);
}

.tr-footer a:focus-visible,
.tr-footer .tr-link-button:focus-visible {
    outline: 3px solid var(--tr-black);
    outline-offset: 3px;
    border-radius: 8px;
}

/* Tablet: contact details above, the five groups below */
@media (max-width: 1023px) {
    .tr-footer__grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Phone: groups two to a row, so the footer stays short */
@media (max-width: 719px) {
    .tr-footer__nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px 16px;
    }
}

/* Touch screens: each link gets a full 44px row */
@media (pointer: coarse) {
    .tr-footer__group li + li {
        margin-top: 0;
    }

    .tr-footer__group a,
    .tr-footer__group .tr-link-button,
    .tr-footer__social a,
    .tr-footer__address a,
    .tr-footer__sa a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }
}

/* The logo image is the tap target, so let its link take the image's size */
.site-logo a {
    display: inline-block;
}

/* ============================================
   LINKS IN TEXT
   Ink Black with a terracotta underline (DESIGN.md)
============================================ */

.entry-content a:not([class]) {
    color: var(--tr-black);
    text-decoration-line: underline;
    text-decoration-color: var(--tr-terracotta);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.22em;
}

.entry-content a:not([class]):hover {
    text-decoration-color: var(--tr-black);
}

/* ============================================
   THIRD-PARTY FLOATING WIDGETS
   Both sat over form buttons on phones. reCAPTCHA's notice
   is printed under each form instead (functions.php), and
   cookie preferences reopen from the footer link.
============================================ */

.grecaptcha-badge {
    visibility: hidden;
}

.cky-btn-revisit-wrapper {
    display: none !important;
}

.tr-recaptcha-note {
    margin: 12px 0 0;
    max-width: 640px;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--tr-driftwood);
}

/* Inline padding grows the tap area to about 44px without moving the text */
.tr-recaptcha-note a {
    padding-block: 13px;
    color: var(--tr-driftwood);
    text-decoration-line: underline;
    text-decoration-color: var(--tr-terracotta);
    text-underline-offset: 0.22em;
}
