/*
Theme Name: FarmMonica
Theme URI: https://start.smartfarmas.com
Author: FARMMONICA
Description: 팜모니카 스마트팜창업 공식 웹사이트 커스텀 테마
Version: 1.0.0
Text Domain: farmmonica
*/

/* ---------- tokens ---------- */
:root {
    --fm-bg: #FDFDFD;
    --fm-bg-sub: #E8ECEB;
    --fm-accent: #006241;
    --fm-accent-sub: #74A9C1;
    --fm-text: #2C3331;
    --fm-radius: 12px;
    --fm-gap: 24px;
    --fm-section-gap: 48px;
    --fm-header-h: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
    background: var(--fm-bg);
    color: var(--fm-text);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 { font-weight: 700; margin: 0; line-height: 1.35; }
h1 { font-size: 29px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }

.fm-container { max-width: 1120px; margin: 0 auto; padding: 0 var(--fm-gap); }
.fm-section { padding: var(--fm-section-gap) 0; }
.fm-section-sub { background: var(--fm-bg-sub); }
.fm-eyebrow { display: block; font-size: 13px; letter-spacing: .08em; color: var(--fm-accent-sub); font-weight: 700; text-transform: uppercase; margin-bottom: 8px; }
.fm-section-head { text-align: center; margin-bottom: 32px; }
.fm-section-head h2 { margin-bottom: 12px; }
.fm-section-head .fm-subtitle { font-weight: 400; color: var(--fm-text); opacity: .75; }

.fm-icon { width: 24px; height: 24px; flex: none; color: var(--fm-accent); }

/* ---------- buttons ---------- */
.fm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    border: 2px solid transparent;
    white-space: nowrap;
}
.fm-btn .fm-icon { width: 20px; height: 20px; color: currentColor; }
.fm-btn-primary { background: var(--fm-accent); color: #fff; }
.fm-btn-outline { background: transparent; color: var(--fm-accent); border-color: var(--fm-accent); }
.fm-cta-buttons { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- header ---------- */
.fm-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--fm-bg);
    border-bottom: 1px solid var(--fm-bg-sub);
    height: var(--fm-header-h);
}
.fm-header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.fm-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--fm-text); }
.fm-logo img { width: 32px; height: 32px; }
.fm-nav-pc { display: none; }
.fm-nav-pc ul { display: flex; align-items: center; gap: 28px; }
.fm-nav-pc a { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.fm-nav-pc .fm-icon { width: 18px; height: 18px; }
.fm-nav-pc .fm-btn { margin-left: 8px; }

.fm-hamburger { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: none; border: none; }
.fm-hamburger span { display: block; width: 22px; height: 2px; background: var(--fm-text); position: relative; }
.fm-hamburger span::before, .fm-hamburger span::after { content: ''; position: absolute; left: 0; width: 22px; height: 2px; background: var(--fm-text); transition: transform .2s ease; }
.fm-hamburger span::before { top: -7px; }
.fm-hamburger span::after { top: 7px; }

.fm-mobile-menu {
    max-height: 0; overflow: hidden;
    background: var(--fm-bg);
    border-bottom: 1px solid var(--fm-bg-sub);
    transition: max-height .3s ease;
}
.fm-mobile-menu.is-open { max-height: 320px; }
.fm-mobile-menu ul { padding: 8px var(--fm-gap) 16px; }
.fm-mobile-menu li { border-top: 1px solid var(--fm-bg-sub); }
.fm-mobile-menu a { display: flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 500; }

/* ---------- hero ---------- */
.fm-hero { position: relative; overflow: hidden; color: #fff; }
.fm-hero-bg { position: relative; height: 48vh; min-height: 340px; }
.fm-hero-bg img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    opacity: 0; transition: opacity 2.2s ease;
}
.fm-hero-bg img.is-active { opacity: 1; }
.fm-hero-copy {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; justify-content: center;
    padding: 32px var(--fm-gap);
}
.fm-hero-copy h1 { color: #fff; font-size: 40px; margin-bottom: 16px; text-shadow: 0 1px 4px rgba(0,0,0,.35); }
.fm-hero-rotator { position: relative; height: 36px; margin-bottom: 24px; }
.fm-hero-rotator span {
    position: absolute; inset: 0;
    opacity: 0; transition: opacity 2.8s ease;
    font-size: 20px; font-weight: 600; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.fm-hero-rotator span.is-active { opacity: 1; }
.fm-hero-copy .fm-btn-outline { background: rgba(0,0,0,.25); color: #fff; border-color: #fff; }

@media (min-width: 900px) {
    .fm-hero { display: block; }
    .fm-hero-bg { height: 100vh; min-height: 560px; }
    .fm-hero-copy { justify-content: flex-end; padding: 0 64px 14vh; max-width: 760px; }
    .fm-hero-copy h1 { font-size: 72px; text-shadow: 0 2px 20px rgba(0,0,0,.35); }
    .fm-hero-rotator span { font-size: 26px; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
}

/* ---------- swipe rows (solutions / hardware / about) ---------- */
.fm-swipe-row {
    display: flex; gap: var(--fm-gap);
    overflow-x: auto; scroll-snap-type: x mandatory;
    -ms-overflow-style: none; scrollbar-width: none;
    padding-bottom: 4px;
}
.fm-swipe-row::-webkit-scrollbar { display: none; }
.fm-swipe-row > * { flex: 0 0 100%; scroll-snap-align: start; }
.fm-dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.fm-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--fm-bg-sub); }
.fm-dots span.is-active { background: var(--fm-accent); }

@media (min-width: 768px) {
    .fm-swipe-row { overflow: visible; }
    .fm-swipe-row > * { flex: 1 1 0; }
    .fm-dots { display: none; }
}

/* ---------- solution / about cards ---------- */
.fm-solution-card, .fm-about-card {
    background: #fff; border-radius: var(--fm-radius);
    padding: 28px 20px; border: 1px solid var(--fm-bg-sub);
}
.fm-solution-card .fm-icon, .fm-about-card .fm-icon {
    width: 24px; height: 24px; padding: 12px; box-sizing: content-box;
    background: var(--fm-bg-sub); border-radius: var(--fm-radius); margin-bottom: 16px;
}
.fm-solution-card h3, .fm-about-card h3 { margin-bottom: 16px; }

/* ---------- service / portfolio grid ---------- */
.fm-grid { display: grid; grid-template-columns: 1fr; gap: var(--fm-gap); }
@media (min-width: 640px) { .fm-grid { grid-template-columns: repeat(3, 1fr); } }

.fm-card {
    display: block; border-radius: var(--fm-radius); overflow: hidden;
    background: #fff; border: 1px solid var(--fm-bg-sub);
    transition: transform .25s ease;
}
a.fm-card:hover { transform: translateY(-4px); }
.fm-card-media { position: relative; aspect-ratio: 4/3; overflow: hidden; }
.fm-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
a.fm-card:hover .fm-card-media img { transform: scale(1.06); }
.fm-card-link-indicator {
    position: absolute; right: 12px; bottom: 12px;
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--fm-accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
}
.fm-card-link-indicator .fm-icon { color: #fff; }
.fm-card-body { padding: 20px; }
.fm-card-body h3 { margin-bottom: 8px; }
.fm-card-body p { font-size: 15px; opacity: .8; }

/* ---------- hardware table ---------- */
.fm-hw-card { background: #fff; border-radius: var(--fm-radius); border: 1px solid var(--fm-bg-sub); overflow: hidden; }
.fm-hw-media { aspect-ratio: 4/3; overflow: hidden; }
.fm-hw-media img { width: 100%; height: 100%; object-fit: cover; }
.fm-hw-body { padding: 20px; }
.fm-hw-body h3 { margin-bottom: 8px; }
.fm-hw-body p { font-size: 15px; opacity: .8; margin-bottom: 16px; }
.fm-spec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fm-spec-table th, .fm-spec-table td { text-align: left; padding: 8px 0; border-top: 1px solid var(--fm-bg-sub); }
.fm-spec-table th { width: 84px; color: var(--fm-accent-sub); font-weight: 700; }

/* ---------- faq ---------- */
.fm-faq-item { border-bottom: 1px solid var(--fm-bg-sub); }
.fm-faq-q {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    gap: 16px; background: none; border: none; text-align: left;
    padding: 20px 0; font-size: 16px; font-weight: 700; color: var(--fm-text);
    min-height: 44px;
}
.fm-faq-q .fm-icon { transition: transform .2s ease; flex: none; }
.fm-faq-item.is-open .fm-faq-q .fm-icon { transform: rotate(180deg); }
.fm-faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.fm-faq-item.is-open .fm-faq-a { max-height: 400px; }
.fm-faq-a p { padding-bottom: 20px; opacity: .85; }

/* ---------- CTA section ---------- */
.fm-cta-section { background: var(--fm-accent); color: #fff; text-align: center; }
.fm-cta-section h2 { color: #fff; margin-bottom: 12px; }
.fm-cta-section .fm-subtitle { opacity: .85; margin-bottom: 24px; }
.fm-cta-section .fm-cta-buttons { justify-content: center; }
.fm-cta-section .fm-btn-primary { background: #fff; color: var(--fm-accent); }
.fm-cta-section .fm-btn-outline { border-color: #fff; color: #fff; }

/* ---------- footer ---------- */
.fm-footer { background: var(--fm-text); color: rgba(255,255,255,.8); font-size: 14px; padding: 40px 0; }
.fm-footer-top { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; margin-bottom: 24px; }
.fm-footer-nav ul { display: flex; gap: 20px; flex-wrap: wrap; }
.fm-footer-nav a { display: flex; align-items: center; gap: 6px; }
.fm-footer-nav .fm-icon { width: 18px; height: 18px; }
.fm-footer-info p { margin: 0 0 4px; }
.fm-footer-bottom { border-top: 1px solid rgba(255,255,255,.15); padding-top: 16px; font-size: 13px; opacity: .6; }

/* ---------- detail page hero banner (service / case) ---------- */
.fm-detail-hero { padding: 0; }
.fm-detail-hero .fm-hero-bg { height: 46vh; min-height: 320px; }
.fm-detail-hero .fm-hero-copy { align-items: center; text-align: center; }
.fm-detail-hero .fm-hero-copy h1 { margin-bottom: 0; }
.fm-detail-hero .fm-eyebrow { color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
.fm-about-strengths { margin-top: var(--fm-gap); }
.fm-text-center { text-align: center; }

/* ---------- detail page typography ---------- */
.fm-page-hero { background: var(--fm-bg-sub); padding: var(--fm-section-gap) 0; text-align: center; }
.fm-page-hero .fm-eyebrow { color: var(--fm-accent); }
.fm-article { max-width: 760px; margin: 0 auto; padding: var(--fm-section-gap) var(--fm-gap); }
.fm-article h2 { margin-top: 40px; margin-bottom: 16px; color: var(--fm-accent); }
.fm-article h2:first-child { margin-top: 0; }
.fm-article p { font-size: 16px; }
.fm-check-list { margin: 20px 0; display: grid; gap: 12px; }
.fm-check-list li {
    display: flex; align-items: flex-start; gap: 12px;
    background: var(--fm-bg-sub); border-radius: var(--fm-radius);
    padding: 14px 16px; font-size: 15px;
}
.fm-check-list li::before {
    content: ''; flex: none; width: 20px; height: 20px; margin-top: 1px;
    background: var(--fm-accent);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolygon points='10,15.5 6.5,12 8,10.5 10,12.5 16,7 17.5,8.5' fill='black'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolygon points='10,15.5 6.5,12 8,10.5 10,12.5 16,7 17.5,8.5' fill='black'/%3E%3C/svg%3E") center / contain no-repeat;
}
.fm-article-cta { max-width: 760px; margin: 0 auto; padding: 0 var(--fm-gap) var(--fm-section-gap); }

/* ---------- sitemap page ---------- */
.fm-sitemap-group { margin-bottom: 32px; }
.fm-sitemap-group h2 { margin-bottom: 16px; }
.fm-sitemap-group ul { display: grid; gap: 12px; }
.fm-sitemap-group a {
    display: block; padding: 14px 16px; background: var(--fm-bg-sub);
    border-radius: var(--fm-radius); font-weight: 500; min-height: 44px;
}

/* ---------- contact page ---------- */
.fm-contact-card {
    max-width: 560px; margin: -32px auto 0; position: relative; z-index: 2;
    background: #fff; border-radius: var(--fm-radius); border: 1px solid var(--fm-bg-sub);
    padding: 28px 20px; text-align: center;
}
.fm-contact-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid var(--fm-bg-sub); text-align: left; }
.fm-contact-row:first-child { border-top: none; }
.fm-contact-row .fm-icon { background: var(--fm-bg-sub); padding: 10px; border-radius: 50%; box-sizing: content-box; }
.fm-contact-card .fm-cta-buttons { margin-top: 20px; justify-content: center; }
.fm-contact-card .fm-btn { width: 100%; }

/* ---------- fade-in ---------- */
.fm-fade { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.fm-fade.is-visible { opacity: 1; transform: none; }

/* ---------- desktop breakpoint ---------- */
@media (min-width: 900px) {
    .fm-nav-pc { display: block; }
    .fm-hamburger, .fm-mobile-menu { display: none; }
    h1 { font-size: 44px; }
    h2 { font-size: 32px; }
    h3 { font-size: 20px; }
    .fm-grid { grid-template-columns: repeat(3, 1fr); }
    .fm-footer-top { align-items: center; }
    .fm-mobile-break { display: none; }
}
