/*
Theme Name: Custom Theme
Description: カスタムWordPressテーマ
Version: 1.0
*/

:root {
    --primary: #8b5cf6;
    --secondary: #ec4899;
    --gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #ffffff;
    --bg-dark: #f3f4f6;
}

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

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

/* ========== Header ========== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(-45deg, #000000, #1a1a2e, #16213e, #0f0f23);
    background-size: 400% 400%;
    animation: headerGradient 15s ease infinite;
    z-index: 1000;
    border-bottom: 1px solid rgba(139, 92, 246, 0.3);
}

@keyframes headerGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    align-items: center;
}

.header-inner.left {
    justify-content: flex-start;
}

.header-inner.center {
    justify-content: center;
}

.site-logo a {
    text-decoration: none;
    display: block;
}

.site-logo img {
    height: var(--logo-height, 40px);
    width: auto;
    display: block;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========== Main ========== */
.site-main {
    padding-top: 70px;
}

/* ========== Carousel ========== */
.carousel-section {
    background: var(--bg-dark);
    position: relative;
}

.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-viewport {
    overflow: hidden;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-slide {
    flex: 0 0 33.333%;
    min-width: 33.333%;
    padding: 0;
}

/* 1個の場合 */
.carousel-track[data-count="1"] .carousel-slide {
    flex: 0 0 100%;
    min-width: 100%;
}

/* 2個の場合 */
.carousel-track[data-count="2"] .carousel-slide {
    flex: 0 0 50%;
    min-width: 50%;
}

.carousel-slide a {
    display: block;
}

.carousel-slide img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.carousel-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    padding: 20px;
    text-align: center;
}

/* ドット - 画像の上に重ねる */
.carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.5);
}

.carousel-dot.active {
    background: #fff;
    transform: scale(1.2);
}

.carousel-size-note {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-light);
    padding: 10px 0;
    display: none;
}

body.logged-in .carousel-size-note {
    display: block;
}

/* Carousel Tablet */
@media (max-width: 1024px) {
    .carousel-slide {
        flex: 0 0 50%;
        min-width: 50%;
    }
    
    .carousel-track[data-count="1"] .carousel-slide {
        flex: 0 0 100%;
        min-width: 100%;
    }
}

/* Carousel Mobile */
@media (max-width: 768px) {
    .carousel-slide {
        flex: 0 0 100%;
        min-width: 100%;
    }
    
    .carousel-track[data-count="1"] .carousel-slide,
    .carousel-track[data-count="2"] .carousel-slide {
        flex: 0 0 100%;
        min-width: 100%;
    }
    
    .carousel-dots {
        bottom: 10px;
    }
    
    .carousel-dot {
        width: 10px;
        height: 10px;
    }
}

/* ========== Custom HTML Area ========== */
.custom-html-area {
    width: 100%;
}

.custom-html-area img {
    max-width: 100%;
    height: auto;
}

/* ========== Native Section ========== */
.native-section {
    padding: 30px 20px;
    background: var(--bg);
}

.native-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.native-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.native-card {
    width: calc(25% - 12px);
    background: var(--bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s, box-shadow 0.3s;
}

.native-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.12);
}

.native-card a {
    text-decoration: none;
    display: block;
}

.native-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-dark);
}

.native-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.native-card:hover .native-thumb img {
    transform: scale(1.05);
}

.native-no-thumb {
    width: 100%;
    height: 100%;
    background: var(--gradient);
    opacity: 0.2;
}

/* ========== Archive ========== */
.archive-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.archive-header {
    margin-bottom: 30px;
    text-align: center;
}

.archive-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.archive-description {
    color: var(--text-light);
    font-size: 0.95rem;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.archive-card {
    background: var(--bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s, box-shadow 0.3s;
}

.archive-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.12);
}

.archive-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.archive-thumb {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-dark);
}

.archive-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.archive-card:hover .archive-thumb img {
    transform: scale(1.05);
}

.archive-no-thumb {
    width: 100%;
    height: 100%;
    background: var(--gradient);
    opacity: 0.2;
}

.archive-body {
    padding: 15px;
}

.archive-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.archive-date {
    font-size: 0.8rem;
    color: var(--text-light);
}

.no-posts {
    text-align: center;
    color: var(--text-light);
    padding: 60px 20px;
}

/* Pagination */
.pagination {
    margin-top: 40px;
    text-align: center;
}

.pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    text-decoration: none;
}

.pagination a {
    background: var(--bg-dark);
    color: var(--text);
    transition: background 0.2s, color 0.2s;
}

.pagination a:hover {
    background: var(--primary);
    color: #fff;
}

.pagination .current {
    background: var(--primary);
    color: #fff;
}

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

@media (max-width: 768px) {
    .archive-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .archive-container {
        padding: 20px 15px;
    }
    
    .archive-title {
        font-size: 1.4rem;
    }
    
    .archive-card-title {
        font-size: 0.85rem;
    }
}

/* ========== Page Article ========== */
.page-article {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.page-header {
    margin-bottom: 30px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.4;
}

.page-content {
    font-size: 1rem;
    line-height: 1.9;
}

.page-content p {
    margin-bottom: 1.5em;
}

.page-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 2em 0 1em;
    padding-left: 15px;
    border-left: 4px solid var(--primary);
}

.page-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 1.8em 0 0.8em;
}

.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.page-content a {
    color: var(--primary);
}

/* ========== Breadcrumb ========== */
.breadcrumb {
    max-width: 800px;
    margin: 0 auto 20px;
    padding: 15px 20px 0;
    font-size: 0.8rem;
}

.breadcrumb-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
    content: '>';
    margin-left: 8px;
    color: var(--text-light);
}

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

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.current {
    color: var(--text-light);
}

/* ========== Single Article ========== */
.single-article {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.single-header {
    margin-bottom: 30px;
}

.single-cat {
    display: inline-block;
    padding: 5px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: var(--gradient);
    border-radius: 20px;
    text-decoration: none;
    margin-bottom: 15px;
}

.single-title {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 15px;
}

.single-meta {
    font-size: 0.85rem;
    color: var(--text-light);
}

.single-thumbnail {
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
}

.single-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.single-content {
    font-size: 1rem;
    line-height: 1.9;
}

.single-content p {
    margin-bottom: 1.5em;
}

.single-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 2em 0 1em;
    padding-left: 15px;
    border-left: 4px solid var(--primary);
}

.single-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 1.8em 0 0.8em;
}

.single-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.single-content a {
    color: var(--primary);
}

.single-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--bg-dark);
}

.single-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-link {
    padding: 6px 12px;
    font-size: 0.8rem;
    color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s;
}

.tag-link:hover {
    background: rgba(139, 92, 246, 0.2);
}

/* ========== Footer ========== */
.site-footer {
    background: #000;
    padding: 40px 20px 25px;
    text-align: center;
}

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

.footer-logo {
    margin-bottom: 20px;
}

.footer-logo img {
    height: var(--footer-logo-height, 50px);
    width: auto;
}

.footer-text {
    font-size: 0.9rem;
    color: #fff;
    margin-bottom: 20px;
}

.footer-nav {
    margin-bottom: 25px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 25px;
}

.footer-links li a {
    color: #ccc;
    text-decoration: none;
    font-size: var(--footer-link-size, 13px);
    transition: color 0.2s;
}

.footer-links li a:hover {
    color: #fff;
}

.copyright {
    font-size: 0.75rem;
    color: #666;
}

/* ========== Responsive - Tablet ========== */
@media (max-width: 1024px) {
    .native-card {
        width: calc(50% - 8px);
    }
}

/* ========== Responsive - Mobile ========== */
@media (max-width: 768px) {
    .native-section {
        padding: 15px 10px;
    }
    
    .native-grid {
        gap: 10px;
    }
    
    .native-card {
        width: calc(50% - 5px);
    }
}