/* ==========================================================================
   Digift Support - メインスタイルシート
   ========================================================================== */

/* --------------------------------------------------
   CSS Variables
   -------------------------------------------------- */
:root {
    --color-primary: #00364d;
    --color-secondary: #0078b6;
    --color-primary-hover: #002e41;
    --color-secondary-hover: #00669b;
    --gradient-button: linear-gradient(135deg, #00364d 0%, #0078b6 100%);
    --gradient-footer: linear-gradient(140deg, #00364d 0%, #0078b6 100%);
    --color-bg-page: #f8fafc;
    --color-bg-card: #ffffff;
    --color-bg-table-header: #f7fafc;
    --color-border: #e2e8f0;
    --color-text-heading: #1a202c;
    --color-text-subheading: #2d3748;
    --color-text-body: #4a5568;
    --color-text-muted: #718096;
    --color-separator: #cbd5e0;
    --font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI',
        Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif,
        'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
        'Noto Color Emoji';
}

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-text-body);
    background-color: var(--color-bg-page);
}

a {
    color: var(--color-text-body);
    text-decoration: none;
    transition: color 0.2s;
}

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

ul, ol {
    list-style: none;
}

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

/* --------------------------------------------------
   Layout
   -------------------------------------------------- */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.container--wide {
    max-width: 1200px;
}

.container--two-column {
    max-width: 1000px;
}

/* --------------------------------------------------
   Header
   -------------------------------------------------- */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-logo a {
    display: flex;
    align-items: center;
}

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

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

.header-search .search-form {
    max-width: 400px;
    width: 100%;
}

.header-contact .btn-contact {
    white-space: nowrap;
}

/* Mobile search toggle (hidden on desktop) */
.header-search-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.5rem;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.header-search-toggle:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

/* --------------------------------------------------
   Search Modal
   -------------------------------------------------- */
.search-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
}

.search-modal.is-open {
    display: block;
}

.search-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.2s ease;
}

.search-modal__content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: var(--color-bg-card);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.25s ease;
}

.search-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.search-modal__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-heading);
}

.search-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0.25rem;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.search-modal__close:hover {
    color: var(--color-text-heading);
}

.search-modal__body {
    padding: 1rem;
}

.search-modal__body .search-form {
    max-width: none;
}

.search-modal__body .search-form__input {
    font-size: 1rem;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* --------------------------------------------------
   Footer
   -------------------------------------------------- */
.site-footer {
    background: var(--gradient-footer);
    color: #ffffff;
    padding: 3rem 0 1.5rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-company {
    font-size: 0.875rem;
}

.footer-company__label {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

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

.footer-links a {
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 400;
    text-decoration: none;
    transition: opacity 0.2s;
}

.footer-links a:hover {
    opacity: 0.8;
    color: #ffffff;
}

.footer-copyright {
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* --------------------------------------------------
   Buttons
   -------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn--primary {
    background: var(--gradient-button);
    color: #ffffff;
}

.btn--primary:hover {
    opacity: 0.9;
    color: #ffffff;
}

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

.btn--outline:hover {
    background: var(--color-primary);
    color: #ffffff;
}

/* --------------------------------------------------
   Search Form
   -------------------------------------------------- */
.search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-form__icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
    width: 1rem;
    height: 1rem;
}

.search-form__icon--clickable {
    pointer-events: auto;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-form__icon--clickable:hover {
    color: var(--color-primary);
}

.search-form__input {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    font-family: var(--font-family);
    font-size: 0.875rem;
    color: var(--color-text-body);
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.search-form__input::placeholder {
    color: var(--color-text-muted);
}

.search-form__input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 54, 77, 0.1);
}

/* Hero search (larger) */
.hero-search .search-form__input {
    padding: 1rem 1.25rem 1rem 3rem;
    font-size: 1rem;
    border-radius: 12px;
}

.hero-search .search-form__icon,
.hero-search .search-form__icon--clickable {
    left: 1rem;
    width: 1.25rem;
    height: 1.25rem;
}

/* --------------------------------------------------
   Hero Section
   -------------------------------------------------- */
.hero {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
}

.hero__title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-heading);
    margin-bottom: 1.5rem;
}

.hero__search {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.hero__search .search-form {
    max-width: 600px;
    width: 100%;
}

.hero__subtitle {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* --------------------------------------------------
   Section
   -------------------------------------------------- */
.section {
    padding: 2.5rem 2rem;
}

.section__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-heading);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}

/* --------------------------------------------------
   Category Grid
   -------------------------------------------------- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.category-card {
    background: var(--color-bg-card);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    text-align: center;
    transition: box-shadow 0.2s, transform 0.2s;
    text-decoration: none;
    display: block;
}

.category-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    color: var(--color-text-body);
}

.category-card__icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: var(--color-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
}

.category-card__name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-subheading);
    margin-bottom: 0.25rem;
}

.category-card__count {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* --------------------------------------------------
   FAQ List
   -------------------------------------------------- */
.faq-list {
    background: var(--color-bg-card);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.faq-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.2s;
    text-decoration: none;
    color: inherit;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item:hover {
    background-color: var(--color-bg-table-header);
}

.faq-item__title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-subheading);
    flex: 1;
}

.faq-item__excerpt {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
    line-height: 1.5;
}

/* --------------------------------------------------
   Category Badge
   -------------------------------------------------- */
.badge {
    display: inline-block;
    background: var(--color-bg-table-header);
    color: var(--color-text-body);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color 0.2s;
}

.badge:hover {
    background: var(--color-border);
    color: var(--color-text-body);
}

/* --------------------------------------------------
   Breadcrumb
   -------------------------------------------------- */
.breadcrumb {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
}

.breadcrumb a {
    color: var(--color-text-body);
    text-decoration: none;
}

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

.breadcrumb__separator {
    margin: 0 0.5rem;
    color: var(--color-separator);
}

.breadcrumb__current {
    color: var(--color-text-muted);
}

/* --------------------------------------------------
   Page Header (Archive / Search)
   -------------------------------------------------- */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-heading);
}

/* --------------------------------------------------
   Single Post (FAQ Detail)
   -------------------------------------------------- */
.single-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.single-main {
    background: var(--color-bg-card);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.single-main__badge {
    margin-bottom: 1rem;
}

.single-main__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-heading);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.single-main__answer-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.single-main__content {
    font-size: 0.875rem;
    line-height: 1.8;
    color: var(--color-text-body);
}

.single-main__content p {
    margin-bottom: 1rem;
}

.single-main__content h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-subheading);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.single-main__content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-subheading);
    margin: 1.5rem 0 0.75rem;
}

.single-main__content ul,
.single-main__content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.single-main__content ul {
    list-style: disc;
}

.single-main__content ol {
    list-style: decimal;
}

.single-main__content li {
    margin-bottom: 0.5rem;
}

.single-main__content img {
    border-radius: 8px;
    margin: 1rem 0;
}

.single-main__content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.single-main__content th,
.single-main__content td {
    border: 1px solid var(--color-border);
    padding: 0.75rem;
    font-size: 0.875rem;
    text-align: left;
}

.single-main__content th {
    background: var(--color-bg-table-header);
    font-weight: 600;
    color: var(--color-text-subheading);
}

/* --------------------------------------------------
   Feedback (Was this helpful?)
   -------------------------------------------------- */
.feedback {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.feedback__question {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-subheading);
    margin-bottom: 0.75rem;
}

.feedback__buttons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.feedback__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-card);
    color: var(--color-text-body);
    cursor: pointer;
    transition: all 0.2s;
}

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

.feedback__btn--yes:hover {
    border-color: #16a34a;
    color: #16a34a;
    background: #f0fdf4;
}

.feedback__btn--no:hover {
    border-color: #dc2626;
    color: #dc2626;
    background: #fef2f2;
}

.feedback__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.feedback__thanks {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    padding: 0.5rem 0;
}

/* --------------------------------------------------
   Sidebar
   -------------------------------------------------- */
.sidebar {
    position: sticky;
    top: 80px;
}

.sidebar__section {
    background: var(--color-bg-card);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.sidebar__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-heading);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-primary);
}

.sidebar__list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sidebar__item {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-subheading);
    text-decoration: none;
    transition: color 0.2s;
    line-height: 1.5;
}

.sidebar__item:last-child {
    border-bottom: none;
}

.sidebar__item:hover {
    color: var(--color-primary);
}

/* --------------------------------------------------
   Pagination
   -------------------------------------------------- */
.pagination,
.nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination .page-numbers,
.nav-links .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--color-text-body);
    text-decoration: none;
    transition: all 0.2s;
}

.pagination .page-numbers:hover,
.nav-links .page-numbers:hover {
    background: var(--color-bg-table-header);
}

.pagination .page-numbers.current,
.nav-links .page-numbers.current {
    background: var(--gradient-button);
    color: #ffffff;
}

.pagination .page-numbers.prev,
.pagination .page-numbers.next,
.nav-links .page-numbers.prev,
.nav-links .page-numbers.next {
    width: auto;
    padding: 0 0.75rem;
}

/* --------------------------------------------------
   No Results
   -------------------------------------------------- */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
}

.no-results__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-heading);
    margin-bottom: 0.75rem;
}

.no-results__message {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

/* --------------------------------------------------
   404
   -------------------------------------------------- */
.page-404 {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.page-404__title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-heading);
    margin-bottom: 1rem;
}

.page-404__message {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.page-404__search {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.page-404__search .search-form {
    max-width: 400px;
    width: 100%;
}

/* --------------------------------------------------
   Responsive (768px and below)
   -------------------------------------------------- */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }

    .header-inner {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }

    .header-search--desktop {
        display: none;
    }

    .header-search-toggle {
        display: flex;
        margin-left: auto;
    }

    .hero {
        padding: 2rem 1rem;
    }

    .hero__title {
        font-size: 1.5rem;
    }

    .section {
        padding: 1.5rem 1rem;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .category-card {
        padding: 1rem;
    }

    .single-layout {
        grid-template-columns: 1fr;
        padding: 1.5rem 1rem;
    }

    .sidebar {
        position: static;
    }

    .single-main {
        padding: 1.5rem;
    }

    .single-main__title {
        font-size: 1.25rem;
    }

    .footer-content {
        flex-direction: column-reverse;
        align-items: center;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    .faq-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}