/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #FAF8F4;
  --bg-alt:       #F0EAE0;
  --bg-dark:      #2A1C0D;
  --bg-dark-alt:  #3A2A14;
  --primary:      #8B2000;
  --accent:       #B07820;
  --text:         #2A1C0D;
  --text-mid:     #5A4530;
  --text-light:   #8A7560;
  --white:        #FFFFFF;
  --border:       #D8CEBC;
  --badge-bg:     #FFF3E0;
  --badge-text:   #7B3800;
  --card-bg:      #FFFFFF;
  --shadow:       0 2px 12px rgba(42,28,13,.08);
  --shadow-hover: 0 8px 28px rgba(42,28,13,.16);
  --radius:       10px;
  --font:         'Georgia','Times New Roman',serif;
  --font-ui:      system-ui,-apple-system,'Segoe UI',sans-serif;
  --max-w:        1100px;
  --header-h:     64px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
}

h1,h2,h3 { font-family: var(--font); line-height: 1.25; }
img { max-width:100%; height:auto; display:block; }
a { color: var(--primary); text-decoration:none; }
a:hover { text-decoration:underline; }

/* Layout */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
section { padding: 80px 0; }
section:nth-child(even) { background: var(--bg-alt); }

.section-head         { margin-bottom: 32px; }
.section-head h2      { font-size: clamp(1.6rem,3vw,2.3rem); color: var(--primary); margin-bottom:10px; }
.section-head-light h2{ color: var(--white); }

.section-rule {
  width: 56px; height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
}

.section-intro { color: var(--text-mid); margin-bottom: 32px; max-width: 700px; }

/* Folk divider */
.folk-divider {
  height: 20px;
  background-color: var(--primary);
  background-image:
    linear-gradient( 45deg, var(--accent) 25%, transparent 25%),
    linear-gradient(135deg, var(--accent) 25%, transparent 25%),
    linear-gradient(225deg, var(--accent) 25%, transparent 25%),
    linear-gradient(315deg, var(--accent) 25%, transparent 25%);
  background-size: 10px 10px;
  background-position: 0 0, 5px 0, 5px -5px, 0 5px;
}

/* Header */
#site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: 3px solid var(--primary);
  height: var(--header-h);
  box-shadow: 0 2px 8px rgba(42,28,13,.06);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); gap: 16px;
}
.site-name {
  font-family: var(--font); font-size: 1.05rem; font-weight: bold;
  color: var(--primary); flex-shrink: 0; max-width: 260px; line-height: 1.2;
}
.site-name:hover { text-decoration:none; color: var(--accent); }

#main-nav { display:flex; align-items:center; gap:2px; flex-wrap:wrap; }
#main-nav a {
  font-size: .85rem; color: var(--text);
  padding: 6px 9px; border-radius: 6px;
  transition: background .15s, color .15s;
}
#main-nav a:hover { background: var(--bg-alt); color: var(--primary); text-decoration:none; }

.header-right {
  display:flex; align-items:center; gap:6px; margin-left:auto; flex-shrink:0;
}
.lang-switcher { display:flex; align-items:center; gap:2px; }
.lang-btn {
  background:none; border:1px solid transparent; border-radius:4px;
  padding:4px 8px; font-size:.78rem; font-weight:700; color:var(--text-mid);
  cursor:pointer; font-family:var(--font-ui); transition:all .15s; letter-spacing:.02em;
  white-space:nowrap;
}
.lang-btn:hover  { border-color:var(--primary); color:var(--primary); }
.lang-btn.active { background:var(--primary); border-color:var(--primary); color:var(--white); }

#main-nav a.nav-active { color:var(--primary); font-weight:700; }

.menu-toggle {
  display:none; background:none; border:none;
  font-size:1.4rem; color:var(--text); cursor:pointer; padding:6px; line-height:1;
}

/* Hero */
#hero { background: var(--bg-dark); color: var(--white); padding: 100px 0 88px; position:relative; overflow:hidden; }

.hero-pattern {
  position:absolute; inset:0;
  background-image: repeating-linear-gradient(
    -55deg, transparent, transparent 40px,
    rgba(176,120,32,.055) 40px, rgba(176,120,32,.055) 41px
  );
  pointer-events:none;
}
#hero::after {
  content:""; position:absolute; top:-80px; right:-80px;
  width:500px; height:500px;
  background: radial-gradient(circle, rgba(176,120,32,.15) 0%, transparent 65%);
  pointer-events:none;
}

.hero-inner {
  position:relative; z-index:1;
  display:grid; grid-template-columns:1fr auto; gap:48px; align-items:center;
}
.hero-text { max-width:640px; }
.hero-eyebrow {
  font-size:.8rem; font-weight:700; letter-spacing:.18em;
  text-transform:uppercase; color:var(--accent); margin-bottom:16px;
}
#hero h1   { font-size:clamp(1.9rem,4vw,3.1rem); color:var(--white); margin-bottom:20px; }
#hero p    { font-size:1.05rem; color:rgba(255,255,255,.82); line-height:1.78; margin-bottom:32px; }

.hero-cta { display:flex; gap:14px; flex-wrap:wrap; }

.btn-primary {
  display:inline-block; background:var(--primary); color:var(--white);
  padding:11px 26px; border-radius:6px; font-weight:600; font-size:.92rem;
  border:2px solid var(--primary); transition:background .15s,border-color .15s;
}
.btn-primary:hover { background:#a02800; border-color:#a02800; text-decoration:none; color:var(--white); }

.btn-outline {
  display:inline-block; background:transparent; color:var(--white);
  padding:11px 26px; border-radius:6px; font-weight:600; font-size:.92rem;
  border:2px solid rgba(255,255,255,.4); transition:border-color .15s,background .15s;
}
.btn-outline:hover { border-color:var(--white); background:rgba(255,255,255,.07); text-decoration:none; color:var(--white); }

.hero-emblem { width:480px; flex-shrink:0; }
.hero-emblem img { width:100%; height:auto; mix-blend-mode:screen; }

/* Meetings */
#meetings { background: var(--bg); }

.meetings-badge {
  display:inline-flex; align-items:center; gap:6px;
  background:var(--badge-bg); color:var(--badge-text);
  border:1px solid rgba(139,32,0,.25); border-radius:24px;
  padding:9px 22px; font-size:.88rem; font-weight:700;
  margin-bottom:36px; letter-spacing:.02em;
}

.cards-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(290px,1fr)); gap:24px; }

.event-card {
  background:var(--card-bg); border-radius:var(--radius);
  padding:28px; box-shadow:var(--shadow);
  border-top:4px solid var(--primary);
  display:flex; flex-direction:column; gap:10px;
  transition:box-shadow .2s,transform .2s;
}
.event-card:hover { box-shadow:var(--shadow-hover); transform:translateY(-3px); }

.card-icon {
  width:40px; height:40px; background:var(--badge-bg);
  border-radius:10px; display:flex; align-items:center; justify-content:center;
  color:var(--primary); flex-shrink:0; margin-bottom:4px;
}
.card-icon.card-icon-blue   { background:#EEF4FF; color:#1A5A8A; }
.card-icon.card-icon-purple { background:#F5EEFF; color:#6A2D8A; }
.card-icon svg { width:22px; height:22px; }

.event-card h3   { font-size:1.15rem; color:var(--primary); }
.event-card > p  { color:var(--text-mid); font-size:.95rem; flex:1; }

.event-meta      { display:flex; align-items:flex-start; gap:8px; font-size:.88rem; color:var(--text-mid); }
.meta-label      { font-weight:700; color:var(--accent); flex-shrink:0; min-width:50px; }

.project-link {
  display:inline-block; margin-top:6px;
  background:var(--primary); color:var(--white);
  padding:7px 18px; border-radius:6px; font-size:.85rem; font-weight:600;
  transition:background .15s;
}
.project-link:hover { background:#a02800; text-decoration:none; color:var(--white); }

/* Calendar */
.cal-section { margin-top: 52px; }

.calendar-wrapper {
  background: var(--bg-dark);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.25);
}

.cal-header {
  background: var(--bg-dark-alt);
  padding: 20px 24px 16px;
  border-bottom: 2px solid rgba(176,120,32,.4);
}

.cal-header-title {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: bold;
  color: var(--accent);
  letter-spacing: .04em;
  margin-bottom: 4px;
}

.cal-header-month {
  font-family: var(--font);
  font-size: clamp(1.4rem,3vw,2rem);
  font-weight: bold;
  color: var(--white);
  line-height: 1.1;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-dow {
  background: rgba(176,120,32,.18);
  color: var(--accent);
  text-align: center;
  padding: 10px 4px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-right: 1px solid rgba(255,255,255,.06);
}
.cal-dow:last-child { border-right: none; }

.cal-cell {
  min-height: 90px;
  padding: 8px 6px 6px;
  border-right: 1px solid rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(255,255,255,.06);
  vertical-align: top;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-empty { background: rgba(0,0,0,.15); }
.cal-today { background: rgba(176,120,32,.1); }

.cal-num {
  font-size: .85rem;
  font-weight: 700;
  color: rgba(255,255,255,.55);
  line-height: 1;
  margin-bottom: 2px;
  flex-shrink: 0;
}
.cal-num-today {
  color: var(--white);
  background: var(--primary);
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-size: .78rem;
}

/* Event badge colours */
.cal-event {
  border-radius: 5px;
  padding: 3px 5px;
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--white);
  display: flex;
  flex-direction: column;
}
.ev-time { font-size: .65rem; font-weight: 400; opacity: .85; }

.ev-red    { background: #8B2000; }
.ev-amber  { background: #956010; }
.ev-green  { background: #2D6A27; }
.ev-teal   { background: #1A6A6A; }
.ev-blue   { background: #1A5A8A; }
.ev-purple { background: #6A2D8A; }

/* About */
#about { background: var(--bg-alt); }

.about-layout { display:grid; grid-template-columns:1fr 240px; gap:56px; align-items:start; }
.about-text p { font-size:1.03rem; line-height:1.85; color:var(--text); }
.about-teaser { display:flex; align-items:center; gap:32px; flex-wrap:wrap; }
.about-teaser p { font-size:1.03rem; line-height:1.8; color:var(--text); flex:1; min-width:200px; margin:0; }
.about-story-link { white-space:nowrap; }

.about-aside { border-left:3px solid var(--border); padding-left:24px; }
.about-timeline { display:flex; flex-direction:column; gap:24px; }
.tl-item { display:flex; gap:14px; align-items:flex-start; }
.tl-dot {
  width:12px; height:12px; border-radius:50%; background:var(--primary);
  margin-top:4px; flex-shrink:0; box-shadow:0 0 0 3px rgba(139,32,0,.15);
}
.tl-item strong { display:block; font-size:.82rem; font-weight:700; color:var(--accent); letter-spacing:.05em; text-transform:uppercase; margin-bottom:2px; }
.tl-item p      { font-size:.9rem; color:var(--text-mid); line-height:1.4; }

/* Volunteers */
#volunteers { background: var(--bg); }
.volunteers-desc { max-width:680px; color:var(--text-mid); margin-bottom:40px; }

.volunteers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 28px;
  max-width: 700px;
}

.volunteer-card { display:flex; flex-direction:column; align-items:center; gap:6px; text-align:center; }
.volunteer-card img {
  width:110px; height:110px; border-radius:50%; object-fit:cover;
  border:3px solid var(--border); background:var(--bg-alt);
  transition:border-color .2s,transform .2s;
}
.volunteer-card:hover img { border-color:var(--primary); transform:scale(1.04); }
.vol-name { font-size:.92rem; font-weight:700; color:var(--text); }
.vol-desc { font-size:.8rem; color:var(--text-mid); line-height:1.4; max-width:130px; }

/* Gallery */
#gallery { background: var(--bg-alt); }

#gallery-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:20px; margin-top:8px; }
.gallery-empty { color:var(--text-light); font-style:italic; margin-top:12px; }
.gallery-privacy { font-size:0.82rem; color:var(--text-light); margin-bottom:18px; }

.album-card { border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); cursor:pointer; transition:box-shadow .2s,transform .2s; background:var(--card-bg); }
.album-card:hover { box-shadow:var(--shadow-hover); transform:translateY(-3px); }
.album-cover { position:relative; aspect-ratio:4/3; overflow:hidden; background:var(--bg-dark); }
.album-cover img { width:100%; height:100%; object-fit:cover; transition:transform .3s; }
.album-card:hover .album-cover img { transform:scale(1.05); }
.album-overlay { position:absolute; inset:0; background:rgba(42,28,13,.45); display:flex; align-items:center; justify-content:center; opacity:0; transition:opacity .2s; }
.album-card:hover .album-overlay { opacity:1; }
.album-overlay span { color:var(--white); font-size:.95rem; font-weight:600; letter-spacing:.06em; }
.album-title { padding:12px 14px; font-weight:600; font-size:.92rem; color:var(--text); }

/* Lightbox */
.lightbox { position:fixed; inset:0; z-index:1000; background:rgba(0,0,0,.9); display:flex; align-items:center; justify-content:center; }
.lightbox.hidden { display:none; }
#lb-img { max-width:90vw; max-height:85vh; object-fit:contain; border-radius:4px; box-shadow:0 8px 48px rgba(0,0,0,.6); transition:opacity .2s; }
.lb-loader {
  position:fixed; top:50%; left:50%;
  width:40px; height:40px; margin:-20px 0 0 -20px;
  border:3px solid rgba(255,255,255,.2);
  border-top-color:rgba(255,255,255,.85);
  border-radius:50%;
  animation:lb-spin .7s linear infinite;
}
.lb-loader.hidden { display:none; }
@keyframes lb-spin { to { transform:rotate(360deg); } }
.lb-close { position:fixed; top:20px; right:28px; background:none; border:none; color:var(--white); font-size:2.2rem; cursor:pointer; line-height:1; opacity:.7; transition:opacity .15s; z-index:1001; }
.lb-close:hover { opacity:1; }
.lb-prev,.lb-next { position:fixed; top:50%; transform:translateY(-50%); background:rgba(255,255,255,.1); border:none; color:var(--white); font-size:1.8rem; padding:16px 20px; cursor:pointer; border-radius:var(--radius); transition:background .15s; z-index:1001; }
.lb-prev { left:20px; } .lb-next { right:20px; }
.lb-prev:hover,.lb-next:hover { background:rgba(255,255,255,.22); }
#lb-counter { position:fixed; bottom:24px; left:50%; transform:translateX(-50%); color:rgba(255,255,255,.6); font-size:.88rem; }

/* Other projects */
#other-projects { background: var(--bg); }
.other-cards { margin-top: 40px; }
.other-card  { border-top-color: #1A5A8A; }
.other-card:nth-child(2) { border-top-color: #6A2D8A; }

/* Contacts */
#contacts { background: var(--bg-dark); color: var(--white); }

.contacts-layout { display:grid; grid-template-columns:260px 1fr; gap:56px; align-items:start; }
.contacts-info   { display:flex; flex-direction:column; gap:28px; }
.contacts-item h3 { font-family:var(--font-ui); font-size:.78rem; font-weight:700; text-transform:uppercase; letter-spacing:.12em; color:var(--accent); margin-bottom:6px; }
.contacts-item p,
.contacts-item a  { color:rgba(255,255,255,.8); font-size:.97rem; word-break:break-word; }
.contacts-item a:hover { color:var(--white); text-decoration:underline; }

/* Contact form */
.contact-form { display:flex; flex-direction:column; gap:18px; }
.form-row     { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.form-group   { display:flex; flex-direction:column; gap:6px; }
.form-group label { font-size:.8rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:rgba(255,255,255,.55); }
.form-group input,
.form-group textarea {
  background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.18);
  border-radius:6px; padding:11px 14px; font-size:.97rem;
  font-family:var(--font-ui); color:var(--white);
  transition:border-color .15s,background .15s; resize:vertical;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color:rgba(255,255,255,.3); }
.form-group input:focus,
.form-group textarea:focus { outline:none; border-color:var(--accent); background:rgba(255,255,255,.1); }
.form-group input.invalid,
.form-group textarea.invalid { border-color:#e05050; }

.form-actions { display:flex; align-items:center; gap:20px; flex-wrap:wrap; }
.btn-submit {
  background:var(--primary); color:var(--white); border:2px solid var(--primary);
  border-radius:6px; padding:11px 28px; font-size:.95rem; font-weight:700;
  font-family:var(--font-ui); cursor:pointer; transition:background .15s,border-color .15s;
}
.btn-submit:hover    { background:#a02800; border-color:#a02800; }
.btn-submit:disabled { opacity:.55; cursor:default; }
.form-note         { font-size:.88rem; font-style:italic; }
.form-note-success { color:#5cb85c; }
.form-note-error   { color:#e87070; }

/* Footer */
footer { background:var(--bg-dark-alt); border-top:1px solid rgba(255,255,255,.07); padding:24px 0; text-align:center; }
footer p { color:rgba(255,255,255,.4); font-size:.85rem; }

/* Responsive */
@media (max-width: 960px) {
  .about-layout    { grid-template-columns:1fr; }
  .about-aside     { border-left:none; border-top:2px solid var(--border); padding-left:0; padding-top:24px; }
  .about-timeline  { flex-direction:row; flex-wrap:wrap; gap:20px; }
  .contacts-layout { grid-template-columns:1fr; }
  .contacts-info   { flex-direction:row; flex-wrap:wrap; gap:20px; }
  .hero-inner      { grid-template-columns:1fr; position:relative; }
  .hero-emblem     { position:absolute; top:0; right:0; width:200px; opacity:.2; pointer-events:none; }
  .hero-text       { position:relative; z-index:1; }
}

@media (max-width: 768px) {
  :root { --header-h:56px; }
  .menu-toggle { display:block; }
  .lang-btn { font-size:.72rem; padding:3px 6px; }
  #main-nav {
    display:none; position:absolute; top:var(--header-h); left:0; right:0;
    background:var(--white); border-bottom:2px solid var(--primary);
    flex-direction:column; align-items:flex-start;
    padding:12px 24px 20px; gap:2px;
    box-shadow:0 4px 16px rgba(0,0,0,.1);
  }
  #main-nav.open { display:flex; }
  #main-nav a { padding:10px 4px; width:100%; font-size:1rem; }

  #hero   { padding:64px 0; }
  section { padding:52px 0; }
  .cards-grid { grid-template-columns:1fr; }
  .form-row   { grid-template-columns:1fr; }
  .cal-cell   { min-height:70px; }
  .cal-event  { font-size:.65rem; }
  .ev-time    { display:none; }
  .lb-prev { left:8px; }  .lb-next { right:8px; }
  .lb-prev,.lb-next { padding:12px 14px; font-size:1.4rem; }
}

@media (max-width: 480px) {
  .site-name  { font-size:.92rem; max-width:200px; }
  .hero-cta   { flex-direction:column; align-items:flex-start; }
  #gallery-grid { grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); }
  .volunteers-grid { grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); }
  .cal-cell   { min-height:52px; padding:4px 3px; }
  .cal-num    { font-size:.72rem; }
  .cal-event  { font-size:.6rem; padding:2px 3px; }
}
