/*
Theme Name: ThemeTailor
Theme URI: https://themetailor.co.za
Author: ThemeTailor
Author URI: https://themetailor.co.za
Description: A bespoke, tailoring-inspired theme for ThemeTailor — custom WordPress development and HTML email solutions. Dark, refined aesthetic with Josefin Sans and Playfair Display typography.
Version: 1.3.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: themetailor
Tags: custom-menu, featured-images, translation-ready, threaded-comments
*/

/* ==========================================================================
   Root variables & resets
   ========================================================================== */
:root {
    --primary: #d4af37;
    --secondary: #b08d5b;
    --accent: #8b7355;
    --dark: #1e1c1a;
    --darker: #141210;
    --light: #ece8e1;
    --grey: #948b7e;
    --border: #35312c;
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--light);
    background: var(--darker);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--primary);
}

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

/* ==========================================================================
   Header & navigation
   ========================================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(13, 13, 13, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
}

.mobile-menu-toggle span {
    width: 28px;
    height: 2px;
    background: var(--primary);
    transition: all 0.3s ease;
    display: block;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

.nav-links {
    display: flex;
    gap: 3rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    font-family: 'Josefin Sans', sans-serif;
    color: var(--light);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 2px;
    position: relative;
    transition: color 0.3s ease;
    text-transform: uppercase;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links li.current-menu-item > a {
    color: var(--primary);
}

.nav-links a:hover::after,
.nav-links li.current-menu-item > a::after {
    width: 100%;
}

/* WordPress menu fallback / sub-menus */
.nav-links .sub-menu {
    list-style: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(13, 13, 13, 0.98);
    border: 1px solid var(--border);
    padding: 0.5rem 0;
    min-width: 200px;
    display: none;
    flex-direction: column;
    gap: 0;
}

.nav-links li {
    position: relative;
}

.nav-links li:hover > .sub-menu {
    display: flex;
}

.nav-links .sub-menu li a {
    padding: 0.6rem 1.5rem;
    display: block;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    padding: 1.2rem 3rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    font-family: 'Josefin Sans', sans-serif;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.btn-primary {
    background: var(--primary);
    color: var(--darker);
}

.btn-primary:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--darker);
    transform: translateY(-2px);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
    margin-top: 80px;
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-bg {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0.35;
    filter: grayscale(100%);
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--darker) 0%, transparent 100%);
}

.hero-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 3rem;
    position: relative;
    z-index: 1;
}

.hero-tag {
    display: inline-block;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 4px;
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 2rem;
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--primary);
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.75rem, 6vw, 4.75rem);
    line-height: 1.1;
    margin-bottom: 2rem;
    font-weight: 700;
    max-width: 900px;
}

.hero h1 .accent {
    color: var(--primary);
    font-style: italic;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--grey);
    max-width: 600px;
    margin-bottom: 1rem;
    font-weight: 300;
    line-height: 1.8;
}

.hero-experience {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 1rem;
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 3px;
    margin-bottom: 3rem;
    text-transform: uppercase;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Scroll-reveal animation

   These hidden/dimmed states are applied ONLY when JavaScript is available.
   The `js` class is added to <html> synchronously in the document head, before
   anything paints. Without this gating the browser paints the content fully
   visible and JavaScript hides it a moment later, which reads as a flash of
   unstyled content. If JS is disabled or fails, everything simply stays visible.
   -------------------------------------------------------------------------- */
.js .hero-tag,
.js .hero h1,
.js .hero-subtitle,
.js .hero-experience,
.js .cta-buttons {
    opacity: 0.3;
}

.js .hero-tag        { transition: opacity 1.5s ease; }
.js .hero h1         { transition: opacity 1.5s ease 0.3s; }
.js .hero-subtitle   { transition: opacity 1.5s ease 0.6s; }
.js .hero-experience { transition: opacity 1.5s ease 0.9s; }
.js .cta-buttons     { transition: opacity 1.5s ease 1.2s; }

.js .hero-tag.visible,
.js .hero h1.visible,
.js .hero-subtitle.visible,
.js .hero-experience.visible,
.js .cta-buttons.visible {
    opacity: 1;
}

.js .service-card,
.js .portfolio-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.4s ease;
}

.js .service-card.is-visible,
.js .portfolio-item.is-visible {
    opacity: 1;
    transform: none;
}

/* Respect users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
    .js .hero-tag,
    .js .hero h1,
    .js .hero-subtitle,
    .js .hero-experience,
    .js .cta-buttons,
    .js .service-card,
    .js .portfolio-item {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ==========================================================================
   Sections shared
   ========================================================================== */
.section-header {
    text-align: center;
    margin-bottom: 6rem;
}

.section-tag {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 4px;
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 1rem;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--light);
}

.section-title .accent {
    color: var(--primary);
    font-style: italic;
}

.section-description {
    font-size: 1.15rem;
    color: var(--grey);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
    font-weight: 300;
}

/* ==========================================================================
   Services
   ========================================================================== */
.services {
    padding: 8rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.service-card {
    background: var(--dark);
    padding: 2.25rem;
    border: 1px solid var(--border);
    position: relative;
    transition: all 0.4s ease;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 0;
    background: var(--primary);
    transition: height 0.4s ease;
}

.service-card:hover {
    border-color: var(--primary);
    transform: translateX(10px);
}

.service-card:hover::before {
    height: 100%;
}

.service-number {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.service-card h3 {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
    color: var(--light);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.service-card p {
    color: var(--grey);
    line-height: 1.7;
    font-weight: 300;
    font-size: 0.9rem;
}

/* ==========================================================================
   Portfolio
   ========================================================================== */
.portfolio {
    padding: 8rem 3rem;
    background: var(--dark);
    position: relative;
}

.portfolio::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border), transparent);
}

.portfolio-container {
    max-width: 1400px;
    margin: 0 auto;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 4rem;
}

/* Portfolio cards share one aspect ratio across the homepage and the archive,
   matching the 1600x860 source images exactly so nothing is cropped. */
.portfolio-item {
    position: relative;
    aspect-ratio: 1600 / 860;
    overflow: hidden;
    background: var(--darker);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.4s ease;
    display: block;
}

.portfolio-item .portfolio-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    opacity: 1;
    transition: transform 0.6s ease;
}

.portfolio-item:hover .portfolio-thumb {
    transform: scale(1.04);
}

.portfolio-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.portfolio-item:hover {
    border-color: var(--primary);
    transform: scale(1.02);
}

.portfolio-item:hover::after {
    opacity: 1;
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(13, 13, 13, 0.96) 0%, rgba(13, 13, 13, 0.75) 45%, rgba(13, 13, 13, 0.35) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2.5rem;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.portfolio-item:hover .portfolio-overlay,
.portfolio-item:focus-visible .portfolio-overlay {
    opacity: 1;
}

/* Items without a featured image keep their details visible,
   otherwise the card would appear empty. */
.portfolio-item.no-thumb .portfolio-overlay {
    opacity: 1;
}

.portfolio-tag {
    display: inline-block;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 3px;
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 1rem;
}

.portfolio-overlay h4 {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 1.8rem;
    color: var(--light);
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.portfolio-overlay p {
    color: var(--grey);
    line-height: 1.6;
    font-weight: 300;
}

.portfolio-cta {
    display: flex;
    justify-content: center;
    margin-top: 4rem;
}

/* ==========================================================================
   Portfolio archive / page hero
   ========================================================================== */
.portfolio-hero {
    margin-top: 80px;
    padding: 8rem 3rem 4rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    position: relative;
}

.portfolio-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--light);
}

.portfolio-hero h1 .accent {
    color: var(--primary);
    font-style: italic;
}

.portfolio-hero p {
    font-size: 1.15rem;
    color: var(--grey);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
    font-weight: 300;
}

.filter-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 3rem auto 0;
    max-width: 1400px;
    padding: 0 3rem;
}

.filter-btn {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--grey);
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.7rem 1.6rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.filter-btn.active {
    color: var(--darker);
    background: var(--primary);
    border-color: var(--primary);
}

.portfolio-archive {
    padding: 4rem 3rem 8rem;
    max-width: 1400px;
    margin: 0 auto;
}

.portfolio-archive .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 0;
}

.portfolio-archive .portfolio-item {
    aspect-ratio: 1600 / 860;
}

.portfolio-archive .portfolio-overlay {
    padding: 1.75rem;
}

.portfolio-archive .portfolio-overlay h4 {
    font-size: 1.25rem;
    letter-spacing: 1px;
}

.portfolio-archive .portfolio-overlay p {
    font-size: 0.9rem;
}

.portfolio-item.hidden {
    display: none;
}

.portfolio-footer-cta {
    text-align: center;
    margin-top: 5rem;
}

/* ==========================================================================
   Contact + Gravity Forms styling
   ========================================================================== */
.contact {
    padding: 8rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.contact-content {
    max-width: 800px;
    margin: 0 auto;
}

.contact-form {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group-details {
    height: 100%;
}

.form-group-details textarea {
    flex: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.form-group input,
.form-group textarea {
    padding: 1rem;
    border: 1px solid var(--border);
    background: var(--dark);
    color: var(--light);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--darker);
}

.form-group textarea {
    resize: vertical;
    min-height: 180px;
}

/* --- Gravity Forms overrides to match theme --- */
.contact-content .gform_wrapper {
    margin-top: 3rem;
}

.contact-content .gform_wrapper form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-content .gform_wrapper .gform_fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    grid-row-gap: 1.5rem;
}

/* First three fields stack in the left column, textarea fills the right */
.contact-content .gform_wrapper .gfield {
    margin: 0;
}

.contact-content .gform_wrapper .gform_fields > .gfield:nth-child(1) { grid-column: 1; grid-row: 1; }
.contact-content .gform_wrapper .gform_fields > .gfield:nth-child(2) { grid-column: 1; grid-row: 2; }
.contact-content .gform_wrapper .gform_fields > .gfield:nth-child(3) { grid-column: 1; grid-row: 3; }
.contact-content .gform_wrapper .gform_fields > .gfield:nth-child(4) {
    grid-column: 2;
    grid-row: 1 / span 3;
    display: flex;
    flex-direction: column;
}

.contact-content .gform_wrapper .gfield_label {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.contact-content .gform_wrapper input[type="text"],
.contact-content .gform_wrapper input[type="email"],
.contact-content .gform_wrapper input[type="tel"],
.contact-content .gform_wrapper input[type="url"],
.contact-content .gform_wrapper textarea,
.contact-content .gform_wrapper select {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border);
    background: var(--dark);
    color: var(--light);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    border-radius: 0;
}

.contact-content .gform_wrapper input:focus,
.contact-content .gform_wrapper textarea:focus,
.contact-content .gform_wrapper select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--darker);
}

.contact-content .gform_wrapper .gfield--type-textarea {
    height: 100%;
}

.contact-content .gform_wrapper textarea {
    resize: vertical;
    min-height: 180px;
    flex: 1;
}

.contact-content .gform_wrapper .gform_footer {
    margin: 0;
    padding: 0;
}

.contact-content .gform_wrapper .gform_footer input[type="submit"],
.contact-content .gform_wrapper .gform_footer button,
#gform_submit_button_1 {
    padding: 1.2rem 3rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    background: var(--primary);
    color: var(--darker);
    font-family: 'Josefin Sans', sans-serif;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.contact-content .gform_wrapper .gform_footer input[type="submit"]:hover,
.contact-content .gform_wrapper .gform_footer button:hover,
#gform_submit_button_1:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
}

.contact-content .gform_wrapper .gfield_required {
    color: var(--primary);
}

.contact-content .gform_wrapper .gfield_description.validation_message,
.contact-content .gform_wrapper .validation_message {
    color: #e0a58c;
    font-size: 0.85rem;
    margin-top: 0.4rem;
}

.contact-content .gform_wrapper .gfield_error input,
.contact-content .gform_wrapper .gfield_error textarea {
    border-color: #c8776a;
}

.contact-content .gform_confirmation_message {
    color: var(--light);
    font-size: 1.15rem;
    text-align: center;
    padding: 2rem;
    border: 1px solid var(--border);
    background: var(--dark);
}

/* ==========================================================================
   Single post & page content
   ========================================================================== */
.content-hero {
    margin-top: 80px;
    padding: 6rem 3rem 3rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.content-hero .entry-meta {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 3px;
    color: var(--primary);
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.content-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 700;
    color: var(--light);
    line-height: 1.2;
}

.entry-featured {
    max-width: 1000px;
    margin: 2rem auto 0;
    padding: 0 3rem;
}

.entry-featured img {
    width: 100%;
    display: block;
    border: 1px solid var(--border);
}

.entry-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 3rem 6rem;
    font-size: 1.1rem;
    color: var(--light);
    line-height: 1.9;
    font-weight: 300;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
    font-family: 'Josefin Sans', sans-serif;
    color: var(--light);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 2.5rem 0 1rem;
}

.entry-content h2 { font-size: 1.6rem; }
.entry-content h3 { font-size: 1.3rem; }

.entry-content p { margin-bottom: 1.5rem; }

.entry-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.entry-content ul,
.entry-content ol {
    margin: 0 0 1.5rem 1.5rem;
    color: var(--grey);
}

.entry-content li { margin-bottom: 0.5rem; }

.entry-content blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--grey);
}

.entry-content img {
    border: 1px solid var(--border);
    margin: 1.5rem 0;
}

.entry-footer {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 3rem 4rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}

.entry-footer .tags a {
    display: inline-block;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--grey);
    border: 1px solid var(--border);
    padding: 0.4rem 1rem;
    margin: 0 0.4rem 0.4rem 0;
    text-decoration: none;
    transition: all 0.3s ease;
}

.entry-footer .tags a:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.post-navigation {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 3rem 6rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.post-navigation a {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--grey);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-navigation a:hover {
    color: var(--primary);
}

/* ==========================================================================
   Comments
   ========================================================================== */
.comments-area {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 3rem 6rem;
}

.comments-area .comments-title {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 1.3rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--light);
    margin-bottom: 2rem;
}

.comment-list {
    list-style: none;
    margin: 0 0 2rem;
    padding: 0;
}

.comment-list li {
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: var(--dark);
}

.comment-author {
    font-family: 'Josefin Sans', sans-serif;
    color: var(--primary);
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.comment-meta {
    font-size: 0.8rem;
    color: var(--grey);
    margin-bottom: 0.8rem;
}

.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border);
    background: var(--dark);
    color: var(--light);
    font-family: 'Inter', sans-serif;
    margin-bottom: 1rem;
}

.comment-respond .form-submit input {
    padding: 1rem 2.5rem;
    background: var(--primary);
    color: var(--darker);
    border: none;
    font-family: 'Josefin Sans', sans-serif;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
}

/* ==========================================================================
   404 page
   ========================================================================== */
.error-404 {
    margin-top: 80px;
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 3rem;
}

.error-404 .error-code {
    font-family: 'Playfair Display', serif;
    font-size: clamp(6rem, 20vw, 12rem);
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    font-style: italic;
}

.error-404 h1 {
    font-family: 'Josefin Sans', sans-serif;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--light);
    margin: 1rem 0 1.5rem;
}

.error-404 p {
    font-size: 1.15rem;
    color: var(--grey);
    max-width: 500px;
    margin: 0 auto 2.5rem;
    font-weight: 300;
    line-height: 1.8;
}

.error-404 .error-search {
    max-width: 400px;
    margin: 0 auto 2.5rem;
    display: flex;
    gap: 0.5rem;
}

.error-404 .error-search input[type="search"] {
    flex: 1;
    padding: 1rem;
    border: 1px solid var(--border);
    background: var(--dark);
    color: var(--light);
    font-family: 'Inter', sans-serif;
}

.error-404 .error-search input[type="search"]:focus {
    outline: none;
    border-color: var(--primary);
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer.site-footer {
    background: var(--dark);
    color: var(--grey);
    padding: 3rem 3rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-logo {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-block;
}

.footer-text {
    font-size: 0.9rem;
    font-weight: 300;
    margin-top: 1rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .portfolio-grid,
    .portfolio-archive .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-archive .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav {
        padding: 1.5rem;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: rgba(13, 13, 13, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 6rem 2rem 2rem;
        gap: 2rem;
        transition: right 0.4s ease;
        border-left: 1px solid var(--border);
        align-items: flex-start;
    }

    .nav-links.active {
        right: 0;
    }

    .hero {
        margin-top: 70px;
    }

    .hero-bg {
        width: 100%;
        opacity: 0.2;
    }

    .hero-content {
        padding: 0 1.5rem;
    }

    .services,
    .portfolio,
    .contact {
        padding: 5rem 1.5rem;
    }

    .form-columns,
    .contact-content .gform_wrapper .gform_fields {
        grid-template-columns: 1fr;
    }

    .contact-content .gform_wrapper .gform_fields > .gfield:nth-child(n) {
        grid-column: 1;
        grid-row: auto;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .btn {
        text-align: center;
    }

    .portfolio-archive .portfolio-grid {
        grid-template-columns: 1fr;
    }

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

/* Genuine touch devices (coarse pointer, no hover) can't reveal on hover,
   so show the project details there. Touchscreen laptops still get hover. */
@media (hover: none) and (pointer: coarse) {
    .portfolio-overlay {
        opacity: 1;
    }
}

@media (max-width: 640px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
	.portfolio-overlay p { display: none; }
	.portfolio-overlay h4 { margin-bottom: 0; line-height: 1.3; }
	.portfolio-archive .portfolio-overlay { padding-bottom: .5rem; }
	.portfolio-overlay { padding-bottom:1rem; }
}
