/*
Theme Name: BRUE Style
Theme URI: https://brue.co.jp/
Author: Trae AI
Author URI: https://trae.ai
Description: A dark, editorial industrial WordPress theme inspired by brue.co.jp. Full-bleed hero, numbered service cards, hairline borders, Manrope typography, and a deep navy accent. Built for WooCommerce product sites.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
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: brue
Tags: e-commerce, full-width-template, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, block-styles, wide-blocks
*/

/* ============================================================
   BRUE-STYLE THEME — Design System
   Palette: ink #25272F · blue #0E7AE0 · ink-dark #151515
   Body: #333 / #666 · surfaces #F5F9FE / #EBEBEB
   Type: Manrope (display+body) · IBM Plex Sans JP (CJK)
   ============================================================ */

:root {
    --ink: #25272F;
    --ink-2: #1C1E26;
    --ink-dark: #151515;
    --blue: #0E7AE0;
    --blue-2: #0B5FB0;
    --white: #ffffff;
    --surface: #F5F9FE;
    --surface-2: #EBEBEB;
    --text: #333333;
    --text-soft: #666666;
    --line: rgba(37, 39, 47, 0.14);
    --line-dark: rgba(255, 255, 255, 0.12);
    --maxw: 1280px;
    --gut: clamp(1.25rem, 4vw, 3rem);
    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 30px;
    --ease: cubic-bezier(0.445, 0.05, 0.55, 0.95);
    --ease-2: cubic-bezier(0.19, 1, 0.22, 1);
    --font-display: 'Manrope', 'IBM Plex Sans JP', 'Yu Gothic', 'Hiragino Sans', sans-serif;
    --font-body: 'Manrope', 'IBM Plex Sans JP', 'Yu Gothic', 'Hiragino Sans', sans-serif;
}

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

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

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.65;
    color: var(--text);
    background: var(--white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color .3s var(--ease); }
a:hover { color: var(--blue); }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
table { border-collapse: collapse; width: 100%; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut); }

/* ----- Typography ----- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.section-eyebrow {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.section-lead {
    font-size: 1rem;
    color: var(--text-soft);
    max-width: 640px;
    margin-top: 1.25rem;
}

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .9rem 1.8rem;
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .02em;
    border-radius: var(--radius);
    transition: all .3s var(--ease-2);
    white-space: nowrap;
}
.btn--blue { background: var(--blue); color: #fff; }
.btn--blue:hover { background: var(--blue-2); color: #fff; transform: translateY(-2px); }
.btn--outline { border: 1px solid var(--ink); color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: #fff; }
.btn--ghost { color: var(--ink); }
.btn--ghost::after { content: "→"; display: inline-block; transition: transform .3s var(--ease); }
.btn--ghost:hover::after { transform: translateX(4px); }

/* ----- Site Header ----- */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(21, 21, 21, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line-dark);
    transition: background .3s var(--ease);
}
.site-header.is-scrolled { background: rgba(21, 21, 21, 0.98); }

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 var(--gut);
}

.site-brand {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.site-brand .brand-dot {
    width: 8px; height: 8px;
    background: var(--blue);
    border-radius: 50%;
    display: inline-block;
}

.main-nav ul { display: flex; align-items: center; gap: 2rem; }
.main-nav a {
    color: rgba(255,255,255,0.78);
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.main-nav a:hover { color: #fff; }

.menu-toggle { display: none; color: #fff; }

/* ----- Hero ----- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--ink-dark);
    color: #fff;
    overflow: hidden;
}
.hero-media {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.hero-slides {
    position: absolute;
    inset: 0;
}
.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.2s var(--ease-2);
}
.hero-slide.is-active { opacity: 1; }
.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-slides.is-single .hero-slide { opacity: 1; position: relative; height: 100%; }
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(21,21,21,0.55) 0%, rgba(21,21,21,0.85) 100%);
    z-index: 2;
}
.hero__inner {
    position: relative;
    z-index: 3;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 var(--gut);
    width: 100%;
}
.hero__title {
    font-size: clamp(2.8rem, 7vw, 5rem);
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.04em;
    max-width: 12ch;
    margin-bottom: 1.5rem;
}
.hero__title em { font-style: normal; color: var(--blue); }
.hero__desc {
    max-width: 520px;
    font-size: 1.05rem;
    color: rgba(255,255,255,0.75);
    margin-bottom: 2.5rem;
}
.hero__cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero__scroll {
    position: absolute;
    bottom: 2rem; left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.6);
    font-size: .75rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    z-index: 3;
}
/* Slideshow dots */
.hero-dots {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: .6rem;
    z-index: 4;
}
.hero-dot {
    width: 28px;
    height: 3px;
    background: rgba(255,255,255,0.35);
    border-radius: 2px;
    transition: background .3s var(--ease);
}
.hero-dot.is-active { background: var(--blue); }

/* ----- Section base ----- */
.section { padding: clamp(4rem, 10vw, 8rem) 0; }
.section--light { background: var(--surface); }
.section--ink { background: var(--ink); color: #fff; }
.section--ink .section-title { color: #fff; }
.section--ink .section-lead { color: rgba(255,255,255,0.7); }

.section-head { margin-bottom: 3rem; max-width: 720px; }

/* ----- Numbered card list (Services / Products) ----- */
.num-list {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--line);
}
.num-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    align-items: center;
    gap: 2rem;
    padding: 2.2rem 0;
    border-bottom: 1px solid var(--line);
    transition: padding .3s var(--ease-2);
}
.num-item:hover { padding-left: 1rem; }
.num-item__no {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--blue);
    letter-spacing: .05em;
}
.num-item__title {
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
}
.num-item__sub {
    font-size: .85rem;
    color: var(--text-soft);
    margin-top: .25rem;
    font-weight: 400;
}
.num-item__arrow {
    width: 44px; height: 44px;
    border: 1px solid var(--line);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--ink);
    transition: all .3s var(--ease);
}
.num-item:hover .num-item__arrow {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

/* ----- Product grid ----- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}
.product-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: transform .3s var(--ease-2), box-shadow .3s var(--ease-2);
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -20px rgba(37,39,47,0.25);
}
.product-card__media {
    aspect-ratio: 4/3;
    background: var(--surface-2);
    overflow: hidden;
}
.product-card__media img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .5s var(--ease-2);
}
.product-card:hover .product-card__media img { transform: scale(1.05); }
.product-card__body { padding: 1.25rem 1.4rem 1.5rem; flex: 1; display: flex; flex-direction: column; }
.product-card__tag {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: .6rem;
}
.product-card__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: .5rem;
}
.product-card__excerpt {
    font-size: .85rem;
    color: var(--text-soft);
    margin-bottom: 1rem;
    flex: 1;
}
.product-card__more {
    font-size: .8rem;
    font-weight: 600;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.product-card__more:hover { color: var(--blue); }

/* ----- Blog / News cards ----- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}
.blog-card { display: flex; flex-direction: column; }
.blog-card__date {
    font-size: .78rem;
    color: var(--text-soft);
    margin: .8rem 0 .4rem;
}
.blog-card__title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.4;
}

/* ----- Spec table (single product) ----- */
.spec-table {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
}
.spec-table__head {
    background: var(--ink);
    color: #fff;
    padding: .9rem 1.5rem;
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: .04em;
}
.spec-table__body table { width: 100%; }
.spec-table__body tr { border-bottom: 1px solid var(--line); }
.spec-table__body tr:last-child { border-bottom: none; }
.spec-table__body th,
.spec-table__body td {
    padding: .85rem 1.5rem;
    text-align: left;
    font-size: .88rem;
}
.spec-table__body th {
    width: 42%;
    font-weight: 400;
    color: var(--text-soft);
}
.spec-table__body td { font-weight: 500; color: var(--ink); }

/* ----- Footer ----- */
.site-footer {
    background: var(--ink-dark);
    color: rgba(255,255,255,0.7);
    padding: 4rem 0 2rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
}
.footer-brand .site-brand { color: #fff; margin-bottom: 1rem; }
.footer-brand p { font-size: .88rem; line-height: 1.7; max-width: 320px; }
.footer-col h4 {
    color: #fff;
    font-size: .8rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    margin-bottom: 1.2rem;
}
.footer-col li { margin-bottom: .55rem; }
.footer-col a {
    font-size: .88rem;
    color: rgba(255,255,255,0.6);
}
.footer-col a:hover { color: var(--blue); }
.footer-bottom {
    border-top: 1px solid var(--line-dark);
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: .78rem;
    color: rgba(255,255,255,0.4);
}

/* ----- Pagination ----- */
.pagination {
    display: flex;
    gap: .5rem;
    justify-content: center;
    margin-top: 3rem;
}
.pagination a, .pagination span {
    min-width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 600;
    color: var(--ink);
    transition: all .2s var(--ease);
}
.pagination a:hover, .pagination .current {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

/* ----- 404 ----- */
.error-404 {
    text-align: center;
    padding: 8rem 0;
}
.error-404__code {
    font-size: clamp(5rem, 18vw, 12rem);
    font-weight: 800;
    line-height: 1;
    color: var(--ink);
    letter-spacing: -0.05em;
}

/* ----- Responsive ----- */
@media (max-width: 860px) {
    .menu-toggle { display: block; font-size: 1.5rem; }
    .main-nav {
        position: fixed;
        top: 64px; left: 0; right: 0;
        background: var(--ink-dark);
        max-height: 0;
        overflow: hidden;
        transition: max-height .3s var(--ease);
    }
    .main-nav.is-open { max-height: 80vh; }
    .main-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 1rem var(--gut); }
    .main-nav li { border-bottom: 1px solid var(--line-dark); }
    .main-nav a { display: block; padding: 1rem 0; }
    .num-item { grid-template-columns: 60px 1fr; }
    .num-item__arrow { display: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
    .hero__cta .btn { width: 100%; justify-content: center; }
}

/* ----- Reveal on scroll ----- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .8s var(--ease-2), transform .8s var(--ease-2);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ----- WooCommerce tweaks ----- */
.woocommerce .woocommerce-breadcrumb { display: none; }
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
    background: var(--blue) !important;
    border-radius: var(--radius) !important;
    font-weight: 600 !important;
}

/* ----- Customizer gallery control preview ----- */
.brue-gallery-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 60px;
    margin: .5rem 0;
}
.brue-gallery-preview.is-empty {
    align-items: center;
    justify-content: center;
    border: 1px dashed #c3c4c7;
    border-radius: 4px;
    color: #8c8f94;
    font-size: .8rem;
}
.brue-gallery-thumb {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    border: 1px solid #dcdcde;
}
.brue-gallery-remove {
    position: absolute;
    top: -6px; right: -6px;
    width: 18px; height: 18px;
    background: #d63638;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
}

/* ----- Skip link ----- */
.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 1000;
    background: var(--blue);
    color: #fff;
    padding: .75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 600;
    transition: top .2s var(--ease);
}
.skip-link:focus {
    top: 1rem;
    color: #fff;
}

/* ----- Focus-visible (keyboard accessibility, WCAG 2.4.7) ----- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ----- Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
}

/* ----- Pagination a11y ----- */
.pagination a[aria-current="page"],
.pagination .current {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

/* ----- Search form ----- */
.search-form {
    display: flex;
    max-width: 480px;
    margin: 1.5rem 0 2rem;
    gap: .5rem;
}
.search-form__input {
    flex: 1;
    padding: .75rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: .9rem;
    font-family: inherit;
    color: var(--text);
    background: #fff;
}
.search-form__input::placeholder { color: var(--text-soft); }
.search-form__submit {
    padding: .75rem 1.5rem;
    background: var(--blue);
    color: #fff;
    border-radius: var(--radius);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .02em;
    transition: background .3s var(--ease);
}
.search-form__submit:hover { background: var(--blue-2); }

/* ----- Comments area ----- */
.comments-area { margin-top: 3rem; }
.comments-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 1.5rem;
    padding-bottom: .75rem;
    border-bottom: 2px solid var(--blue);
    display: inline-block;
}
.comment-list { margin: 1.5rem 0 2rem; }
.comment-list .children { padding-left: 2.5rem; margin-top: 1.5rem; border-left: 1px solid var(--line); }
.comment-body {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--line);
}
.comment-body:last-child { border-bottom: none; }
.comment-meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .6rem;
}
.comment-meta .avatar {
    border-radius: 50%;
    border: 1px solid var(--line);
}
.comment-meta .fn { font-weight: 700; color: var(--ink); font-size: .95rem; }
.comment-meta .says { color: var(--text-soft); font-size: .85rem; }
.comment-metadata a { font-size: .75rem; color: var(--text-soft); }
.comment-content {
    font-size: .92rem;
    line-height: 1.7;
    color: var(--text);
    margin-top: .5rem;
}
.comment-content p { margin-bottom: .75rem; }
.comment-respond { margin-top: 2.5rem; }
.comment-respond .comment-reply-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 1rem;
}
.comment-respond .comment-form-comment,
.comment-respond .comment-form-author,
.comment-respond .comment-form-email,
.comment-respond .comment-form-url {
    margin-bottom: 1rem;
}
.comment-respond label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: .35rem;
    letter-spacing: .02em;
}
.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
    width: 100%;
    padding: .75rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: .9rem;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    transition: border-color .3s var(--ease);
}
.comment-respond input:focus,
.comment-respond textarea:focus { border-color: var(--blue); }
.comment-respond .required { color: #d63638; }
.comment-respond .form-submit { margin-top: 1rem; }
.comment-respond .form-submit .btn { width: 100%; justify-content: center; }
@media (min-width: 600px) {
    .comment-respond .comment-form-author,
    .comment-respond .comment-form-email,
    .comment-respond .comment-form-url {
        width: 48%; display: inline-block; vertical-align: top;
    }
    .comment-respond .comment-form-email { margin-left: 3%; }
    .comment-respond .form-submit .btn { width: auto; }
}

/* ----- Single product responsive ----- */
@media (max-width: 768px) {
    .product-detail-top {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
}

/* ----- Quote modal a11y ----- */
.quote-modal[aria-hidden="false"] { display: flex !important; }
.quote-modal[aria-hidden="true"] { display: none !important; }
.quote-modal__dialog {
    max-height: 90vh;
    overflow-y: auto;
}
