/*
 * Note Affiliate - スタイルシート
 * 参考: Xserver Blog デザイン
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    --key-color: #65c2e9;
    --key-color-dark: #4aa8d0;
    --txt-color: #333333;
    --txt-color-light: #666666;
    --link-color: #848bce;
    --link-hover-color: #6b72b5;
    --bg-color: #f8f9fa;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --max-width: 1200px;
    --sidebar-width: 320px;
    --header-height: 70px;
}

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

html {
    font-size: 62.5%;
    scroll-behavior: smooth;
}

body {
    font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
    font-size: 1.6rem;
    line-height: 1.8;
    color: var(--txt-color);
    background-color: var(--bg-color);
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

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

ul, ol {
    list-style: none;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: var(--white);
    box-shadow: var(--shadow);
    z-index: 1000;
}

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

.site-logo a {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--key-color);
}

.site-logo a:hover {
    color: var(--key-color-dark);
}

.global-nav ul {
    display: flex;
    gap: 30px;
}

.global-nav a {
    color: var(--txt-color);
    font-weight: 500;
    position: relative;
}

.global-nav a::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--key-color);
    transition: width 0.3s ease;
}

.global-nav a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--txt-color);
    transition: transform 0.3s ease;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
    margin-top: var(--header-height);
    padding: 80px 20px;
    background: linear-gradient(135deg, var(--key-color) 0%, #8ed6f0 100%);
    text-align: center;
}

.hero-inner {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.6rem;
    color: var(--white);
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero p {
    font-size: 1.8rem;
    color: var(--white);
    opacity: 0.9;
}

/* ==========================================================================
   Container & Layout
   ========================================================================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    gap: 40px;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
}

/* ==========================================================================
   Section
   ========================================================================== */
.section {
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.4rem;
    color: var(--txt-color);
    margin-bottom: 30px;
    padding-left: 15px;
    border-left: 4px solid var(--key-color);
}

.archive-count {
    font-size: 1.4rem;
    color: var(--txt-color-light);
    margin-top: -20px;
    margin-bottom: 30px;
}

/* ==========================================================================
   Article List
   ========================================================================== */
.article-list {
    display: grid;
    gap: 30px;
}

.article-card {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.article-card a {
    display: flex;
    color: inherit;
}

.article-thumbnail {
    width: 280px;
    flex-shrink: 0;
    overflow: hidden;
}

.article-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .article-thumbnail img {
    transform: scale(1.05);
}

.article-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.article-category {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--key-color);
    color: var(--white);
    font-size: 1.2rem;
    font-weight: 500;
    border-radius: 3px;
    margin-bottom: 10px;
    align-self: flex-start;
}

.article-title {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 10px;
}

.article-excerpt {
    font-size: 1.4rem;
    color: var(--txt-color-light);
    line-height: 1.7;
    margin-bottom: 15px;
    flex-grow: 1;
}

.article-date {
    font-size: 1.3rem;
    color: #999;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 1.5rem;
    font-weight: 500;
    border-radius: var(--radius);
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--key-color);
    color: var(--white);
    border: 2px solid var(--key-color);
}

.btn-primary:hover {
    background-color: var(--key-color-dark);
    border-color: var(--key-color-dark);
    color: var(--white);
}

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

.btn-outline:hover {
    background-color: var(--key-color);
    color: var(--white);
}

.btn-cta {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: var(--white);
    border: none;
    font-size: 1.8rem;
    padding: 18px 50px;
    box-shadow: 0 4px 15px rgba(238, 90, 90, 0.4);
}

.btn-cta:hover {
    background: linear-gradient(135deg, #ff5252 0%, #e04848 100%);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(238, 90, 90, 0.5);
}

/* Affiliate CTA */
.affiliate-cta {
    margin-top: 40px;
    padding: 40px 30px;
    text-align: center;
    background: linear-gradient(135deg, #fff8f0 0%, #fffaf5 50%, #fff5f0 100%);
    border: 3px solid #ff8a65;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(255, 107, 107, 0.15);
}

.affiliate-cta::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b, #ff8a50, #ff6b6b);
    background-size: 200% 100%;
    animation: gradientMove 3s ease infinite;
}

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

.cta-catchcopy {
    font-size: 1.6rem;
    color: #e65100;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cta-catchcopy::before,
.cta-catchcopy::after {
    content: "✦";
    color: #ff8a50;
    font-size: 1.2rem;
}

.cta-description {
    font-size: 1.4rem;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.7;
}

/* CTA Button with Animations */
.btn-cta-animated {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8a50 50%, #ff6347 100%);
    color: var(--white);
    border: none;
    font-size: 1.8rem;
    font-weight: 700;
    padding: 20px 50px;
    border-radius: 50px;
    box-shadow:
        0 6px 20px rgba(255, 107, 107, 0.4),
        0 3px 10px rgba(255, 138, 80, 0.3);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    animation: pulse 2s ease-in-out infinite;
    transition: all 0.3s ease;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            0 6px 20px rgba(255, 107, 107, 0.4),
            0 3px 10px rgba(255, 138, 80, 0.3);
    }
    50% {
        transform: scale(1.03);
        box-shadow:
            0 8px 30px rgba(255, 107, 107, 0.5),
            0 4px 15px rgba(255, 138, 80, 0.4);
    }
}

/* Shimmer Effect */
.btn-cta-animated::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

/* Arrow Icon */
.btn-cta-animated .arrow-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.btn-cta-animated:hover {
    background: linear-gradient(135deg, #ff5252 0%, #ff7043 50%, #ff5722 100%);
    color: var(--white);
    transform: scale(1.08);
    box-shadow:
        0 10px 35px rgba(255, 107, 107, 0.5),
        0 5px 20px rgba(255, 138, 80, 0.4);
    animation: none;
}

.btn-cta-animated:hover .arrow-icon {
    transform: translateX(5px);
}

/* Active state */
.btn-cta-animated:active {
    transform: scale(1.02);
    box-shadow:
        0 4px 15px rgba(255, 107, 107, 0.4),
        0 2px 8px rgba(255, 138, 80, 0.3);
}

.more-link {
    text-align: center;
    margin-top: 30px;
}

/* ==========================================================================
   Sidebar Widgets
   ========================================================================== */
.widget {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 30px;
}

.widget-title {
    font-size: 1.8rem;
    color: var(--txt-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--key-color);
}

/* Profile Widget */
.profile-content {
    text-align: center;
}

.profile-image {
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--key-color);
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.profile-description {
    font-size: 1.4rem;
    color: var(--txt-color-light);
    line-height: 1.7;
}

/* Category Widget */
.category-list li {
    border-bottom: 1px solid var(--border-color);
}

.category-list li:last-child {
    border-bottom: none;
}

.category-list a {
    display: block;
    padding: 12px 0;
    color: var(--txt-color);
    position: relative;
    padding-left: 15px;
}

.category-list a::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--key-color);
    font-weight: 700;
}

.category-list a:hover {
    color: var(--key-color);
}

/* Popular Widget */
.popular-list li {
    margin-bottom: 15px;
}

.popular-list li:last-child {
    margin-bottom: 0;
}

.popular-list a {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--txt-color);
}

.popular-list .rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background-color: var(--key-color);
    color: var(--white);
    font-size: 1.4rem;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

.popular-list li:nth-child(1) .rank {
    background-color: #ffd700;
}

.popular-list li:nth-child(2) .rank {
    background-color: #c0c0c0;
}

.popular-list li:nth-child(3) .rank {
    background-color: #cd7f32;
}

.popular-list .title {
    font-size: 1.4rem;
    line-height: 1.5;
}

.popular-list a:hover .title {
    color: var(--key-color);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background-color: var(--txt-color);
    color: var(--white);
    padding: 40px 20px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
}

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

.footer-nav ul {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.footer-nav a {
    color: var(--white);
    font-size: 1.4rem;
    opacity: 0.8;
}

.footer-nav a:hover {
    opacity: 1;
    color: var(--white);
}

.copyright {
    font-size: 1.3rem;
    opacity: 0.6;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
.sp-only {
    display: none;
}

@media screen and (max-width: 1024px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }
}

/* ==========================================================================
   Breadcrumb
   ========================================================================== */
.breadcrumb {
    margin-top: var(--header-height);
    padding: 15px 20px;
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 1.3rem;
}

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

.breadcrumb li:not(:last-child)::after {
    content: ">";
    margin-left: 8px;
    color: #999;
}

.breadcrumb a {
    color: var(--txt-color-light);
}

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

.breadcrumb li:last-child span {
    color: var(--txt-color);
}

/* ==========================================================================
   Single Article
   ========================================================================== */
.single-article {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.article-header {
    padding: 30px 30px 20px;
}

.article-header .article-category {
    margin-bottom: 15px;
}

.article-header .article-category a {
    color: var(--white);
}

.article-header .article-title {
    font-size: 2.6rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--txt-color-light);
    font-size: 1.4rem;
}

.article-meta svg {
    vertical-align: middle;
    margin-right: 5px;
}

.single-article > .article-thumbnail {
    width: 100%;
    max-height: 500px;
    overflow: hidden;
}

.single-article > .article-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Table of Contents */
.toc {
    margin: 30px;
    padding: 25px;
    background-color: #f5f8fa;
    border-radius: var(--radius);
}

.toc-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-align: center;
}

.toc-list {
    counter-reset: toc;
    padding-left: 0;
}

.toc-list li {
    counter-increment: toc;
    margin-bottom: 10px;
    padding-left: 30px;
    position: relative;
}

.toc-list li::before {
    content: counter(toc) ".";
    position: absolute;
    left: 0;
    color: var(--key-color);
    font-weight: 700;
}

.toc-list a {
    color: var(--txt-color);
}

.toc-list a:hover {
    color: var(--key-color);
}

/* Article Body */
.article-body,
.single-article .article {
    padding: 0 30px 30px;
    font-size: 1.6rem;
    line-height: 2;
}

/* 記事ファイル用ヘッダー */
.single-article .article-header {
    padding: 30px 30px 20px;
}

.single-article .article-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
    font-size: 1.4rem;
    color: var(--txt-color-light);
}

.single-article .article-meta .author {
    font-weight: 500;
}

.single-article .article-meta .author::before {
    content: "著者: ";
    color: #999;
}

.single-article .original-link {
    padding: 5px 12px;
    background-color: var(--key-color);
    color: var(--white);
    border-radius: 3px;
    font-size: 1.2rem;
    text-decoration: none;
}

.single-article .original-link:hover {
    background-color: var(--key-color-dark);
    color: var(--white);
}

.single-article .lead {
    font-size: 1.8rem;
    color: var(--txt-color);
    line-height: 1.9;
    margin-bottom: 2em;
    padding: 20px;
    background-color: #f5f8fa;
    border-radius: var(--radius);
}

.article-body p {
    margin-bottom: 1.5em;
}

.article-body h2 {
    font-size: 2.2rem;
    margin: 2.5em 0 1em;
    padding: 15px 20px;
    background-color: #f5f8fa;
    border-left: 4px solid var(--key-color);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.article-body h3 {
    font-size: 1.8rem;
    margin: 2em 0 1em;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.article-body h4 {
    font-size: 1.6rem;
    margin: 1.5em 0 0.8em;
}

.article-body ul,
.article-body ol {
    margin: 1.5em 0;
    padding-left: 1.5em;
}

.article-body ul {
    list-style: disc;
}

.article-body ol {
    list-style: decimal;
}

.article-body li {
    margin-bottom: 0.5em;
}

.article-body strong {
    color: var(--key-color-dark);
    font-weight: 700;
}

.article-body a {
    text-decoration: underline;
}

/* Box Styles */
.box {
    margin: 2em 0;
    padding: 20px 25px;
    border-radius: var(--radius);
}

.box-title {
    font-weight: 700;
    margin-bottom: 10px;
}

.box ul {
    margin: 0;
}

.box-point {
    background-color: #fff8e5;
    border: 1px solid #ffd54f;
}

.box-point .box-title {
    color: #f57c00;
}

.box-related {
    background-color: #e8f5e9;
    border: 1px solid #81c784;
}

.box-related .box-title {
    color: #388e3c;
}

.box-related a {
    color: var(--txt-color);
}

/* Table */
.comparison-table {
    width: 100%;
    margin: 2em 0;
    border-collapse: collapse;
    font-size: 1.5rem;
}

.comparison-table th,
.comparison-table td {
    padding: 15px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.comparison-table th {
    background-color: var(--key-color);
    color: var(--white);
    font-weight: 500;
}

.comparison-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Article Footer */
.article-footer {
    padding: 30px;
    border-top: 1px solid var(--border-color);
}

.share-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.share-label {
    font-size: 1.4rem;
    font-weight: 500;
    margin-right: 10px;
}

.share-btn {
    display: inline-block;
    padding: 8px 15px;
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--white);
    border-radius: 5px;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.share-btn:hover {
    opacity: 0.8;
    color: var(--white);
}

.share-twitter {
    background-color: #1da1f2;
}

.share-facebook {
    background-color: #1877f2;
}

.share-hatena {
    background-color: #00a4de;
}

.share-line {
    background-color: #00b900;
}

/* ==========================================================================
   Related Posts
   ========================================================================== */
.related-posts {
    margin-top: 40px;
}

.related-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.related-card {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.related-card:hover {
    transform: translateY(-3px);
}

.related-card a {
    display: block;
    color: inherit;
}

.related-thumbnail {
    height: 120px;
    overflow: hidden;
}

.related-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-card:hover .related-thumbnail img {
    transform: scale(1.05);
}

.related-title {
    padding: 15px;
    font-size: 1.4rem;
    font-weight: 500;
    line-height: 1.5;
}

/* ==========================================================================
   Error Page (404)
   ========================================================================== */
.error-page {
    text-align: center;
    padding: 80px 20px;
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.error-page h1 {
    font-size: 10rem;
    color: var(--key-color);
    line-height: 1;
    margin-bottom: 20px;
}

.error-page p {
    font-size: 1.8rem;
    color: var(--txt-color-light);
    margin-bottom: 30px;
}

/* ==========================================================================
   Responsive - Single
   ========================================================================== */
@media screen and (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .sp-only {
        display: inline;
    }

    .global-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: var(--white);
        box-shadow: var(--shadow);
    }

    .global-nav.active {
        display: block;
    }

    .global-nav ul {
        flex-direction: column;
        gap: 0;
    }

    .global-nav li {
        border-bottom: 1px solid var(--border-color);
    }

    .global-nav a {
        display: block;
        padding: 15px 20px;
    }

    .global-nav a::after {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .hero {
        padding: 60px 20px;
    }

    .hero h1 {
        font-size: 2.6rem;
    }

    .hero p {
        font-size: 1.5rem;
    }

    .article-card a {
        flex-direction: column;
    }

    .article-thumbnail {
        width: 100%;
        height: 200px;
    }

    .section-title {
        font-size: 2rem;
    }

    .footer-nav ul {
        flex-direction: column;
        gap: 15px;
    }

    /* Single Article */
    .article-header {
        padding: 20px;
    }

    .article-header .article-title {
        font-size: 2rem;
    }

    .toc {
        margin: 20px;
        padding: 20px;
    }

    .article-body {
        padding: 0 20px 20px;
    }

    .article-body h2 {
        font-size: 1.8rem;
        padding: 12px 15px;
    }

    .article-body h3 {
        font-size: 1.6rem;
    }

    .article-footer {
        padding: 20px;
    }

    .share-buttons {
        justify-content: center;
    }

    .share-label {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }

    .related-list {
        grid-template-columns: 1fr;
    }

    .comparison-table {
        font-size: 1.3rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 10px;
    }
}
