/* Local Font Definitions */
@font-face {
    font-family: 'IBM Plex Sans JP';
    src: url('./fonts/IBM_Plex_Sans_JP/IBMPlexSansJP-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap; /* FOUT対策 */
}

@font-face {
    font-family: 'DotGothic16';
    src: url('./fonts/DotGothic16/DotGothic16-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap; /* FOUT対策 */
}

/* 必要に応じて他のウェイトやスタイルも同様に追加 */
@font-face {
    font-family: 'IBM Plex Sans JP';
    src: url('./fonts/IBM_Plex_Sans_JP/IBMPlexSansJP-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


/*
Theme Name: EXSENPERC
Author: Yukey
Description: A custom theme for ESP with Material Design influences.
Version: 1.1
*/

:root {
    --primary-color: #8FA8FF; 
    --primary-dark-color: #5c6bc0; /* Material Indigo 300 - Adjusted dark color */
    --accent-color: #ff4081; /* Material Pink A200 */
    --text-color-light: #ffffff;
    --text-color-dark: #212121;
    --background-color: #121212; /* Dark background for space theme */
    --surface-color: #1e1e1e; /* Slightly lighter surface for cards */
    --container-background: rgba(30, 30, 30, 0.85); /* Darker, less transparent container */

    --font-family: 'IBM Plex Sans JP', sans-serif;
    --font-size: 16px;

    --shadow-dp2: 0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2);
    --shadow-dp4: 0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12), 0 2px 4px -1px rgba(0,0,0,0.2);
    --shadow-dp8: 0 8px 10px 1px rgba(0,0,0,0.14), 0 3px 14px 2px rgba(0,0,0,0.12), 0 5px 5px -3px rgba(0,0,0,0.2);
}

body {
    background-color: var(--background-color);
    color: var(--text-color-light);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    font-weight: 400;
    font-size: 16px !important; /* 基本のフォントサイズを明示的に設定 */
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 30px auto;
    padding: 12px;
}

main {
    padding: 24px 0;
}

article {
    background-color: var(--surface-color);
    padding: 24px;
    margin-bottom: 24px;
    border-radius: 6px; /* Softer radius */
    box-shadow: var(--shadow-dp2);
    border-left: none; /* Removed border-left, rely on shadow for depth */
}

article h2 {
    color: var(--primary-color); /* Use primary color for headings */
    border-bottom: 1px solid #8FA8FF;
    padding-bottom: 12px;
    margin-top: 0;
    font-size: 1.8em;
    font-weight: bold;
}

article h2 i {
    color: var(--primary-color); /* Inherit color from h2 */
    margin-right: 0.5em; /* Add some space between icon and text */
}

footer {
    background-color: var(--surface-color);
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1); /* Subtle top shadow */
}

/* Content Grid & Cards */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Adjusted minmax */
    gap: 24px; /* Increased gap */
}

.content-card {
    background-color: var(--surface-color);
    padding: 20px; /* Adjusted padding */
    border-radius: 6px;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.content-card img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 16px; /* Increased margin */
}

.content-card h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 12px; /* Added margin */
    font-size: 1.4em;
    font-weight: 500;
}

.content-card p {
    font-size: 1.0em; /* Adjusted size */
    color: rgba(255,255,255,0.87);
    flex-grow: 1; /* Allows p to take available space */
}
.content-card p.role {
    font-size: 0.85em;
    color: rgba(255,255,255,0.6);
    margin-bottom: 8px;
}

/* Buttons */
.cta-button,
.hero-section a { /* Apply to hero links as well */
    display: inline-block;
    padding: 10px 24px;
    background-color: var(--accent-color);
    color: var(--text-color-light);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-dp2);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    margin: 8px; /* Add some margin */
    border: none;
    cursor: pointer;
}

.cta-button:hover,
.hero-section a:hover {
    background-color: #f50057; /* Darker accent for hover */
    box-shadow: var(--shadow-dp4);
}

.cta-button.secondary,
.hero-section a.secondary {
    background-color: var(--primary-color);
}
.cta-button.secondary:hover,
.hero-section a.secondary:hover {
    background-color: var(--primary-dark-color);
}


.hero-section h1 {
    color: var(--primary-color);
    font-size: 2.8em;
    margin-bottom: 16px;
    font-weight: bold;
}
.hero-section p {
    font-size: 1.1em;
    color: rgba(255,255,255,0.87);
    margin-bottom: 24px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Profile Image */
.profile-image {
    width: 120px; /* Adjusted size */
    height: 120px;
    border-radius: 50%; /* Circular image */
    margin: 0 auto 16px auto; /* Center and add margin */
    display: block;
    object-fit: cover; /* Ensure image covers, might need if placeholder aspect ratio is off */
    box-shadow: var(--shadow-dp2);
}
/* Hero Section Styles */
.hero-section {
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 24px;
    border-radius: 6px;
    box-shadow: var(--shadow-dp2);
    position: relative; /* For absolute positioning of particles and content */
    width: 100%;
    height: 70vh; /* Increased height for better particle effect */
    max-height: 600px; /* Increased max-height */
    overflow: hidden; /* Hide overflowing particles */
    display: flex;
    align-items: center; /* Vertically center content */
    justify-content: flex-start; /* Horizontally align content to the left */
    background-color: rgba(18, 18, 18, 0.7); /* Slightly transparent background */
}
.hero-section-page {
    height: 35vh; /* 半分の高さ */
    max-height: 300px; /* 最大高さを調整 */
}

/* スタイルを .hero-content-page と .page-hero-title に分離 */
.hero-content-page {
    position: relative;
    z-index: 2;
    text-align: left;
    padding-left: 5%;
    max-width: 600px;
    color: #fff;
    padding: 20px;
    border-radius: 8px;
}

.page-hero-title {
    font-family: var(--font-family); /* 基本のフォントファミリーを継承 */
    font-size: 2rem; /* 少し小さめのフォントサイズ */
    font-weight: bold; /* 通常の太さ */
    color: var(--primary-color); /* プライマリーカラーを適用 */
    margin-bottom: 1rem; /* hero-content h1 から流用 */
    text-shadow: none; /* テキストシャドウを削除 */
    visibility: visible; /* 表示状態にする */
    overflow: visible; /* overflowを通常に戻す */
    white-space: normal; /* 通常の折り返し */
    border-right: none; /* タイプライターカーソルを削除 */
    display: block; /* ブロック要素として表示 */
    width: auto; /* 自動幅 */
    animation: none; /* アニメーションを無効化 */
    padding-right: 0; /* 右側のパディングをリセット */
    line-height: normal; /* 行の高さを通常に */
}

/* Three.js canvas styling */
.hero-section canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Behind content */
    pointer-events: none; /* Allow clicks to pass through */
}

#hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: auto;
    height: auto;
    min-width: 100%;
    min-height: 100%;
    transform: translate(-50%, -50%);
    z-index: -1; /* Place video behind content */
    object-fit: cover; /* Cover the entire area, cropping if necessary */
}

.hero-content {
    position: relative; /* Ensure it's above the particles */
    z-index: 2; /* Higher z-index to ensure it's above particles */
    text-align: left; /* Align text to the left */
    padding-left: 5%; /* Adjust as needed for left padding */
    max-width: 600px; /* Constrain content width */
    color: #fff; /* White text for contrast */
    padding: 20px; /* Add padding around content */
    border-radius: 8px; /* Rounded corners */

}

.hero-content h1 {
    font-family: "DotGothic16", sans-serif;
    font-weight: bold;
    font-style: normal;
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    color: var(--primary-color);
    visibility: hidden; /* Initially hidden */
    overflow: hidden; /* Ensures the text is not visible until animation starts */
    white-space: nowrap; /* Keeps the content on a single line for the animation part */
    border-right: .1em solid orange; /* The typewriter cursor, adjust thickness */
    display: inline-block; /* Important for width animation */
    width: 0; /* Initially no width */
    line-height: 1.2; /* Adjust line-height to better fit font */
    padding-right: 0.2em; /* Adjust padding relative to font size */
}

body.fonts-loaded .hero-content h1.typewriter-active {
    visibility: visible;
    /* Let the animation control the width from 0 to its full content width */
    /* width: auto;  Let's rely on the animation to set the width */
    animation: typing 3.5s steps(30, end) forwards, blink-caret .75s step-end infinite;
}

/* The typing effect */
@keyframes typing {
  from { width: 0 }
  to {
    /* Animate to the width calculated by JavaScript */
    width: var(--hero-h1-text-width, 100%); /* Fallback to 100% if var is not set */
  }
}

/* The typewriter cursor effect */
@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: orange; }
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); /* Text shadow for better readability */
}

/* Adjust button styles if necessary */
.hero-content .cta-button {
    margin-right: 10px; /* Add some spacing between buttons */
}

/* Ensure buttons are visible against the video */
.hero-content .cta-button,
.hero-content .cta-button.secondary {
    /* Add or override styles for visibility, e.g., background, border, text color */
    /* Example:
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid #fff;
    color: #fff;
    */
}
/* Responsive styles for .hero-content can remain if they are independent of the header changes */
@media (max-width: 768px) {
    .hero-content {
        padding-left: 3%;
        padding-right: 3%;
    }

    .hero-content h1 {
        font-size: 2.2rem;
        font-weight: bold;
    }

    .hero-content p {
        font-size: 1rem;
    }
}

/* === Header Styles for Bootstrap Navbar === */
nav.navbar {
    box-shadow: var(--shadow-dp4);
    position: sticky;
    top: 0;
    z-index: 1030;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    height: 70px;
    background-color: var(--primary-dark-color);
    opacity: 0.9;
    background: radial-gradient(circle, transparent 20%, #5c6bc0 20%, #5c6bc0 80%, transparent 80%, transparent), radial-gradient(circle, transparent 20%, #5c6bc0 20%, #5c6bc0 80%, transparent 80%, transparent) 10px 10px, linear-gradient(#6c79c6 0.8px, transparent 0.8px) 0 -0.4px, linear-gradient(90deg, #6c79c6 0.8px, #5c6bc0 0.8px) -0.4px 0;
    background-size: 20px 20px, 20px 20px, 10px 10px, 10px 10px;
}

.navbar-brand {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    color: var(--text-color-light);
    font-size: 1.25rem;
    font-weight: 500;
    text-decoration: none;
    margin-left: 2%;
}
.navbar-brand:hover,
.navbar-brand:focus {
    color: var(--text-color-light);
}

.navbar-brand img.custom-logo {
    max-height: 35px;
    width: auto;
    display: block;
}

.navbar-dark .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.1);
}

.navbar-dark .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.5rem 0.75rem;
    font-weight: 500;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: var(--text-color-light);
}

.navbar-dark .navbar-nav .nav-link.active {
    color: var(--text-color-light);
}

.navbar-collapse.collapse.show,
.navbar-collapse.collapsing {
    background-color: var(--surface-color);
}
@media (max-width: 991.98px) {
    .navbar-expand-lg .navbar-collapse {
        background-color: var(--surface-color);
        margin-top: 0.5rem;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    .navbar-expand-lg .navbar-nav .nav-item {
        width: 100%;
        text-align: center;
    }
     .navbar-dark .navbar-nav .nav-link {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
}
/* Row and Column styles for Flexbox grid */
.row {
    display: flex;
    flex-wrap: wrap; /* Allow items to wrap to the next line on smaller screens */
    margin-left: -15px; /* Adjust gutter spacing */
    margin-right: -15px; /* Adjust gutter spacing */
}

/* Basic column styling */
[class^="col-"] {
    position: relative;
    width: 100%;
    padding-right: 15px; /* Gutter spacing */
    padding-left: 15px; /* Gutter spacing */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

/* Column width definitions */
.col-4 {
    flex: 0 0 33.333333%; /* 4/12 = 1/3 */
    max-width: 33.333333%;
}

.col-8 {
    flex: 0 0 66.666667%; /* 8/12 = 2/3 */
    max-width: 66.666667%;
}

/* Adjustments for the specific content card */
/* Override the default content-card flex-direction when used with row */
.content-card.row {
    flex-direction: row; /* Override the column direction */
}

#who-we-are .content-card.row .col-4 {
    display: flex; /* Make image and canvas align */
    flex-direction: column; /* Stack image and canvas vertically within the column */
    align-items: center; /* Center items horizontally */
}

#who-we-are .content-card.row .col-4 img {
    max-width: 100%; /* Ensure image is responsive */
    height: auto;
    margin-bottom: 15px; /* Add space between image and canvas */
}

#who-we-are .content-card.row .col-4 canvas {
    max-width: 100%; /* Ensure canvas is responsive */
    height: auto;
}

/* Canvas identity styling */
.canvas-identity {
    background: white;
    border-radius: 8rem;
    box-shadow: inset 3px 3px 3px rgba(0,0,0,0.2),
                inset -2px -2px 5px rgba(255,255,255,0.7);
}

/* Optional: Add media queries for responsiveness if needed */
@media (max-width: 768px) {
    .col-4,
    .col-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    #who-we-are .content-card.row .col-4 {
        margin-bottom: 20px; /* Add space between columns when stacked */
    }
}

/* Canvas whywedo styling - same as canvas-identity */
.canvas-whywedo {
    background: white;
    border-radius: 8rem;
    box-shadow: inset 3px 3px 3px rgba(0,0,0,0.2),
                inset -2px -2px 5px rgba(255,255,255,0.7);
}
/* Page.php specific styles */
.page-main .content-card {
    max-width: 960px; /* シングルカラムの最大幅 */
    margin-left: auto;
    margin-right: auto;
    padding: 5%;
}

.page-main .entry-header {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--primary-color);
    padding-bottom: 10px;
}

.page-main .entry-title {
    color: var(--primary-color);
    font-size: 2em; /* h1相当のサイズ */
    margin-top: 0;
}

.page-main .post-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 15px;
}

.page-main .entry-content p,
.page-main .entry-content ul,
.page-main .entry-content ol,
.page-main .entry-content blockquote {
    margin-bottom: 1em;
    font-size: 16px;
}

.page-main .entry-content a {
    color: var(--accent-color);
    text-decoration: none;
}

.page-main .entry-content a:hover {
    text-decoration: underline;
}

.page-main .page-links {
    margin-top: 20px;
    margin-bottom: 20px;
    font-weight: bold;
}

.page-main .edit-link a {
    color: var(--accent-color);
    font-size: 0.9em;
}
/* Specific margin for h2 inside div.entry-content */
div.entry-content > h2 {
    margin-top: 40px;
/* モバイル表示時に非表示にするクラス */
@media (max-width: 768px) {
    .hide-on-mobile {
        display: none !important;
    }
}
}