/* Basic reset and typography */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body { font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; color: #111; line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }

/* Container */
.container { max-width: 1100px; margin: 0 auto; padding: 24px 20px; }

/* Header */
.site-header { border-bottom: 1px solid #e9e9e9; position: sticky; top: 0; background: #fff; z-index: 50; }
.site-header__inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; max-width: 1200px; margin: 0 auto; padding: 18px 20px; }

.brand { justify-self: center; text-decoration: none; color: #111; letter-spacing: 0.35em; font-size: 26px; font-weight: 400; font-family: "Cinzel", serif; }

/* Language switch */
.lang-switch { justify-self: end; position: relative; }
.lang-switch__btn { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 1px solid #222; padding: 6px 12px; cursor: pointer; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; }
.lang-switch__btn .chevron { display: block; }
.lang-switch__menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 120px; border: 1px solid #e5e5e5; background: #fff; padding: 6px; box-shadow: 0 4px 16px rgba(0,0,0,0.05); display: none; }
.lang-switch.open .lang-switch__menu { display: block; }
.lang-switch__item { display: flex; align-items: center; gap: 6px; padding: 8px 10px; color: #111; text-decoration: none; font-size: 13px; letter-spacing: 0.08em; }
.lang-switch__item:hover { background: #f7f7f7; }
.lang-switch__item.active { font-weight: 500; }
.lang-switch__item.active::before { content: "✓"; font-size: 12px; line-height: 1; }

/* A11y utility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Nav */
.site-nav { justify-self: center; }
.site-nav__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 28px; }
.site-nav__link { text-decoration: none; color: #111; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 400; cursor: pointer; }
.site-nav__link.active { position: relative; }
.site-nav__link.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; margin: 0 auto; width: 22px; height: 1px; background: #111; }
.site-nav__link:hover { opacity: 0.7; }

/* Burger toggle (hidden on desktop) */
.nav-toggle { display: none; width: 40px; height: 40px; background: transparent; border: none; padding: 6px; cursor: pointer; justify-self: start; }
.nav-toggle__bar { display: block; width: 100%; height: 2px; background: #111; margin: 6px 0; transition: transform .2s ease, opacity .2s ease; }

/* Mobile behavior */
@media (max-width: 900px) {
  .site-header__inner { grid-template-columns: auto 1fr auto; }
  .brand { justify-self: center; font-size: 22px; }
  .nav-toggle { display: inline-block; }

  .site-nav { position: fixed; inset: 64px 0 auto 0; background: #fff; border-top: 1px solid #eee; transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
  .site-nav.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .site-nav__list { flex-direction: column; gap: 0; }
  .site-nav__list li { border-bottom: 1px solid #f0f0f0; }
  .site-nav__link { display: block; padding: 14px 20px; font-size: 14px; }
}

/* Simple hero placeholder */
/* Shared page hero image */
.page-hero { width: 100%; border-bottom: 1px solid #e9e9e9; }
.page-hero__img { display: block; width: 100%; height: clamp(160px, 28vh, 300px); object-fit: cover; }

@media (min-width: 900px) {
  .page-hero__img { height: clamp(220px, 32vh, 360px); }
}

/* Intro section */
.intro { max-width: 900px; margin: 60px auto; text-align: center; padding: 0 20px; }
.intro__title { font-family: "Cinzel", serif; font-size: clamp(28px, 5vw, 44px); font-weight: 400; letter-spacing: 0.02em; line-height: 1.25; margin: 0 0 28px; }
.intro__text { color: #2c2c2c; font-size: 16px; }
.intro__text p { margin: 14px 0; }
.intro__cta { margin-top: 24px; }
.btn { display: inline-block; padding: 12px 22px; border: 1px solid #111; background: #111; color: #fff; text-decoration: none; letter-spacing: 0.08em; font-size: 14px; cursor: pointer; }
.btn:hover { opacity: .9; }
.btn-primary { background: #111; border-color: #111; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: none; z-index: 100; }
.modal-backdrop.open { display: block; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(640px, calc(100% - 40px)); background: #fff; border: 1px solid #e5e5e5; box-shadow: 0 12px 24px rgba(0,0,0,0.15); padding: 20px; display: none; z-index: 101; 
  /* Make modal usable on small screens */
  max-height: calc(100dvh - 40px);
  /* Flex properties will apply when open */
  flex-direction: column;
}
.modal.open { display: flex; }
.modal__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; 
  /* Ensure close button stays visible while content scrolls */
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.modal__title { font-size: 18px; letter-spacing: 0.08em; text-transform: uppercase; }
.modal__close { background: transparent; border: none; font-size: 22px; cursor: pointer; }
.modal__content { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-right: 6px; }
.form-row { display: grid; gap: 12px; margin: 12px 0; }
.form-row label { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: #444; }
.form-row input, .form-row textarea { width: 100%; padding: 10px 12px; border: 1px solid #dadada; font-size: 14px; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 10px; }

/* Prevent background scroll when a modal is open */
body.modal-open { overflow: hidden; touch-action: none; }

/* iOS/Android overscroll control over backdrop */
.modal-backdrop { overscroll-behavior: contain; }

/* Fallback for browsers without dynamic viewport units */
@supports not (height: 100dvh) {
  .modal { max-height: calc(100vh - 40px); }
}

/* Footer */
.site-footer { background: #f4efe7; border-top: 1px solid #e3ddd3; margin-top: auto; }
.site-footer__inner { display: grid; grid-template-columns: 1fr; gap: 28px; padding: 28px 20px 40px; }
.footer-col { display: grid; gap: 12px; }
.footer-title { margin: 0; font-size: 14px; letter-spacing: 0.2em; font-weight: 400; color: #7a6c5a; text-transform: uppercase; }
.footer-social { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; }
.footer-social { cursor: pointer; }
.footer-social__icon svg { display: block; }
.footer-contact, .footer-address, .footer-legal { font-size: 14px; color: #594f43; letter-spacing: 0.02em; }
.footer-link { color: #6c7b87; text-decoration: none; border-bottom: 1px solid #c2cbd1; padding-bottom: 2px; cursor: pointer; }
.footer-link:hover { opacity: .8; }

@media (min-width: 900px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
}

/* Ensure main content grows to push footer down */
main.container { flex: 1 0 auto; }

/* Blog preview */
.blog-preview { margin: 40px auto; }
.blog-list { display: grid; grid-template-columns: 1fr; gap: 18px; }
.blog-card { border: 1px solid #e5e5e5; padding: 16px; background: #fff; }
.blog-card.is-hidden { display: none; }
.blog-card__title { margin: 0 0 8px; font-size: 18px; letter-spacing: 0.02em; }
.blog-card__excerpt { margin: 0 0 10px; color: #2c2c2c; }
.blog-detail .blog-content { color: #2c2c2c; font-size: 16px; }

@media (min-width: 800px) {
  .blog-list { grid-template-columns: 1fr 1fr; }
}
