@charset "utf-8";

/*
Theme Name: Sweets Library
Theme URI: https://lesson-challenge.com/
Author: Gon-zalez Bi
Author URI: https://lesson-challenge.com/
Description: A sophisticated library-themed WordPress theme for sweets and confectionery content.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Template: swell
Text Domain: sweets-library
*/

/* ==========================================================================
   CSS Variables & ResetFancy Sweets Palette
   ========================================================================== */
:root {
    /* Primary Colors */
    --color-primary: #4A3B32;
    /* Darker, richer Cocoa */
    --color-primary-light: #6D5446;
    --color-secondary: #C5A059;
    /* Muted Gold for elegance */

    /* Backgrounds */
    --color-bg-body: #FDFBF7;
    /* Cream white like old paper */
    --color-bg-warm: #F4EBE3;
    /* Latte color */
    --color-bg-card: #FFFFFF;

    /* Text */
    --color-text-main: #332822;
    --color-text-sub: #8D7B72;

    /* Borders */
    --color-border: #E6DCCD;

    /* Accents */
    --color-accent-pink: #F8BBD0;
    --color-accent-strong: #EC407A;
    /* For small highlights */

    /* Fonts */
    --font-heading: 'Shippori Mincho', serif;
    /* Japanese Serif */
    --font-en: 'Playfair Display', serif;
    /* English Serif */
    --font-body: 'Noto Sans JP', sans-serif;

    /* Spacing & Layout */
    --layout-width: 1200px;
    /* Slightly tighter for 'book' feel */
    --header-height: 90px;

    /* Links */
    --color-link: #1a73e8;
    /* Standard blue for readability */
    --color-link-hover: #1152a8;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: clip;
}

body {
    font-family: var(--font-body);
    color: var(--color-text-main);
    background-color: var(--color-primary);
    /* Dark brown for the absolute bottom */
    line-height: 1.8;
    letter-spacing: 0.05em;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

#body_wrap {
    background-color: var(--color-bg-body);
    background-image: url('bg-pattern.svg');
    /* Generated Pattern */
    background-size: 120px 120px;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

ul {
    list-style: none;
}

/* ==========================================================================
   Typography Utilities
   ========================================================================== */
.font-en {
    font-family: var(--font-en);
    font-style: italic;
}

.text-center {
    text-align: center;
}

/* Section Titles */
.section-header {
    text-align: center;
    margin-bottom: 80px;
}

.section-subtitle {
    display: block;
    font-family: var(--font-en);
    font-size: 1.1rem;
    color: var(--color-secondary);
    margin-bottom: 10px;
    letter-spacing: 0.1em;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--color-primary);
    position: relative;
    display: inline-block;
    padding-bottom: 20px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background-color: var(--color-secondary);
}

/* ==========================================================================
   Generic Page Layout
   ========================================================================== */
.generic-page-container {
    padding-top: calc(var(--header-height) + 60px);
    padding-bottom: 100px;
    min-height: 80vh;
}

.entry-header {
    text-align: center;
    margin-bottom: 60px;
}

.entry-content {
    background: #FFF;
    padding: 60px;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    line-height: 2;
}

.entry-content h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 10px;
    margin-top: 50px;
    margin-bottom: 30px;
}

.entry-content h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-top: 40px;
    margin-bottom: 20px;
    border-left: 5px solid var(--color-secondary);
    padding-left: 15px;
}

.entry-content p {
    margin-bottom: 20px;
}

/* Content Text Links */
.post_content p a,
.post_content li a,
.entry-content p a,
.entry-content li a,
.about-text p a,
.profile-desc p a {
    color: var(--color-link);
    text-decoration: underline;
    text-decoration-color: rgba(26, 115, 232, 0.4);
    text-underline-offset: 3px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.post_content p a:hover,
.post_content li a:hover,
.entry-content p a:hover,
.entry-content li a:hover,
.about-text p a:hover,
.profile-desc p a:hover {
    color: var(--color-link-hover);
    text-decoration-color: var(--color-link-hover);
}

@media (max-width: 768px) {
    .entry-content {
        padding: 30px 20px;
    }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-more,
.btn-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 40px;
    border: 1px solid var(--color-primary);
    border-radius: 50px;
    background: transparent;
    color: var(--color-primary);
    font-family: var(--font-en);
    font-size: 1.0rem;
    letter-spacing: 0.1em;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-more::before,
.btn-contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    z-index: -1;
}

.btn-more:hover,
.btn-contact:hover {
    color: #FFF;
    border-color: var(--color-primary);
}

.btn-more:hover::before,
.btn-contact:hover::before {
    transform: scaleX(1);
}

/* ==========================================================================
   Header
   ========================================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    z-index: 1000;
    transition: background 0.3s;
    display: flex;
    align-items: center;
}

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

.logo a {
    text-align: left;
    display: block;
}

.logo-main {
    display: block;
    font-family: var(--font-en);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 4px;
    /* Added spacing */
}

.logo-sub {
    font-size: 0.85rem;
    /* Slightly larger */
    color: var(--color-secondary);
    letter-spacing: 0.15em;
    /* Adjusted spacing */
    display: block;
    /* Ensure it starts on new line properly */
}

.nav-list {
    display: flex;
    align-items: center;
}

.nav-item {
    margin: 0;
    /* Remove margin, handle via padding */
    position: relative;
}

/* Vertical Separator */
.nav-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 15px;
    width: 1px;
    background-color: var(--color-border);
}

.nav-item a {
    display: block;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-main);
    position: relative;
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
    transition: color 0.3s, background 0.3s;
}

.nav-item a:hover {
    color: var(--color-primary);
    background-color: rgba(197, 160, 89, 0.1);
    /* Subtle gold bg on hover */
}

.nav-item:last-child {
    margin-left: 20px;
}

.nav-item .btn-contact {
    padding: 10px 25px;
    font-size: 0.95rem;
    background-color: var(--color-primary);
    color: #FFF;
}

.nav-item .btn-contact:hover {
    background-color: var(--color-secondary);
    border-color: var(--color-secondary);
}

/* Mobile Hamburger (Basic Visual) */
.hamburger {
    display: none;
    width: 30px;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-primary);
    margin-bottom: 6px;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    animation: slideShow 24s infinite;
}

/* Ensure first slide is visible immediately if JS/Animation lags */
.hero-slide:nth-child(1) {
    animation-delay: 0s;
    opacity: 1;
    /* Fallback visibility */
}

.hero-slide:nth-child(2) {
    animation-delay: 6s;
}

.hero-slide:nth-child(3) {
    animation-delay: 12s;
}

.hero-slide:nth-child(4) {
    animation-delay: 18s;
}

@keyframes slideShow {
    0% {
        opacity: 0;
        transform: scale(1);
    }

    4% {
        opacity: 1;
        /* Fade in quickly */
    }

    25% {
        opacity: 1;
        /* Stay visible */
    }

    29% {
        opacity: 0;
        /* Fade out */
        transform: scale(1.1);
    }

    100% {
        opacity: 0;
        transform: scale(1);
    }
}

/* Overlay gradient for readability */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 240, 245, 0.8), rgba(255, 255, 255, 0.4));
    z-index: 2;
}

.hero-content {
    text-align: center;
    z-index: 10;
    padding: 0 20px;
    opacity: 0;
    max-width: 100%;
    margin: 0 auto;
    animation: fadeInSlideUp 1s ease-out 0.5s forwards;
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-copy-en {
    font-family: var(--font-en);
    font-size: 1.4rem;
    /* Larger En Text */
    color: var(--color-secondary);
    letter-spacing: 0.2rem;
    margin-bottom: 15px;
    display: block;
}

.hero-copy-jp {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--color-primary);
    line-height: 1.4;
    margin-bottom: 25px;
    text-shadow: 0 4px 10px rgba(255, 255, 255, 0.8);
}

.hero-desc {
    font-size: 1rem;
    color: var(--color-text-sub);
    letter-spacing: 0.1em;
}

.scroll-down {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-en);
    font-size: 0.8rem;
    color: var(--color-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    opacity: 0.7;
}

.scroll-down::after {
    content: '';
    width: 1px;
    height: 60px;
    background: var(--color-primary);
    animation: scrollAnim 2s infinite;
}

@keyframes scrollAnim {
    0% {
        height: 0;
        transform: translateY(0);
        opacity: 0;
    }

    50% {
        height: 60px;
        opacity: 1;
    }

    100% {
        height: 0;
        transform: translateY(60px);
        opacity: 0;
    }
}

/* ==========================================================================
   About Section
   ========================================================================== */
.about {
    padding: 120px 0;
    background: linear-gradient(to bottom, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%);
}

.about-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.about-content {
    display: flex;
    align-items: center;
    gap: 60px;
}

.about-image,
.about-text {
    flex: 1;
}

.about-image {
    position: relative;
}

.about-image img {
    border-radius: 4px;
    box-shadow: 20px 20px 0 var(--color-bg-warm), 0 10px 40px rgba(0, 0, 0, 0.1);
}

.about-text p {
    margin-bottom: 25px;
    font-size: 1.05rem;
    line-height: 2;
    text-align: justify;
}

/* ==========================================================================
   Services (Categories)
   ========================================================================== */
.services {
    padding: 100px 0;
}

/* Services (Categories) with "Book Cover" look */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 50px;
    /* More space for perspective */
    max-width: var(--layout-width);
    margin: 0 auto;
    padding: 0 40px;
}

.service-card {
    background: #FFF;
    /* Light/White Cover */
    padding: 30px 25px 30px 60px;
    /* Increased left padding for spine gap */
    border-radius: 4px 8px 8px 4px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow:
        10px 10px 20px rgba(0, 0, 0, 0.1),
        /* Softer shadow */
        inset 10px 0 20px rgba(0, 0, 0, 0.05),
        /* Subtle spine shadow */
        inset 1px 1px 0px rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Very subtle border */
    border-left: none;
    /* Handled by spine */
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    color: var(--color-text-main);
}

/* Spine Effect - Dark Color to pop */
.service-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 25px;
    background: linear-gradient(to right,
            var(--color-primary) 0%,
            var(--color-primary-light) 50%,
            var(--color-primary) 100%);
    border-radius: 4px 0 0 4px;
    z-index: 1;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
}

/* Paper Pages Effect */
.service-card::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 5px;
    bottom: 5px;
    width: 10px;
    background:
        linear-gradient(to right, #FDFBF7 0%, #E0D4C3 100%);
    border-radius: 0 4px 4px 0;
    z-index: -1;
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    border-left: 1px solid rgba(0, 0, 0, 0.05);
}

.service-card:hover {
    transform: translateY(-5px) translateX(-2px) rotateY(-5deg);
    box-shadow:
        15px 15px 30px rgba(0, 0, 0, 0.15),
        inset 10px 0 20px rgba(0, 0, 0, 0.05);
}

.service-num {
    font-family: var(--font-en);
    font-size: 3rem;
    color: var(--color-secondary);
    font-weight: 700;
    margin-bottom: 20px;
    opacity: 0.5;
    text-shadow: none;
    text-align: right;
    border-bottom: 1px solid rgba(197, 160, 89, 0.2);
    padding-bottom: 5px;
}

.service-card h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--color-primary);
    /* Dark title */
    margin-bottom: 10px;
    border-bottom: none;
    padding-bottom: 0;
    line-height: 1.4;
    text-shadow: none;
}

.service-desc-en {
    font-family: var(--font-en);
    font-size: 0.9rem;
    color: var(--color-secondary);
    margin-bottom: 25px;
    font-style: italic;
    display: block;
    letter-spacing: 0.1em;
}

.service-text {
    font-size: 1rem;
    color: var(--color-text-main);
    line-height: 1.7;
    font-family: var(--font-heading);
}

/* ==========================================================================
   Topics
   ========================================================================== */
.topics {
    padding: 100px 0;
    background: #FFF;
}

.topics-list {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.topic-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.topic-item a {
    display: flex;
    align-items: center;
    padding: 30px 20px;
    gap: 30px;
    transition: background 0.3s;
    border-radius: 4px;
}

.topic-item:hover a {
    background-color: var(--color-bg-warm);
}

.topic-date {
    font-family: var(--font-en);
    color: #999;
    font-size: 0.95rem;
    min-width: 100px;
}

.topic-cat {
    display: inline-block;
    padding: 6px 16px;
    background: #FFF;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    font-size: 0.85rem;
    min-width: 110px;
    text-align: center;
    border-radius: 20px;
}

.topic-title {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 1.1rem;
    flex-grow: 1;
}

/* ==========================================================================
   Search / Tags
   ========================================================================== */
.search-area {
    padding: 100px 0;
    background-color: var(--color-bg-warm);
}

/* Tag Index Styling */
.tag-index-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.tag-top-link {
    text-align: right;
    margin-bottom: 40px;
}

.tag-top-link a {
    display: inline-block;
    color: var(--color-primary);
    font-weight: 700;
    border-bottom: 1px solid var(--color-secondary);
    padding-bottom: 5px;
    font-size: 1rem;
}

.tag-top-link a:hover {
    color: var(--color-secondary);
}

.tag-group {
    margin-bottom: 60px;
}

.tag-group-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: #FFF;
    background-color: var(--color-primary);
    padding: 10px 20px;
    margin-bottom: 30px;
    border-left: 5px solid var(--color-secondary);
    display: flex;
    align-items: center;
}

.tag-group-title::before {
    content: '●';
    margin-right: 15px;
    color: var(--color-secondary);
    font-size: 0.8em;
}

.tag-sub-group {
    margin-bottom: 30px;
}

.tag-sub-group h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--color-secondary);
    /* Changed to Gold to distinguish from links */
    border-bottom: 1px solid rgba(197, 160, 89, 0.3);
    /* Matching border color */
    padding-bottom: 8px;
    margin-bottom: 15px;
    font-weight: 700;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
}

.tag-list span {
    font-size: 0.9rem;
    color: var(--color-text-main);
    padding: 2px 0;
    position: relative;
}

.tag-list a {
    font-size: 0.9rem;
    color: var(--color-link);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: rgba(26, 115, 232, 0.4);
    text-underline-offset: 2px;
    padding: 2px 0;
    position: relative;
    transition: all 0.3s;
}

.tag-list a:hover {
    color: var(--color-link-hover);
    text-decoration-color: var(--color-link-hover);
}

/* Dense list for manufacturers */
.tag-list-dense {
    gap: 8px 15px;
}

.tag-list-dense a,
.tag-list-dense span {
    font-size: 0.85rem;
}

/* Columns removed for better readability as per feedback */
.tag-columns {
    display: block;
}

.tag-column {
    margin-bottom: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    background-color: var(--color-primary);
    color: #FFF;
    padding: 100px 0 30px;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--color-secondary), #FFF, var(--color-secondary));
}

.footer-inner {
    max-width: var(--layout-width);
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 50px;
}

.footer-col {
    flex: 1;
    min-width: 250px;
}

.logo-col .footer-logo {
    font-family: var(--font-en);
    font-size: 2.5rem;
    margin-bottom: 25px;
    color: var(--color-secondary);
}

.links-col h4 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--color-secondary);
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    display: inline-block;
}

.links-col ul li a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.05rem;
    display: block;
    padding: 5px 0;
}

.links-col ul li a:hover {
    color: #FFF;
    padding-left: 5px;
}

/* ==========================================================================
   Profile Section
   ========================================================================== */
.profile {
    background-color: var(--color-bg-light);
    padding: 60px 0;
}

.profile-card {
    background: #FFF;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Bookplate decorative corner */
.profile-card::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    width: 20px;
    height: 20px;
    border-top: 2px solid var(--color-secondary);
    border-left: 2px solid var(--color-secondary);
}

.profile-card::after {
    content: '';
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid var(--color-secondary);
    border-right: 2px solid var(--color-secondary);
}

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

.profile-label {
    font-family: var(--font-en);
    color: var(--color-secondary);
    font-size: 1.0rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.profile-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-top: 5px;
}

.profile-body {
    display: flex;
    align-items: center;
    gap: 40px;
    text-align: left;
    width: 100%;
}

.profile-image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #FFF;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

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

.profile-info {
    flex-grow: 1;
}

.profile-name {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--color-primary);
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

.profile-role {
    font-size: 0.9rem;
    color: var(--color-text-main);
    font-weight: normal;
    margin-left: 10px;
}

.profile-desc {
    font-size: 0.95rem;
    line-height: 1.8;
}

@media (max-width: 600px) {
    .profile-body {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .profile-name {
        justify-content: center;
    }
}

.footer-bottom {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.footer-legal-links {
    margin-bottom: 15px;
}

.footer-legal-links a {
    color: rgba(255, 255, 255, 0.6);
    margin: 0 10px;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-legal-links a:hover {
    color: var(--color-secondary);
}



/* ==========================================================================
   Topics Section (Simplified)
   ========================================================================== */
.topics-list {
    max-width: 800px;
    margin: 0 auto;
}

.topic-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    transition: background-color 0.3s;
}

.topic-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.topic-item a {
    display: block;
    text-decoration: none;
    padding: 10px;
}

.topic-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--color-text-main);
    margin: 0;
    line-height: 1.4;
    transition: color 0.3s;
}

.topic-item a:hover .topic-title {
    color: var(--color-secondary);
}

.view-more-container {
    text-align: center;
    margin-top: 40px;
}

/* Hide Mobile Carousel Nav on Desktop */
.services-carousel-nav {
    display: none;
}

/* Hide mobile line breaks on desktop */
.sp-br {
    display: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
    .about-content {
        flex-direction: column;
    }

    .about-image {
        width: 100%;
        max-width: 500px;
        margin: 0 auto 40px;
    }

    .hero-copy-jp {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .header-inner {
        padding: 0 20px;
    }

    /* Mobile Menu */
    .nav {
        position: fixed;
        top: 70px;
        /* Header height */
        left: 0;
        width: 100%;
        background-color: rgba(255, 255, 255, 0.95);
        padding: 20px 0;
        transform: translateY(-100%);
        transition: transform 0.3s ease-in-out;
        opacity: 0;
        visibility: hidden;
        z-index: 99;
        height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-list {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .nav-item a {
        font-size: 1.1rem;
        color: var(--color-text-main);
    }

    .nav-item .btn-contact {
        margin-top: 10px;
    }

    .hamburger {
        display: block;
        z-index: 100;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* Hero */
    .hero-copy-jp {
        font-size: 2.2rem;
    }

    .hero-copy-en {
        font-size: 1rem;
    }

    .hero-desc {
        font-size: 0.9rem;
    }

    /* Section Titles */
    .section-title {
        font-size: 1.8rem;
        line-height: 1.5;
        /* Add line-height for better spacing when breaking */
    }

    .sp-br {
        display: block;
    }

    .sp-hide {
        display: none;
    }

    /* Services (Categories) Carousel */
    .services-carousel-wrapper {
        position: relative;
        width: 100vw;
        left: 50%;
        transform: translateX(-50%);
    }

    .services-grid {
        display: flex;
        overflow-x: scroll;
        scroll-snap-type: x mandatory;
        gap: 16px;
        padding: 0 calc(12.5vw - 8px);
        /* Centers a ~75% wide card */
        /* Hide scrollbar if desired, though user said OK to leave */
        /* scrollbar-width: none; */
        /* -ms-overflow-style: none; */
    }

    /* .services-grid::-webkit-scrollbar { display: none; } */

    .service-card {
        flex: 0 0 75%;
        max-width: 75%;
        /* Added to prevent overflow */
        scroll-snap-align: center;
        width: 100%;
        /* Force width */
    }

    .service-card h3 {
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        min-height: 2.8em;
        /* Forces height to match 2 lines of text (1.4 line-height * 2) */
    }

    .services-carousel-nav {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 20px;
        margin-top: 25px;
    }

    .carousel-btn {
        background: none;
        border: none;
        font-size: 1.2rem;
        color: var(--color-primary);
        cursor: pointer;
        padding: 5px 15px;
        font-weight: bold;
    }

    .carousel-dots {
        display: flex;
        gap: 10px;
    }

    .carousel-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background-color: var(--color-border);
        cursor: pointer;
        transition: background-color 0.3s;
    }

    .carousel-dot.active {
        background-color: var(--color-secondary);
    }

    /* Footer */
    .footer-inner {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }

    .logo-col,
    .links-col {
        width: 100%;
    }

    .links-col h4 {
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        display: inline-block;
        padding-bottom: 5px;
    }

    .footer-logo {
        text-align: center;
    }

    /* Profile */
    .profile-body {
        flex-direction: column;
    }

    .profile-info {
        text-align: center;
    }

    .profile-name {
        justify-content: center;
        display: flex;
    }

    /* Tag List */
    .tag-group-title {
        font-size: 1.2rem;
    }

    .tag-list,
    .tag-list-dense {
        justify-content: center;
    }
}

/* ==========================================================================
   Global Layout Constraints (Non-Front Pages)
   ========================================================================== */
.sweets-custom-container {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 160px;
    /* Increased to ensure header never overlaps */
    padding-left: 5%;
    padding-right: 5%;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Ensure our container overrides standard SWELL l-content width */
#container {
    max-width: 100% !important;
    flex-grow: 1;
}

/* Fix for columns dropping too early or weird sizing */
@media screen and (min-width: 960px) {
    .sweets-custom-container {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Ensure post content doesn't break out and extends to 1400px */
.l-main,
.l-mainContent,
.archive .l-article,
.archive .l-mainContent {
    max-width: 1400px !important;
    width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
    float: none !important;
}

/* Base post_content overrides */
.post_content {
    max-width: 100% !important;
    width: 100%;
}

/* Larger screen specific layout and font adjustments for articles */
@media screen and (min-width: 960px) {
    .post_content {
        font-size: 1.15rem;
        /* Larger font size for PC */
        line-height: 2.0;
        /* Slightly more breathing room for the text */
    }
}

/* Prevent footer from breaking */
.footer {
    width: 100%;
    clear: both;
}

/* ==========================================================================
   Floating TOC Sidebar
   ========================================================================== */
.toc-layout-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: flex-start;
    width: 100%;
}

.toc-layout-wrapper>.post_content,
.toc-layout-wrapper>.entry-content,
.toc-layout-wrapper>.l-mainContent,
.toc-layout-wrapper>* {
    flex: 1;
    min-width: 0;
}

.toc-layout-wrapper>.floating-toc-sidebar {
    width: 300px;
    flex: 0 0 300px;
}

.floating-toc-sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--header-height, 90px) + 20px);
    max-height: calc(100vh - var(--header-height, 90px) - 40px);
    overflow-y: auto;
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--color-border, #E6DCCD);
}

.floating-toc-title {
    font-family: var(--font-heading, 'Shippori Mincho', serif);
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--color-primary, #4A3B32);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-border, #E6DCCD);
}

.floating-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc-h2;
    font-size: 0.95rem;
}

.floating-toc-item {
    margin-bottom: 4px;
    line-height: 1.4;
    position: relative;
}

.floating-toc-item.is-h2 {
    font-weight: 500;
    counter-increment: toc-h2;
    counter-reset: toc-h3;
}

.floating-toc-item.is-h3 {
    padding-left: 15px;
    font-size: 0.9em;
    counter-increment: toc-h3;
    counter-reset: toc-h4;
}

.floating-toc-item.is-h4 {
    padding-left: 30px;
    font-size: 0.8em;
    color: #999;
    counter-increment: toc-h4;
}

.floating-toc-link {
    display: flex;
    align-items: flex-start;
    color: var(--color-text-sub, #8D7B72);
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 2px 8px;
    border-left: 3px solid transparent;
}

.floating-toc-item.is-h2>.floating-toc-link::before {
    content: counter(toc-h2) ". ";
    font-weight: bold;
    color: var(--color-primary, #4A3B32);
    margin-right: 6px;
    min-width: 1.2em;
}

.floating-toc-item.is-h3>.floating-toc-link::before {
    content: counter(toc-h2) "-" counter(toc-h3) ". ";
    color: #8D7B72;
    margin-right: 6px;
    min-width: 1.8em;
}

.floating-toc-item.is-h4>.floating-toc-link::before {
    content: counter(toc-h2) "-" counter(toc-h3) "-" counter(toc-h4) ". ";
    color: #b0a39c;
    margin-right: 6px;
    min-width: 2.4em;
}

.floating-toc-link:hover {
    color: var(--color-primary, #4A3B32);
    background-color: rgba(74, 59, 50, 0.04);
}

.floating-toc-link.active {
    color: var(--color-primary, #4A3B32);
    border-left: 3px solid var(--color-primary, #4A3B32);
    background-color: rgba(74, 59, 50, 0.08);
    font-weight: bold;
}

@media (max-width: 1190px) {
    .floating-toc-sidebar {
        display: none;
    }

    .toc-layout-wrapper {
        display: block;
    }

    body.has-floating-toc .sweets-custom-container,
    body.has-floating-toc .l-mainContent {
        max-width: 850px !important;
    }
}

@media (min-width: 1191px) {

    body.has-floating-toc .sweets-custom-container,
    body.has-floating-toc .l-mainContent {
        max-width: 1190px !important;
    }
}

/* ---------- Carousel Styles ---------- */
.services-carousel-wrapper {
    position: relative;
    padding-bottom: 40px;
}

.services-carousel-wrapper h3 {
    text-align: center;
}

.services-carousel-nav {
    display: none;
}

.services-grid {
    scrollbar-width: none;
}

.services-grid::-webkit-scrollbar {
    display: none;
}

@media screen and (max-width: 768px) {

    /* Reduce Spacing for Sections on Mobile (Vertical Only) */
    .topics,
    .features,
    .services,
    .search-area,
    .about {
        padding-top: 25px !important;
        padding-bottom: 25px !important;
    }

    .section-header {
        margin-bottom: 20px;
    }

    .section-title {
        font-size: 1.35rem;
        padding-bottom: 8px;
    }

    .section-subtitle {
        margin-bottom: 2px;
        font-size: 0.95rem;
    }

    /* Tag Area Typography for Mobile */
    .tag-group-title {
        font-size: 1.1rem;
        /* Reduced to fit "誕生・由来・流行の時代から探す" on one line */
    }

    /* Carousel Updates */
    .services-grid {
        display: flex;
        align-items: stretch;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 15px;
        justify-content: flex-start;
        padding-bottom: 15px;
        scrollbar-width: thin;
        scrollbar-color: var(--color-secondary) rgba(0, 0, 0, 0.05);
    }

    .services-grid::-webkit-scrollbar {
        height: 4px;
        display: block;
    }

    .services-grid::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
        border-radius: 4px;
    }

    .services-grid::-webkit-scrollbar-thumb {
        background: var(--color-secondary);
        border-radius: 4px;
    }

    .services-grid::after {
        content: '';
        flex: 0 0 1px;
    }

    .service-card {
        flex: 0 0 80%;
        scroll-snap-align: center;
        width: 100%;
    }

    .services-carousel-nav {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 15px;
        margin-top: 15px;
        padding-bottom: 20px;
    }

    .carousel-btn,
    .cream-ctrl-btn {
        background: none;
        border: none;
        color: var(--color-secondary);
        font-size: 1.2rem;
        cursor: pointer;
        padding: 5px 15px;
        opacity: 0.6;
        transition: opacity 0.3s;
    }

    .carousel-btn:active,
    .cream-ctrl-btn:active {
        opacity: 1;
    }

    .cream-ctrl-dots {
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .cream-ctrl-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #E6DCCD;
        transition: background 0.3s, transform 0.3s;
        display: inline-block;
    }

    .cream-ctrl-dot.active {
        background: var(--color-primary);
        transform: scale(1.2);
    }
}

.single-archive-carousel .services-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 20px;
    justify-content: flex-start;
    padding-bottom: 20px;
}

.single-archive-carousel .service-card {
    flex: 0 0 clamp(250px, 40%, 300px);
    scroll-snap-align: center;
}

@media screen and (max-width: 768px) {
    .single-archive-carousel .service-card {
        flex: 0 0 80%;
    }
}

.single-archive-carousel .services-carousel-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}