/*
Theme Name:  Flyygelimestarit
Theme URI:   https://flyygelimestarit.com
Author:      Flyygelimestarit Oy
Description: Räätälöity teema Flyygelimestarit-verkkosivustolle. Tukee Gutenberg-editoria täysimääräisesti block patterneilla ja theme.json design tokeneilla.
Version:     1.0.0
Requires at least: 6.3
Tested up to: 6.7
Requires PHP: 8.0
License:     GPL-2.0-or-later
Text Domain: flyygelimestarit
Tags:        custom-colors, custom-menu, featured-images, full-width-template, block-patterns
*/

/* ─────────────────────────────────────────────
   DESIGN TOKENS
───────────────────────────────────────────── */
:root {
  --fm-ebony:        #1B1814;
  --fm-mahogany:     #2A231D;
  --fm-mahogany-2:   #352D25;
  --fm-ivory:        #F2EBD9;
  --fm-ivory-dim:    rgba(242, 235, 217, 0.62);
  --fm-ivory-faint:  rgba(242, 235, 217, 0.12);
  --fm-brass:        #C4973A;
  --fm-brass-light:  #D4A84A;
  --fm-brass-dim:    rgba(196, 151, 58, 0.18);
  --fm-brass-border: rgba(196, 151, 58, 0.25);
  --fm-felt:         #7A6C58;
  --fm-felt-light:   #9A8C78;
  --fm-nav-height:   72px;
  --fm-content-max:  1100px;
  --fm-radius:       6px;
}

/* ─────────────────────────────────────────────
   RESET & BASE
───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 1rem;
  line-height: 1.75;
  background-color: var(--fm-ebony);
  color: var(--fm-ivory);
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--fm-brass); }
ul, ol { list-style: none; }

/* ─────────────────────────────────────────────
   TYPOGRAPHY
───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Georgia', serif;
  font-weight: normal;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--fm-ivory);
}

h1 { font-size: clamp(2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; letter-spacing: 0.02em; }

p { color: var(--fm-ivory-dim); line-height: 1.78; }
p + p { margin-top: 1em; }

.fm-eyebrow {
  display: block;
  font-family: system-ui, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fm-brass);
  margin-bottom: 14px;
}

.fm-lead {
  font-size: 1.05rem;
  line-height: 1.82;
  color: var(--fm-ivory-dim);
}

.fm-divider {
  width: 48px;
  height: 2px;
  background: var(--fm-brass);
  margin: 20px 0 36px;
  border: none;
}

/* ─────────────────────────────────────────────
   BUTTONS
───────────────────────────────────────────── */
.fm-btn,
.wp-block-button__link {
  display: inline-block;
  padding: 14px 38px;
  font-family: system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 3px;
  cursor: pointer;
  border: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  text-decoration: none;
}

.fm-btn-primary,
.wp-block-button:not(.is-style-outline) .wp-block-button__link {
  background: var(--fm-brass);
  color: var(--fm-ebony);
}
.fm-btn-primary:hover,
.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
  background: var(--fm-brass-light);
  color: var(--fm-ebony);
}

.fm-btn-ghost,
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  color: var(--fm-ivory);
  border: 1.5px solid rgba(242, 235, 217, 0.35);
}
.fm-btn-ghost:hover,
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  border-color: var(--fm-ivory);
  background: var(--fm-ivory-faint);
  color: var(--fm-ivory);
}

/* ─────────────────────────────────────────────
   LAYOUT UTILITIES
───────────────────────────────────────────── */
.fm-container {
  max-width: var(--fm-content-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(20px, 5%, 80px);
  padding-right: clamp(20px, 5%, 80px);
}

/* ─────────────────────────────────────────────
   BLOCK ALIGNMENTS (alignfull / alignwide)
   Allow full-bleed blocks to break out of the
   constrained .fm-page-content container.
───────────────────────────────────────────── */
.fm-page-content > .alignfull {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  max-width: 100vw;
  width: auto;
}

.fm-page-content > .alignwide {
  margin-left: calc(50% - min(50vw, 640px));
  margin-right: calc(50% - min(50vw, 640px));
  max-width: none;
}

/* ─────────────────────────────────────────────
   PAGE CONTENT (prose)
   Luettavuus- ja välistysasetukset tavallisille
   sivuille (esim. tilaus- ja toimitusehdot).
───────────────────────────────────────────── */
.fm-page-content {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.fm-page-content > h1,
.fm-page-content > h2,
.fm-page-content > h3,
.fm-page-content > h4,
.fm-page-content > h5,
.fm-page-content > h6 {
  margin-top: 2em;
  margin-bottom: 0.6em;
}

.fm-page-content > *:first-child {
  margin-top: 0;
}

.fm-page-content h2 { padding-bottom: 0.3em; }

.fm-page-content > p {
  margin-top: 1.1em;
  margin-bottom: 1.1em;
}

.fm-page-content ul,
.fm-page-content ol {
  margin-top: 1.1em;
  margin-bottom: 1.1em;
  padding-left: 1.5em;
}

.fm-page-content ul { list-style: disc; }
.fm-page-content ol { list-style: decimal; }

.fm-page-content li {
  margin-bottom: 0.5em;
  color: var(--fm-ivory-dim);
  line-height: 1.78;
}

.fm-page-content li::marker { color: var(--fm-brass); }

.fm-page-content a {
  color: var(--fm-brass);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.fm-page-content a:hover { color: var(--fm-brass-light); }

.fm-page-content > blockquote {
  margin: 1.6em 0;
}

.fm-page-content figure,
.fm-page-content .wp-block-image,
.fm-page-content > img {
  margin-top: 1.8em;
  margin-bottom: 1.8em;
}

.fm-page-content img {
  border-radius: var(--fm-radius);
}

.fm-page-content figcaption {
  margin-top: 0.7em;
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--fm-felt-light);
  text-align: center;
}

/* ─────────────────────────────────────────────
   SINGLE POST HEADER
───────────────────────────────────────────── */
.fm-single-header {
  max-width: 760px;
  margin: 0 auto;
}

.fm-single-meta {
  margin-top: 14px;
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fm-felt-light);
}

.fm-single-featured {
  max-width: 760px;
  margin: 0 auto 8px;
}

.fm-single-featured img {
  width: 100%;
  border-radius: var(--fm-radius);
}

.fm-section {
  padding-top: 88px;
  padding-bottom: 88px;
}

.fm-section-sm {
  padding-top: 56px;
  padding-bottom: 56px;
}

.fm-dark-bg  { background-color: var(--fm-ebony); }
.fm-card-bg  { background-color: var(--fm-mahogany); }
.fm-card-bg2 { background-color: var(--fm-mahogany-2); }

.fm-brass-line {
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--fm-brass), transparent);
  opacity: 0.3;
}

/* ─────────────────────────────────────────────
   NAVIGATION
───────────────────────────────────────────── */
#fm-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--fm-nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5%, 80px);
  background: rgba(27, 24, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(196, 151, 58, 0.15);
  transition: background 0.3s;
}

#fm-nav.scrolled { background: rgba(27, 24, 20, 0.98); }

.fm-nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--fm-ivory);
  text-decoration: none;
}

.fm-nav-logo-mark {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--fm-brass);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--fm-brass);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.fm-nav-logo-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.fm-nav-logo-text {
  white-space: nowrap;
}

.fm-nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fm-nav-menu ul {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.fm-nav-menu li a {
  font-family: system-ui, sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fm-ivory-dim);
  padding: 8px 12px;
  border-radius: 3px;
  border-bottom: 1.5px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  display: block;
}

.fm-nav-menu li a:hover,
.fm-nav-menu li.current-menu-item a,
.fm-nav-menu li.current_page_item a {
  color: var(--fm-ivory);
  border-bottom-color: var(--fm-brass);
}

.fm-nav-cta a {
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--fm-brass-dim);
  border: 1px solid rgba(196, 151, 58, 0.4);
  color: var(--fm-brass) !important;
  padding: 9px 22px !important;
  border-radius: 3px;
  transition: background 0.2s, color 0.2s !important;
  border-bottom: none !important;
}
.fm-nav-cta a:hover {
  background: var(--fm-brass) !important;
  color: var(--fm-ebony) !important;
}

/* ── Toisen tason alavalikko (desktop: dropdown) ── */
.fm-nav-menu .fm-has-children {
  position: relative;
}

.fm-nav-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 8px 0;
  margin: 0;
  background: rgba(27, 24, 20, 0.98);
  border: 1px solid rgba(196, 151, 58, 0.15);
  border-radius: 3px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 100;
}

.fm-nav-menu .fm-has-children:hover > .sub-menu,
.fm-nav-menu .fm-has-children:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.fm-nav-menu .sub-menu li {
  width: 100%;
}

.fm-nav-menu .sub-menu li a {
  padding: 10px 18px;
  border-bottom: none;
  white-space: nowrap;
}

/* Alavalikon avauspainike (piilotettu desktopissa) */
.fm-submenu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 8px;
  color: var(--fm-ivory-dim);
  cursor: pointer;
}

/* Hamburger (mobile) */
.fm-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}
.fm-hamburger span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--fm-ivory);
  transition: 0.3s;
}
.fm-hamburger.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.fm-hamburger.active span:nth-child(2) { opacity: 0; }
.fm-hamburger.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ─────────────────────────────────────────────
   PAGE OFFSET FOR FIXED NAV
───────────────────────────────────────────── */
.fm-page-wrap {
  padding-top: var(--fm-nav-height);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─────────────────────────────────────────────
   HERO
───────────────────────────────────────────── */
.fm-hero {
  position: relative;
  display: flex;
  flex-direction: column;
}

.fm-hero-image {
  position: relative;
  width: 100%;
  height: clamp(380px, 62vh, 680px);
  overflow: hidden;
  background: var(--fm-mahogany);
}

/* Corner decoration */
.fm-hero-image::before,
.fm-hero-image::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  border-color: rgba(196, 151, 58, 0.4);
  border-style: solid;
  z-index: 2;
}
.fm-hero-image::before { top: 20px; left: 20px; border-width: 1.5px 0 0 1.5px; }
.fm-hero-image::after  { top: 20px; right: 20px; border-width: 1.5px 1.5px 0 0; }

.fm-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Placeholder when no image is set */
.fm-hero-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #251f18 0%, #1e1812 50%, #2a2218 100%);
  color: rgba(196, 151, 58, 0.5);
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.fm-hero-content {
  padding: 52px clamp(20px, 7%, 120px) 72px;
  background: var(--fm-ebony);
}

.fm-hero-content h1 { margin-bottom: 20px; }

.fm-hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 36px;
}

/* ─────────────────────────────────────────────
   ABOUT STRIP
───────────────────────────────────────────── */
.fm-about-strip {
  background: var(--fm-mahogany);
  border-top: 1px solid rgba(196, 151, 58, 0.12);
  border-bottom: 1px solid rgba(196, 151, 58, 0.12);
}

.fm-about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.fm-about-stats {
  display: flex;
  border-left: 1px solid rgba(196, 151, 58, 0.15);
}

.fm-stat {
  flex: 1;
  text-align: center;
  padding: 32px 24px;
  border-right: 1px solid rgba(196, 151, 58, 0.12);
}
.fm-stat:last-child { border-right: none; }

.fm-stat-number {
  display: block;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  color: var(--fm-brass);
  font-weight: normal;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.fm-stat-label {
  font-family: system-ui, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fm-felt-light);
}

/* ─────────────────────────────────────────────
   TEAM GRID
───────────────────────────────────────────── */
.fm-team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.fm-team-card {
  background: var(--fm-mahogany);
  border: 1px solid rgba(196, 151, 58, 0.1);
  border-radius: var(--fm-radius);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.fm-team-card:hover {
  border-color: rgba(196, 151, 58, 0.45);
  transform: translateY(-4px);
  color: inherit;
}

.fm-team-card-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(160deg, #2e2618 0%, #1e1a14 100%);
  position: relative;
}

.fm-team-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.fm-team-card:hover .fm-team-card-photo img { transform: scale(1.03); }

.fm-team-card-photo::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35%;
  background: linear-gradient(to top, var(--fm-mahogany), transparent);
}

/* Photo placeholder */
.fm-team-card-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: rgba(196, 151, 58, 0.35);
  font-family: system-ui, sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.fm-team-card-body { padding: 20px 18px 24px; }

.fm-team-card-name {
  font-size: 1rem;
  color: var(--fm-ivory);
  margin-bottom: 4px;
}

.fm-team-card-role {
  font-family: system-ui, sans-serif;
  font-size: 0.67rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fm-brass);
  margin-bottom: 16px;
}

.fm-team-card-link {
  font-family: system-ui, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fm-felt-light);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.fm-team-card-link::after { content: '→'; transition: transform 0.2s; }
.fm-team-card:hover .fm-team-card-link { color: var(--fm-brass); }
.fm-team-card:hover .fm-team-card-link::after { transform: translateX(4px); }

/* ─────────────────────────────────────────────
   POST GRID (arkistot & blogilistaus)
───────────────────────────────────────────── */
.fm-archive-description { margin-bottom: 8px; max-width: 720px; }

.fm-post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.fm-post-card {
  background: var(--fm-mahogany);
  border: 1px solid rgba(196, 151, 58, 0.1);
  border-radius: var(--fm-radius);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
}

.fm-post-card:hover {
  border-color: rgba(196, 151, 58, 0.45);
  transform: translateY(-4px);
}

.fm-post-card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.fm-post-card-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(160deg, #2e2618 0%, #1e1a14 100%);
}

.fm-post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.fm-post-card:hover .fm-post-card-media img { transform: scale(1.03); }

.fm-post-card-media-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(196, 151, 58, 0.3);
}

.fm-post-card-body {
  padding: 22px 20px 26px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.fm-post-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: system-ui, sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fm-felt-light);
  margin-bottom: 12px;
}

.fm-post-card-category { color: var(--fm-brass); }

.fm-post-card-title {
  font-size: 1.25rem;
  color: var(--fm-ivory);
  margin-bottom: 12px;
}

.fm-post-card-excerpt {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--fm-ivory-dim);
  margin-bottom: 20px;
}

.fm-post-card-link {
  margin-top: auto;
  font-family: system-ui, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fm-felt-light);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.fm-post-card-link::after { content: '→'; transition: transform 0.2s; }
.fm-post-card:hover .fm-post-card-link { color: var(--fm-brass); }
.fm-post-card:hover .fm-post-card-link::after { transform: translateX(4px); }

/* ─────────────────────────────────────────────
   PAGINATION
───────────────────────────────────────────── */
.fm-pagination { margin-top: 56px; }

.fm-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.fm-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--fm-ivory-dim);
  border: 1px solid rgba(196, 151, 58, 0.18);
  border-radius: 3px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.fm-pagination a.page-numbers:hover {
  border-color: var(--fm-brass-border);
  color: var(--fm-brass);
}

.fm-pagination .page-numbers.current {
  background: var(--fm-brass);
  border-color: var(--fm-brass);
  color: var(--fm-ebony);
}

.fm-pagination .page-numbers.dots {
  border-color: transparent;
}

/* ─────────────────────────────────────────────
   CTA STRIP
───────────────────────────────────────────── */
.fm-cta-strip {
  background: var(--fm-mahogany);
  border-top: 1px solid rgba(196, 151, 58, 0.12);
  border-bottom: 1px solid rgba(196, 151, 58, 0.12);
  padding: 72px clamp(20px, 7%, 120px);
  text-align: center;
}

.fm-cta-strip h2 { margin-bottom: 14px; }

.fm-cta-strip p {
  max-width: 480px;
  margin: 0 auto 36px;
}

/* ─────────────────────────────────────────────
   SERVICES GRID
───────────────────────────────────────────── */
.fm-services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 48px;
  border: 1px solid rgba(196, 151, 58, 0.12);
  border-radius: var(--fm-radius);
  overflow: hidden;
}

.fm-service-card {
  background: var(--fm-mahogany);
  padding: 40px 36px 44px;
  border-right: 1px solid rgba(196, 151, 58, 0.1);
}

.fm-service-card:last-child { border-right: none; }

.fm-service-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--fm-brass-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 24px;
}

.fm-service-card h3 { margin-bottom: 16px; }
.fm-service-card p { font-size: 0.9rem; margin-bottom: 28px; }

.fm-service-divider {
  width: 32px;
  height: 1.5px;
  background: var(--fm-brass);
  margin: 14px 0 18px;
  border: none;
}

.fm-price-table {
  border-top: 1px solid rgba(196, 151, 58, 0.18);
  padding-top: 20px;
  margin-top: 28px;
}

.fm-price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  font-family: system-ui, sans-serif;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(196, 151, 58, 0.06);
}

.fm-price-row:last-child { border-bottom: none; }
.fm-price-row span:first-child { color: var(--fm-ivory-dim); }
.fm-price-row span:last-child  { color: var(--fm-brass); font-family: 'Georgia', serif; font-size: 0.9rem; }

/* ─────────────────────────────────────────────
   PROFILE / SINGLE MESTARI
───────────────────────────────────────────── */
.fm-profile-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fm-felt-light);
  cursor: pointer;
  margin-bottom: 48px;
  transition: color 0.2s;
  text-decoration: none;
}

.fm-profile-back::before { content: '←'; }
.fm-profile-back:hover { color: var(--fm-brass); }

.fm-profile-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 72px;
  align-items: start;
}

.fm-profile-photo-wrap { position: sticky; top: calc(var(--fm-nav-height) + 32px); }

.fm-profile-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  border: 1px solid rgba(196, 151, 58, 0.18);
  overflow: hidden;
  background: linear-gradient(160deg, #2e2618 0%, #1e1a14 100%);
}

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

.fm-profile-name {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 8px;
}

.fm-profile-role {
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fm-brass);
  margin-bottom: 32px;
}

.fm-profile-bio p { font-size: 0.97rem; margin-bottom: 18px; }

.fm-credentials { margin-top: 40px; }

.fm-credentials-title {
  font-family: system-ui, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fm-brass);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(196, 151, 58, 0.2);
}

.fm-credential-item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(196, 151, 58, 0.08);
  font-size: 0.9rem;
  color: var(--fm-ivory-dim);
}

.fm-credential-item::before {
  content: '◆';
  font-size: 0.42rem;
  color: var(--fm-brass);
  flex-shrink: 0;
  position: relative;
  top: -1px;
}

/* ─────────────────────────────────────────────
   SHOP
───────────────────────────────────────────── */
.fm-shop-category { margin-bottom: 48px; }

.fm-shop-category-title {
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fm-brass);
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(196, 151, 58, 0.2);
  margin-bottom: 24px;
}

.fm-shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.fm-shop-item {
  background: var(--fm-mahogany);
  border: 1px solid rgba(196, 151, 58, 0.1);
  border-radius: var(--fm-radius);
  overflow: hidden;
  transition: border-color 0.2s;
}
.fm-shop-item:hover { border-color: rgba(196, 151, 58, 0.35); }

.fm-shop-item-image {
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: linear-gradient(135deg, #2a2218, #1e1812);
  display: flex;
  align-items: center;
  justify-content: center;
}
.fm-shop-item-image img { width: 100%; height: 100%; object-fit: cover; }

.fm-shop-item-body { padding: 16px 18px 20px; }
.fm-shop-item-name { font-size: 0.92rem; margin-bottom: 4px; color: var(--fm-ivory); }
.fm-shop-item-desc { font-size: 0.78rem; color: var(--fm-felt-light); margin-bottom: 14px; line-height: 1.5; }

.fm-shop-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fm-shop-price {
  font-size: 1.1rem;
  color: var(--fm-brass);
  font-family: 'Georgia', serif;
}

.fm-shop-note {
  background: var(--fm-mahogany-2);
  border: 1px solid rgba(196, 151, 58, 0.15);
  border-radius: var(--fm-radius);
  padding: 24px 28px;
  margin-top: 40px;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--fm-ivory-dim);
}

/* ─────────────────────────────────────────────
   CONTACT
───────────────────────────────────────────── */
.fm-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  margin-top: 48px;
}

.fm-form { display: flex; flex-direction: column; gap: 18px; }

.fm-form-group { display: flex; flex-direction: column; gap: 7px; }

.fm-label {
  font-family: system-ui, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fm-felt-light);
}

.fm-input,
.fm-textarea,
.wpcf7-text,
.wpcf7-email,
.wpcf7-tel,
.wpcf7-textarea {
  background: var(--fm-mahogany);
  border: 1px solid rgba(196, 151, 58, 0.2);
  border-radius: 3px;
  padding: 14px 16px;
  font-family: 'Georgia', serif;
  font-size: 0.95rem;
  color: var(--fm-ivory);
  transition: border-color 0.2s;
  outline: none;
  width: 100%;
}

.fm-input:focus,
.fm-textarea:focus,
.wpcf7-text:focus,
.wpcf7-email:focus,
.wpcf7-tel:focus,
.wpcf7-textarea:focus {
  border-color: var(--fm-brass);
}

.fm-textarea,
.wpcf7-textarea {
  height: 140px;
  resize: vertical;
}

.fm-contact-info { display: flex; flex-direction: column; gap: 32px; }

.fm-contact-block h3 { margin-bottom: 8px; font-size: 1rem; }
.fm-contact-block p,
.fm-contact-block a { font-size: 0.9rem; line-height: 1.8; color: var(--fm-ivory-dim); }
.fm-contact-block a:hover { color: var(--fm-brass); }

/* ─────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────── */
#fm-footer {
  background: var(--fm-mahogany);
  border-top: 1px solid rgba(196, 151, 58, 0.12);
  padding: 48px clamp(20px, 7%, 120px) 32px;
}

.fm-footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 24px;
}

.fm-footer-logo { font-size: 1rem; letter-spacing: 0.08em; }
.fm-footer-logo small {
  display: block;
  font-family: system-ui, sans-serif;
  font-size: 0.62rem;
  color: var(--fm-felt-light);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 4px;
}

.fm-footer-menu ul {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  list-style: none;
}

.fm-footer-menu a {
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fm-felt-light);
  transition: color 0.2s;
}
.fm-footer-menu a:hover { color: var(--fm-brass); }

.fm-footer-bottom {
  border-top: 1px solid rgba(196, 151, 58, 0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: system-ui, sans-serif;
  font-size: 0.67rem;
  color: var(--fm-felt);
  letter-spacing: 0.06em;
}

/* ─────────────────────────────────────────────
   BLOCK EDITOR OVERRIDES
───────────────────────────────────────────── */
.wp-block-separator { border: none; height: 2px; background: var(--fm-brass); width: 48px; margin: 24px 0 36px; }
.wp-block-quote { border-left: 2px solid var(--fm-brass); padding-left: 24px; }
.wp-block-quote p { font-size: 1.1rem; font-style: italic; }

/* ─────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .fm-team-grid { grid-template-columns: repeat(2, 1fr); }
  .fm-services-grid { grid-template-columns: 1fr; }
  .fm-service-card { border-right: none; border-bottom: 1px solid rgba(196, 151, 58, 0.1); }
  .fm-service-card:last-child { border-bottom: none; }
  .fm-profile-grid { grid-template-columns: 280px 1fr; gap: 48px; }
}

@media (max-width: 768px) {
  .fm-hamburger { display: flex; }

  .fm-nav-menu {
    display: none;
    position: fixed;
    top: var(--fm-nav-height);
    left: 0;
    right: 0;
    background: rgba(27, 24, 20, 0.98);
    padding: 24px clamp(20px, 5%, 40px) 32px;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    border-bottom: 1px solid rgba(196, 151, 58, 0.15);
  }

  .fm-nav-menu.open { display: flex; }

  .fm-nav-menu ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
  }

  .fm-nav-menu li a {
    padding: 14px 0;
    border-bottom: 1px solid rgba(196, 151, 58, 0.08);
    width: 100%;
    border-right: none;
  }

  /* ── Alavalikko mobiilissa (accordion) ── */
  .fm-nav-menu .fm-has-children {
    position: static;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
  }

  .fm-nav-menu .fm-has-children > .nav-link {
    flex: 1 1 auto;
    width: auto;
  }

  .fm-submenu-toggle {
    display: flex;
    flex: 0 0 auto;
    color: var(--fm-ivory-dim);
    transition: transform 0.2s;
  }

  .fm-nav-menu .fm-has-children.open > .fm-submenu-toggle {
    transform: rotate(180deg);
  }

  .fm-nav-menu .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
    width: 100%;
    padding: 0 0 8px 16px;
    margin: 0;
    background: none;
    border: none;
    border-radius: 0;
    transition: none;
  }

  .fm-nav-menu .fm-has-children.open > .sub-menu {
    display: flex;
  }

  .fm-nav-menu .sub-menu li a {
    padding: 12px 0;
    white-space: normal;
  }

  .fm-nav-cta { margin-top: 20px; width: 100%; }
  .fm-nav-cta a { display: block; text-align: center; }

  .fm-about-grid { grid-template-columns: 1fr; }
  .fm-about-stats { border-left: none; border-top: 1px solid rgba(196, 151, 58, 0.15); }
  .fm-team-grid { grid-template-columns: repeat(2, 1fr); }
  .fm-post-grid { grid-template-columns: repeat(2, 1fr); }
  .fm-contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .fm-profile-grid { grid-template-columns: 1fr; }
  .fm-profile-photo-wrap { position: static; max-width: 300px; margin: 0 auto 40px; }
}

@media (max-width: 480px) {
  .fm-team-grid { grid-template-columns: 1fr; }
  .fm-post-grid { grid-template-columns: 1fr; }
  .fm-hero-actions { flex-direction: column; }
  .fm-hero-actions .fm-btn { text-align: center; }
}
