@charset "utf-8";

/* ============================================
   CSS Reset & Base Styles
   ============================================ */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 68px;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Shippori Mincho", "Yuji Syuku", serif;
    line-height: 1.6;
    color: #2b2926;
    background-color: #f6f1e5;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-family: "Yuji Syuku", serif;
}

p {
    margin: 0;
    font-family: "Shippori Mincho", serif;
}

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

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   Header & Navigation
   ============================================ */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #f6f1e5;
    border-bottom: 1px solid #d4cfc0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 5%, 3rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 58px;
    position: relative;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: clamp(0.5rem, 2%, 1.5rem);
    flex-shrink: 0;
    z-index: 1001;
}

.logo-img {
    width: clamp(1.75rem, 5vw, 2.5rem);
    height: auto;
}

.temple-name {
    font-family: "Yuji Syuku", serif;
    font-size: clamp(1.15rem, 2.7vw, 1.65rem);
    color: #2b2926;
    font-weight: 700;
}

/* Hamburger Menu */
.menu-toggle {
    display: none;
}

/* タップ領域 44x44px 以上を確保 */
.hamburger {
    display: none;
    position: relative;
    width: 44px;
    height: 44px;
    cursor: pointer;
    z-index: 1001;
}

.hamburger::before,
.hamburger::after {
    content: '';
}

/* 3本線 (上: ::before / 中央: span / 下: ::after) */
.hamburger::before,
.hamburger::after,
.hamburger span {
    position: absolute;
    left: 10px;
    width: 24px;
    height: 2px;
    background-color: #2b2926;
    transition: transform 0.3s ease, opacity 0.3s ease, top 0.3s ease;
}

.hamburger::before {
    top: 14px;
}

.hamburger span {
    top: 21px;
}

.hamburger::after {
    top: 28px;
}

/* 開時: 上下の線が×に変形し、中央線は消える */
.menu-toggle:checked ~ .hamburger::before {
    top: 21px;
    transform: rotate(45deg);
}

.menu-toggle:checked ~ .hamburger::after {
    top: 21px;
    transform: rotate(-45deg);
}

.menu-toggle:checked ~ .hamburger span {
    opacity: 0;
}

.menu-toggle:checked ~ .nav {
    display: flex;
}

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

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: clamp(1rem, 3vw, 2.5rem);
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-menu a {
    font-family: "Shippori Mincho", serif;
    font-size: clamp(1rem, 2.2vw, 1.15rem);
    color: #2b2926;
    position: relative;
    transition: color 0.3s ease;
    padding-bottom: 0.25rem;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.nav-menu a:hover {
    color: #a63a32;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #a63a32;
    transition: width 0.3s ease;
}

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

.nav-menu a:focus {
    outline: 2px solid #1c3550;
    outline-offset: 2px;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background-color: #f6f1e5;
        border-bottom: 1px solid #d4cfc0;
        flex-direction: column;
        padding: 1rem 0;
        display: none;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
        width: 100%;
        padding: 0;
        margin: 0;
        align-items: stretch;
    }

    .nav-menu li {
        padding: 0;
    }

    .nav-menu a {
        display: block;
        padding: 1rem clamp(1rem, 5%, 3rem);
        border-bottom: 1px solid #e0d9cc;
        min-height: unset;
        justify-content: flex-start;
    }

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

    .nav-menu a:last-child {
        border-bottom: none;
    }
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
    position: relative;
    height: 100vh;
    height: 100svh;
    background-image: none;
    margin-top: 0;
    padding-top: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-photo {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom, transparent, #f6f1e5);
    pointer-events: none;
    z-index: 10;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(43, 41, 38, 0.5) 0%, rgba(43, 41, 38, 0.3) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 0 clamp(1rem, 5%, 3rem);
}

.hero-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.5rem, 3vh, 2rem);
    font-family: "Yuji Syuku", serif;
}

.hero-subtitle {
    font-size: clamp(1.7rem, 5.5vw, 3.3rem);
    font-weight: 400;
    letter-spacing: 0.1em;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4);
}

.hero-main {
    font-size: clamp(2.3rem, 10.5vw, 5.5rem);
    font-weight: 400;
    letter-spacing: 0.15em;
    text-shadow: 3px 3px 12px rgba(0, 0, 0, 0.5);
}

/* Desktop: Vertical writing */
@media (min-width: 769px) {
    .hero-content {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        padding-right: clamp(2rem, 8%, 4rem);
        height: 100%;
    }

    .hero-title {
        writing-mode: vertical-rl;
        text-orientation: mixed;
        flex-direction: row;
        gap: clamp(1rem, 3vw, 2.5rem);
    }

    .hero-subtitle {
        writing-mode: vertical-rl;
        text-orientation: mixed;
    }

    .hero-main {
        writing-mode: vertical-rl;
        text-orientation: mixed;
    }
}

/* Mobile: PCと同じ写真を切り抜かずに表示し、寺名は写真の下へ */
@media (max-width: 768px) {
    .hero {
        margin-top: 58px;
        padding-top: 0;
        height: auto;
        background-image: none;
        flex-direction: column;
    }

    .hero-photo {
        display: block;
        position: static;
        inset: auto;
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    /* 下端の生成りグラデーションは全画面写真では不使用 */
    .hero::after {
        display: none;
    }

    /* 可読性用スクリム: 下に向かって控えめに暗くなるグラデーション */
    .hero-overlay {
        display: none;
    }

    /* 寺名は写真の下に横書きで配置 */
    .hero-content {
        position: relative;
        width: 100%;
        color: #2b2926;
        padding: 1.5rem 1rem 1rem;
    }

    /* 山号と寺名を横に並べる */
    .hero-title {
        flex-direction: row;
        justify-content: center;
        align-items: baseline;
        writing-mode: horizontal-tb;
        margin: 0;
        gap: clamp(0.6rem, 3vw, 1rem);
    }

    .hero-subtitle {
        writing-mode: horizontal-tb;
        text-orientation: mixed;
        font-size: clamp(1.15rem, 5vw, 1.6rem);
        margin-top: 0;
        text-shadow: none;
    }

    .hero-main {
        writing-mode: horizontal-tb;
        text-orientation: mixed;
        font-size: clamp(2.4rem, 11vw, 3.5rem);
        text-shadow: none;
    }
}

/* ============================================
   Main Container
   ============================================ */

.main-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 5%, 3rem);
}

/* ============================================
   About Section
   ============================================ */

/* 麻の葉風の細線文様(ごく薄く) */
.section-about {
    padding: clamp(3rem, 8vh, 5rem) 0;
    position: relative;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%232b2926' stroke-width='0.6' opacity='0.03'%3E%3Cpath d='M30 0 L60 30 L30 60 L0 30 Z'/%3E%3Cpath d='M30 0 L30 60 M0 30 L60 30'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 60px 60px;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5%, 4rem);
    align-items: center;
}

.about-text {
    font-family: "Shippori Mincho", serif;
    font-size: clamp(1.15rem, 2.2vw, 1.35rem);
    line-height: 1.9;
    color: #2b2926;
}

.about-image {
    margin: 0;
}

.about-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.about-caption {
    margin-top: clamp(0.75rem, 2vh, 1rem);
    text-align: center;
    font-family: "Shippori Mincho", serif;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    letter-spacing: 0.15em;
    color: #1c3550;
}

@media (max-width: 768px) {
    .about-content {
        grid-template-columns: 1fr;
        gap: clamp(1.5rem, 4vh, 2rem);
    }

    .about-text {
        order: 0;
    }

    .section-about {
        padding-top: 1.5rem;
    }

    .about-image {
        order: 1;
    }
}

/* ============================================
   Section Titles
   ============================================ */

.section-title {
    text-align: center;
    font-size: clamp(2rem, 5.5vw, 2.85rem);
    font-family: "Yuji Syuku", serif;
    color: #1c3550;
    margin-bottom: clamp(2rem, 5vh, 3.5rem);
    padding-bottom: 2.2rem;
    position: relative;
}

/* 罫線: タイトル文字の下(padding-bottom領域内)に配置。文字とは重ならない */
.section-title::before {
    content: '';
    position: absolute;
    bottom: 0.7rem;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(8rem, 30%, 14rem);
    height: 1px;
    background-color: #c9c2b2;
}

/* 落款風の朱色の小さな菱形: 罫線の中央に重ねる */
.section-title::after {
    content: '';
    position: absolute;
    bottom: calc(0.7rem - 5px);
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background-color: #a63a32;
}

/* ============================================
   Events Section
   ============================================ */

/* 青海波風の細線文様(ごく薄く) */
.section-events {
    padding: clamp(3rem, 8vh, 5rem) 0;
    position: relative;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40' viewBox='0 0 80 40'%3E%3Cg fill='none' stroke='%231c3550' stroke-width='0.7' opacity='0.03'%3E%3Ccircle cx='40' cy='40' r='36'/%3E%3Ccircle cx='40' cy='40' r='26'/%3E%3Ccircle cx='40' cy='40' r='16'/%3E%3Ccircle cx='0' cy='20' r='36'/%3E%3Ccircle cx='0' cy='20' r='26'/%3E%3Ccircle cx='0' cy='20' r='16'/%3E%3Ccircle cx='80' cy='20' r='36'/%3E%3Ccircle cx='80' cy='20' r='26'/%3E%3Ccircle cx='80' cy='20' r='16'/%3E%3Ccircle cx='40' cy='0' r='36'/%3E%3Ccircle cx='40' cy='0' r='26'/%3E%3Ccircle cx='40' cy='0' r='16'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 80px 40px;
}

/* Scroll animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .fade-in {
        transition: none;
        opacity: 1;
        transform: translateY(0);
    }
}

.event-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5%, 4rem);
    align-items: center;
    margin-bottom: clamp(2.5rem, 6vh, 4rem);
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e0d9cc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.event-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.event-image {
    overflow: hidden;
    border-radius: 0;
    height: 100%;
    min-height: 300px;
}

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

.event-content {
    padding: clamp(1.5rem, 4vw, 2.5rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.event-content h3 {
    font-family: "Yuji Syuku", serif;
    font-size: clamp(1.5rem, 3.4vw, 2rem);
    color: #1c3550;
    margin-bottom: clamp(1rem, 2vh, 1.5rem);
    line-height: 1.4;
}

.event-detail {
    font-family: "Shippori Mincho", serif;
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    line-height: 1.8;
    color: #2b2926;
}

.event-detail p {
    margin: 0;
}

.event-detail strong {
    color: #1c3550;
    font-weight: 700;
}

/* Event Cards - Alternating Layout on Desktop */
.event-1, .event-3 {
    grid-template-columns: 1fr 1fr;
}

.event-2, .event-4 {
    grid-template-columns: 1fr 1fr;
}

.event-2 .event-image,
.event-4 .event-image {
    order: 2;
}

.event-2 .event-content,
.event-4 .event-content {
    order: 1;
}

/* 書の写真(Kaze.jpg)は絶対にトリミングしない: 左右まで全体を常に表示 */
.event-2 .event-image {
    min-height: 0;
    height: auto;
    padding: clamp(0.4rem, 1.2vw, 0.75rem);
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-2 .event-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    .event-card {
        grid-template-columns: 1fr;
        gap: clamp(1rem, 3vh, 1.5rem);
        margin-bottom: clamp(1.5rem, 4vh, 2.5rem);
    }

    .event-image {
        min-height: 250px;
    }

    .event-2 .event-image,
    .event-4 .event-image {
        order: unset;
    }

    .event-2 .event-content,
    .event-4 .event-content {
        order: unset;
    }
}

/* ============================================
   Access Section
   ============================================ */

/* 菱格子の細線文様(ごく薄く) */
.section-access {
    padding: clamp(3rem, 8vh, 5rem) 0;
    position: relative;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%231c3550' stroke-width='0.6' opacity='0.025'%3E%3Cpath d='M36 0 L72 36 L36 72 L0 36 Z'/%3E%3Cpath d='M36 18 L54 36 L36 54 L18 36 Z'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 72px 72px;
}

.access-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5%, 4rem);
    align-items: start;
}

.access-map {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.access-map iframe {
    width: 100%;
    aspect-ratio: 4 / 3;
    border: none;
}

.access-info {
    display: flex;
    flex-direction: column;
    gap: clamp(1.5rem, 3vh, 2.5rem);
}

.info-block {
    background-color: white;
    border: 1px solid #e0d9cc;
    border-radius: 8px;
    padding: clamp(1.5rem, 3vw, 2rem);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.address {
    font-family: "Shippori Mincho", serif;
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    line-height: 1.8;
    color: #2b2926;
}

.tel-link {
    font-family: "Shippori Mincho", serif;
    font-size: clamp(1.2rem, 2.3vw, 1.5rem);
    color: #1c3550;
    font-weight: 700;
    display: inline-block;
    transition: color 0.3s ease;
}

.tel-link:hover {
    color: #a63a32;
}

.access-info-text {
    font-family: "Shippori Mincho", serif;
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    line-height: 1.8;
    color: #2b2926;
}

@media (max-width: 768px) {
    .access-content {
        grid-template-columns: 1fr;
        gap: clamp(1.5rem, 4vh, 2rem);
    }

    .access-map iframe {
        aspect-ratio: 1 / 1;
    }
}

/* ============================================
   Footer
   ============================================ */

.footer {
    background-color: #1c3550;
    color: #f6f1e5;
    text-align: center;
    padding: clamp(2.5rem, 5vh, 3.5rem) clamp(1rem, 5%, 3rem);
    margin-top: clamp(3rem, 8vh, 5rem);
    font-family: "Shippori Mincho", serif;
    font-size: clamp(1rem, 1.7vw, 1.15rem);
    line-height: 1.8;
}

.footer-content {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(246, 241, 229, 0.2);
}

.footer-name {
    font-family: "Yuji Syuku", serif;
    font-size: clamp(1.3rem, 2.7vw, 1.7rem);
    margin: 0 0 0.8rem 0;
    font-weight: 400;
}

.footer-address {
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
    margin: 0 0 0.5rem 0;
    color: rgba(246, 241, 229, 0.95);
}

.footer-tel {
    font-size: clamp(1.05rem, 1.7vw, 1.25rem);
    margin: 0;
}

.footer-tel a {
    color: #b8860b;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 700;
}

.footer-tel a:hover {
    color: #d4af37;
}

.footer-copyright {
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    margin: 0;
    color: rgba(246, 241, 229, 0.8);
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 600px) {
    .header-container {
        height: 50px;
    }

    .temple-name {
        display: none;
    }

    html {
        scroll-padding-top: 50px;
    }

    /* ヘッダーが50pxになるため、ヒーローの開始位置と高さを合わせる */
    .hero {
        margin-top: 50px;
        height: auto;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .header,
    .hero {
        display: none;
    }

    body {
        background-color: white;
    }

    .footer {
        background-color: #f6f1e5;
        color: #2b2926;
        border-top: 1px solid #d4cfc0;
    }
}
