/*
Theme Name:  Word Craft Publications Theme
Theme URI:   https://wordcraftpublications.com
Author:      Word Craft Publications
Author URI:  https://wordcraftpublications.com
Description: Custom theme for Word Craft Publications.
Version:     1.0.0
License:     GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: word-craft-publications-theme
Tags:        custom, publications
*/


/* =============================================================================
   DESIGN TOKENS
   ============================================================================= */

:root {
    --color-primary:     #1a1a2e;   /* deep navy */
    --color-accent:      #c8a96e;   /* warm gold */
    --color-accent-dark: #a8893e;
    --color-text:        #1a1a1a;
    --color-text-muted:  #666;
    --color-border:      #e4e4e4;
    --color-bg:          #fff;
    --color-bg-footer:   #0f0f1a;
    --color-footer-text: #b0b0c0;

    --header-height:     100px;
    --container-width:   1200px;
    --gap:               1.5rem;
    --radius:            6px;

    --font-body:   Georgia, 'Times New Roman', serif;
    --font-ui:     'Segoe UI', system-ui, -apple-system, sans-serif;

    --transition:  0.2s ease;
}


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

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
}

/* Offset anchor targets so sticky header doesn't overlap */
:target {
    scroll-margin-top: calc(var(--header-height) + 1rem);
}

a {
    color: inherit;
    text-decoration: underline;
    transition: opacity var(--transition);
}

a:hover { opacity: 0.75; }

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

ul { list-style: none; }

address { font-style: normal; }

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content {
    flex: 1;
    max-width: var(--container-width);
    width: 100%;
    margin: 0 auto;
    padding: 3rem 2rem;
}


/* =============================================================================
   HEADER — Layout Shell
   ============================================================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    height: var(--header-height);
    transition: box-shadow var(--transition);
}

/* Drop shadow when user scrolls */
.site-header.is-scrolled {
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

.header-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    height: 100%;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: var(--gap);
}


/* =============================================================================
   HEADER — Logo
   ============================================================================= */

.header-logo a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.header-logo img {
    height: 88px;
    width: auto;
}


/* =============================================================================
   HEADER — Primary Navigation
   ============================================================================= */

.header-nav {
    display: flex;
    justify-content: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-menu li {
    position: relative;
}

.nav-menu > li > a {
    display: block;
    padding: 0.5rem 0.9rem;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
    color: var(--color-text);
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition);
}

.nav-menu > li > a:hover,
.nav-menu > li > a:focus-visible {
    background: rgba(0, 0, 0, 0.05);
    opacity: 1;
}

.nav-menu > .current-menu-item > a,
.nav-menu > .current_page_item > a {
    color: var(--color-accent-dark);
    font-weight: 600;
}

/* --- Dropdown sub-menu --- */

.nav-menu .sub-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 200px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
    z-index: 100;
}

.nav-menu li:hover > .sub-menu,
.nav-menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu .sub-menu li a {
    display: block;
    padding: 0.6rem 1rem;
    font-family: var(--font-ui);
    font-size: 0.875rem;
    text-decoration: none;
    color: var(--color-text);
    transition: background var(--transition);
}

.nav-menu .sub-menu li a:hover {
    background: rgba(0, 0, 0, 0.04);
    opacity: 1;
}

/* Dropdown arrow indicator */
.nav-menu li.menu-item-has-children > a::after {
    content: ' ▾';
    font-size: 0.7em;
    opacity: 0.6;
}


/* =============================================================================
   HEADER — Call Button (CTA)
   ============================================================================= */

.btn-call {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.2rem;
    background: linear-gradient(135deg, #ef1b1f 0%, #f6821f 100%);
    color: #fff !important;
    font-family: var(--font-ui);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-decoration: none;
    border-radius: var(--radius);
    border: 2px solid transparent;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(239, 27, 31, 0.3);
}

.btn-call:hover {
    background: linear-gradient(135deg, #c0171b 0%, #d46c14 100%);
    box-shadow: 0 8px 28px rgba(239, 27, 31, 0.45);
    transform: translateY(-1px);
    opacity: 1;
}

.btn-call:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-call__icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}


/* =============================================================================
   HEADER — Hamburger (mobile toggle)
   ============================================================================= */

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    padding: 0;
    transition: border-color var(--transition);
}

.hamburger:hover {
    border-color: var(--color-text);
}

.hamburger__bar {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
    transform-origin: center;
}

/* Animate to X when open */
.hamburger.is-open .hamburger__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger.is-open .hamburger__bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger.is-open .hamburger__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* =============================================================================
   HEADER — Mobile Navigation Drawer
   ============================================================================= */

.mobile-nav {
    display: none; /* shown only on small screens */
    overflow: hidden;
    max-height: 0;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    transition: max-height 0.3s ease;
}

.mobile-nav.is-open {
    max-height: 80vh;
    overflow-y: auto;
}

.mobile-nav__menu {
    padding: 1rem 1.5rem;
}

.mobile-nav__menu li a {
    display: block;
    padding: 0.75rem 0;
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}

.mobile-nav__menu li:last-child a {
    border-bottom: none;
}

/* Nested items in mobile */
.mobile-nav__menu .sub-menu {
    padding-left: 1rem;
}

.mobile-nav__menu .sub-menu li a {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.btn-call--mobile {
    margin: 1rem 1.5rem 1.5rem;
    justify-content: center;
}


/* =============================================================================
   FOOTER — Shell & Layout
   ============================================================================= */

.site-footer {
    background: var(--color-bg-footer);
    color: var(--color-footer-text);
    font-family: var(--font-ui);
    font-size: 0.875rem;
}


/* =============================================================================
   FOOTER TOP — Brand
   ============================================================================= */

.footer-top {
    padding: 3rem 2rem 2rem;
    max-width: var(--container-width);
    margin: 0 auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.footer-logo img {
    height: 40px;
    width: auto;
    /* Invert dark logo for dark background — remove if logo is already light */
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.footer-tagline {
    font-size: 0.9rem;
    color: var(--color-footer-text);
    font-style: italic;
}


/* =============================================================================
   FOOTER MIDDLE — Four-Column Grid
   ============================================================================= */

.footer-middle {
    padding: 2.5rem 2rem;
    max-width: var(--container-width);
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem;
}

.footer-col__heading {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 1rem;
}

.footer-col__list li {
    margin-bottom: 0.5rem;
}

.footer-col__list a {
    color: var(--color-footer-text);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-col__list a:hover {
    color: var(--color-accent);
    opacity: 1;
}

/* --- Contact column --- */

.footer-contact .footer-contact__item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.footer-contact__icon {
    flex-shrink: 0;
    font-size: 1rem;
    color: var(--color-accent);
    margin-top: 0.1rem;
}

.footer-contact a {
    color: var(--color-footer-text);
    text-decoration: none;
}

.footer-contact a:hover {
    color: var(--color-accent);
    opacity: 1;
}

/* --- Social icons --- */

.footer-social {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--color-footer-text);
    text-decoration: none;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.social-link:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
    opacity: 1;
}


/* =============================================================================
   FOOTER BOTTOM — Copyright Bar
   ============================================================================= */

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding: 1.25rem 2rem;
}

.footer-bottom__inner {
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-copyright {
    color: var(--color-footer-text);
}

.footer-copyright a {
    color: inherit;
    text-decoration: none;
}

.footer-copyright a:hover {
    color: var(--color-accent);
    opacity: 1;
}

.footer-bottom__links {
    display: flex;
    gap: 1.5rem;
}

.footer-bottom__links a {
    color: var(--color-footer-text);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color var(--transition);
}

.footer-bottom__links a:hover {
    color: var(--color-accent);
    opacity: 1;
}


/* =============================================================================
   CONTENT AREA — Entry Styles
   ============================================================================= */

.entry-title {
    font-size: 2rem;
    line-height: 1.3;
    margin-bottom: 1.5rem;
}

.entry-content > * + * {
    margin-top: 1.25rem;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    margin-top: 2rem;
}


/* =============================================================================
   RESPONSIVE — Tablet (max 1024px)
   ============================================================================= */

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}


/* =============================================================================
   RESPONSIVE — Mobile (max 768px)
   ============================================================================= */

@media (max-width: 768px) {

    /* Header: hide desktop nav and CTA, show hamburger */
    .header-inner {
        grid-template-columns: auto 1fr auto;
    }

    .header-nav,
    .header-cta {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .mobile-nav {
        display: block;
    }

    /* Footer adjustments */
    .footer-top {
        padding-top: 2rem;
    }

    .footer-brand {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .footer-bottom__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .site-content {
        padding: 2rem 1.25rem;
    }
}


/* =============================================================================
   UTILITY — Prevent scroll when mobile nav is open
   ============================================================================= */

body.nav-open {
    overflow: hidden;
}
