/*
Theme Name: Triaxis Digital
Author: Triaxis Digital
Description: Minimal visual 3D model portfolio and CGTrader showcase.
Version: 2.3.0
Text Domain: traxis-digital
*/

:root {
    --td-black: #101010;
    --td-dark: #171717;
    --td-text: #202020;
    --td-muted: #737373;
    --td-light: #f5f5f3;
    --td-border: #e5e5e2;
    --td-white: #ffffff;
    --td-container: 1240px;
    --td-radius: 18px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--td-white);
    color: var(--td-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

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

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

.td-container {
    width: min(calc(100% - 48px), var(--td-container));
    margin-inline: auto;
}

.td-narrow {
    max-width: 850px;
}

.td-eyebrow {
    margin: 0 0 15px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
    color: var(--td-muted);
}

/* ==================== BUTTONS ==================== */
.td-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 22px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    transition: transform .2s, background .2s;
}

.td-button:hover {
    transform: translateY(-2px);
}

.td-button--dark {
    background: var(--td-black);
    color: white;
}

.td-button--primary {
    background: var(--td-black);
    color: var(--td-white);
}

.td-button--primary:hover {
    background: #2a2a2a;
}

.td-button--secondary {
    background: var(--td-light);
    color: var(--td-black);
    border: 1px solid var(--td-border);
}

.td-button--secondary:hover {
    background: #e0e0e0;
}

.td-button--large {
    padding: 16px 28px;
    font-size: 15px;
}

.td-button--cta {
    flex-shrink: 0;
    white-space: nowrap;
}

.td-button-icon {
    font-size: 18px;
}

.td-button-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.td-button-text strong {
    font-size: 14px;
}

.td-button-text small {
    font-size: 12px;
    opacity: 0.7;
}

/* ==================== HEADER ==================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s, box-shadow .2s;
}

.site-header.is-scrolled {
    border-color: var(--td-border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .05);
}

.site-header__inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 30px;
}

.site-header__brand {
    margin-right: auto;
}

.site-header__title,
.site-footer__title {
    font-size: 19px;
    font-weight: 850;
    text-decoration: none;
    letter-spacing: -.03em;
}

.site-header__logo img {
    max-height: 44px;
    width: auto;
}

.main-navigation__list {
    display: flex;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    text-decoration: none;
    font-size: 14px;
    font-weight: 650;
}

.td-header-link {
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.site-header__menu-toggle {
    display: none;
    border: 0;
    background: none;
    cursor: pointer;
}

.site-header__menu-toggle span {
    display: block;
    width: 23px;
    height: 2px;
    background: currentColor;
    margin: 4px 0;
}

/* ==================== HOME HERO ==================== */
.td-home-hero {
    background: var(--td-light);
    padding: 100px 0;
}

.td-home-hero__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.td-home-hero h1 {
    margin: 0 0 25px;
    max-width: 650px;
    font-size: clamp(45px, 6vw, 76px);
    line-height: 1.02;
    letter-spacing: -.055em;
}

.td-home-hero__text {
    max-width: 570px;
    font-size: 18px;
    color: var(--td-muted);
    margin: 0 0 30px;
}

.td-home-hero__visual {
    border-radius: 28px;
    overflow: hidden;
    background: #e9e9e6;
}

.td-hero-model {
    display: block;
}

.td-hero-model img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform .5s;
}

.td-hero-model:hover img {
    transform: scale(1.025);
}

/* ==================== SECTIONS ==================== */
.td-section {
    padding: 100px 0;
}

.td-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 40px;
}

.td-section-heading h2 {
    margin: 0;
    font-size: clamp(32px, 4vw, 50px);
    line-height: 1.05;
    letter-spacing: -.045em;
}

.td-text-link {
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.td-text-link:hover {
    text-decoration: underline;
}

/* ==================== MODEL GRID ==================== */
.td-model-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.td-model-card {
    background: white;
    border: 1px solid var(--td-border);
    border-radius: var(--td-radius);
    overflow: hidden;
    transition: transform .25s, box-shadow .25s;
}

.td-model-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .08);
}

.td-model-card__image {
    display: block;
    background: var(--td-light);
    overflow: hidden;
}

.td-model-card__image img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .4s;
}

.td-model-card:hover .td-model-card__image img {
    transform: scale(1.035);
}

.td-model-card__body {
    padding: 22px;
}

.td-model-card__title {
    margin: 0 0 8px;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: -.025em;
}

.td-model-card__title a {
    text-decoration: none;
}

.td-model-card__excerpt {
    margin: 0 0 16px;
    color: var(--td-muted);
    font-size: 14px;
}

.td-model-card__link {
    display: inline-flex;
    gap: 8px;
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
}

/* ==================== INTRO SECTION ==================== */
.td-intro-section {
    padding: 110px 0;
    background: var(--td-black);
    color: white;
    text-align: center;
}

.td-intro-section__inner {
    max-width: 800px;
}

.td-intro-section .td-eyebrow {
    color: #aaa;
}

.td-intro-section h2 {
    margin: 0 0 20px;
    font-size: clamp(35px, 5vw, 60px);
    line-height: 1.05;
    letter-spacing: -.05em;
}

.td-intro-section p:last-child {
    color: #aaa;
    font-size: 17px;
}

/* ==================== ARCHIVE HERO ==================== */
.td-archive-hero {
    padding: 90px 0;
    background: var(--td-light);
}

.td-archive-hero h1 {
    margin: 0 0 15px;
    font-size: clamp(45px, 6vw, 72px);
    line-height: 1;
    letter-spacing: -.05em;
}

.td-archive-hero p:last-child {
    margin: 0;
    color: var(--td-muted);
    font-size: 17px;
}

/* ==================== SINGLE MODEL PAGE ==================== */
/* Header Section */
.td-single-model-header {
    padding: 30px 0;
    background: var(--td-white);
    border-bottom: 1px solid var(--td-border);
}

.td-single-model-title-area {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.td-single-model-title-wrapper {
    flex: 1;
    max-width: 700px;
}

.td-single-model-title {
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin: 0 0 15px;
    color: var(--td-black);
}

/* Content Section */
.td-single-model-content {
    padding: 40px 0;
    background: var(--td-light);
}

.td-single-model-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 60px;
    align-items: start;
}

.td-single-model-gallery {
    position: sticky;
    top: 100px;
}

.td-gallery-main {
    border-radius: var(--td-radius);
    overflow: hidden;
    background: var(--td-white);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.td-gallery-slide {
    display: none;
}

.td-gallery-slide.is-active {
    display: block;
}

.td-gallery-slide img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: #f8f8f8;
}

.td-gallery-slide a {
    display: block;
}

.td-gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.td-gallery-thumb {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    background: var(--td-white);
    transition: all 0.2s ease;
    cursor: pointer;
    opacity: 0.7;
}

.td-gallery-thumb:hover,
.td-gallery-thumb.is-active {
    opacity: 1;
    border-color: var(--td-black);
    transform: scale(1.05);
}

.td-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.td-gallery-empty,
.td-image-placeholder {
    display: grid;
    place-items: center;
    background: #e9e9e6;
    color: #999;
    font-size: 50px;
    font-weight: 800;
    aspect-ratio: 4 / 3;
}

/* Sidebar */
.td-single-model-sidebar {
    background: var(--td-white);
    padding: 30px;
    border-radius: var(--td-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    height: fit-content;
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.td-sidebar-cta {
    margin-top: 0;
}

.td-sidebar-excerpt {
    color: var(--td-muted);
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

.td-single-model-meta {
    margin-top: auto;
}

.td-single-model-meta h2 {
    font-size: 16px;
    margin: 0 0 20px;
    color: var(--td-black);
    padding-bottom: 15px;
    border-bottom: 1px solid var(--td-border);
}

.td-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--td-border);
    font-size: 14px;
}

.td-meta-row:last-child {
    border-bottom: none;
}

.td-meta-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--td-muted);
}

.td-meta-value {
    text-align: right;
}

.td-meta-value strong {
    color: var(--td-black);
    font-size: 13px;
}

.td-meta-empty {
    color: var(--td-muted);
    font-size: 13px;
    text-align: center;
    padding: 10px 0;
}

/* Description Section */
.td-single-model-description {
    padding: 60px 0;
    background: var(--td-white);
}

.td-single-model-description h2 {
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin: 0 0 25px;
    color: var(--td-black);
}

/* Related Models Section */
.td-single-model-related {
    padding: 60px 0;
    background: var(--td-light);
}

.td-single-model-related .td-section-heading {
    margin-bottom: 30px;
}

/* ==================== PRODUCT PAGE (Legacy) ==================== */
.td-product-hero {
    padding: 35px 0 100px;
}

.td-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 35px;
    font-size: 12px;
    color: var(--td-muted);
}

.td-breadcrumb a {
    text-decoration: none;
}

.td-breadcrumb strong {
    color: var(--td-text);
    font-weight: 600;
}

.td-product-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(350px, .7fr);
    gap: 70px;
    align-items: start;
}

.td-product-gallery {
    position: sticky;
    top: 105px;
}

.td-product-info {
    padding-top: 20px;
}

.td-product-title {
    margin: 0 0 22px;
    font-size: clamp(40px, 5vw, 64px);
    line-height: 1.02;
    letter-spacing: -.055em;
}

.td-product-intro {
    color: var(--td-muted);
    font-size: 17px;
    margin-bottom: 30px;
}

.td-model-details {
    border-top: 1px solid var(--td-border);
}

.td-model-details h2 {
    font-size: 14px;
    margin: 25px 0 0;
}

.td-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid var(--td-border);
    font-size: 13px;
}

.td-detail-row span {
    color: var(--td-muted);
}

.td-detail-row strong {
    text-align: right;
}

/* ==================== DESCRIPTION ==================== */
.td-model-description {
    padding: 100px 0;
    background: var(--td-light);
}

.td-model-description h2 {
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.05;
    letter-spacing: -.04em;
}

.td-content {
    font-size: 17px;
    line-height: 1.8;
}

.td-content h2,
.td-content h3 {
    line-height: 1.2;
}

.td-content a {
    text-decoration: underline;
}

.td-content-image {
    margin: 40px 0;
    border-radius: 20px;
    overflow: hidden;
}

/* ==================== MORE MODELS ==================== */
.td-more-models {
    background: white;
}

/* ==================== EMPTY STATE ==================== */
.td-empty-state {
    padding: 60px;
    border: 1px dashed var(--td-border);
    border-radius: 20px;
    text-align: center;
    color: var(--td-muted);
}

/* ==================== FOOTER ==================== */
.site-footer {
    padding: 70px 0 30px;
    border-top: 1px solid var(--td-border);
}

.site-footer__main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 60px;
}

.site-footer__description {
    max-width: 400px;
    color: var(--td-muted);
    font-size: 14px;
}

.site-footer__heading {
    margin: 0 0 15px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.site-footer__links {
    display: grid;
    gap: 9px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer__links a {
    color: var(--td-muted);
    text-decoration: none;
    font-size: 14px;
}

.site-footer__bottom {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 60px;
    padding-top: 25px;
    border-top: 1px solid var(--td-border);
    color: var(--td-muted);
    font-size: 12px;
}

/* ==================== PAGINATION ==================== */
.td-pagination {
    display: flex;
    justify-content: center;
    margin-top: 50px;
}

.td-pagination .page-numbers {
    display: inline-flex;
    padding: 9px 13px;
    margin: 3px;
    border: 1px solid var(--td-border);
    border-radius: 8px;
    text-decoration: none;
}

.td-pagination .current {
    background: var(--td-black);
    color: white;
}

/* ==================== ADMIN GALLERY ==================== */
.td-admin-gallery-preview {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.td-admin-gallery-item {
    border: 1px solid #ddd;
    background: #f4f4f4;
}

.td-admin-gallery-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .td-single-model-layout {
        grid-template-columns: 1fr 300px;
        gap: 40px;
    }
}

@media (max-width: 1000px) {
    .td-home-hero__inner {
        grid-template-columns: 1fr;
    }

    .td-product-layout {
        grid-template-columns: 1fr;
    }

    .td-product-gallery {
        position: static;
    }

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

    .site-footer__main {
        grid-template-columns: 1fr 1fr;
    }

    .td-single-model-layout {
        grid-template-columns: 1fr;
    }

    .td-single-model-gallery {
        position: static;
    }

    .td-single-model-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .td-container {
        width: min(calc(100% - 28px), var(--td-container));
    }

    .main-navigation {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 76px;
        padding: 15px 20px;
        background: white;
        border-bottom: 1px solid var(--td-border);
    }

    .main-navigation.is-open {
        display: block;
    }

    .main-navigation__list {
        display: grid;
        gap: 0;
    }

    .main-navigation a {
        display: block;
        padding: 12px 0;
    }

    .site-header__menu-toggle {
        display: block;
    }

    .td-header-link {
        display: none;
    }

    .td-home-hero {
        padding: 65px 0;
    }

    .td-home-hero h1 {
        font-size: 45px;
    }

    .td-section {
        padding: 70px 0;
    }

    .td-section-heading {
        display: block;
    }

    .td-section-heading .td-text-link {
        display: inline-block;
        margin-top: 18px;
    }

    .td-model-grid {
        grid-template-columns: 1fr;
    }

    .td-product-title {
        font-size: 42px;
    }

    .td-single-model-title-area {
        flex-direction: column;
        gap: 20px;
    }

    .td-button--cta {
        width: 100%;
        justify-content: center;
    }

    .td-gallery-thumbnails {
        grid-template-columns: repeat(4, 1fr);
    }

    .site-footer__main {
        grid-template-columns: 1fr;
    }

    .site-footer__bottom {
        display: block;
    }

    .site-footer__bottom > div + div {
        margin-top: 8px;
    }
}

/* ==================== BLOG SECTION ==================== */
.td-blog-section {
    padding: 80px 0;
    background: var(--td-white);
}

.td-blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.td-blog-card {
    background: var(--td-white);
    border: 1px solid var(--td-border);
    border-radius: var(--td-radius);
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s;
}

.td-blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.08);
}

.td-blog-card__image {
    overflow: hidden;
    background: var(--td-light);
}

.td-blog-card__image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.4s;
}

.td-blog-card:hover .td-blog-card__image img {
    transform: scale(1.035);
}

.td-blog-card__body {
    padding: 25px;
}

.td-blog-card__date {
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--td-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.td-blog-card__title {
    margin: 0 0 12px;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.td-blog-card__title a {
    text-decoration: none;
    color: var(--td-black);
}

.td-blog-card__title a:hover {
    color: var(--td-muted);
}

.td-blog-card__excerpt {
    margin: 0 0 15px;
    color: var(--td-muted);
    font-size: 15px;
    line-height: 1.5;
}

.td-blog-card__link {
    display: inline-flex;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    color: var(--td-black);
}

.td-blog-card__link:hover {
    color: var(--td-muted);
}

/* Responsive for Blog Section */
@media (max-width: 1000px) {
    .td-blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .td-blog-grid {
        grid-template-columns: 1fr;
    }
}


/* ==================== BLOG PAGE ==================== */
/* Blog Hero Section */
.td-blog-hero {
    padding: 80px 0;
    background: var(--td-light);
    text-align: center;
}

.td-blog-hero__text {
    max-width: 700px;
    margin: 20px auto 0;
    font-size: 18px;
    color: var(--td-muted);
    line-height: 1.6;
}

/* Blog Section */
.td-blog-section {
    padding: 60px 0;
    background: var(--td-white);
}

/* Blog Grid (already defined in front-page.php, but ensuring consistency) */
.td-blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* Blog Card (already defined in front-page.php, but ensuring consistency) */
.td-blog-card {
    background: var(--td-white);
    border: 1px solid var(--td-border);
    border-radius: var(--td-radius);
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s;
}

.td-blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.08);
}

.td-blog-card__image {
    overflow: hidden;
    background: var(--td-light);
}

.td-blog-card__image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.4s;
}

.td-blog-card:hover .td-blog-card__image img {
    transform: scale(1.035);
}

.td-blog-card__body {
    padding: 25px;
}

.td-blog-card__date {
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--td-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.td-blog-card__title {
    margin: 0 0 12px;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.td-blog-card__title a {
    text-decoration: none;
    color: var(--td-black);
}

.td-blog-card__title a:hover {
    color: var(--td-muted);
}

.td-blog-card__excerpt {
    margin: 0 0 15px;
    color: var(--td-muted);
    font-size: 15px;
    line-height: 1.5;
}

.td-blog-card__link {
    display: inline-flex;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    color: var(--td-black);
}

.td-blog-card__link:hover {
    color: var(--td-muted);
}

/* Responsive for Blog Page */
@media (max-width: 1000px) {
    .td-blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .td-blog-grid {
        grid-template-columns: 1fr;
    }
}