/* ===========================================================
   Coffee Capital - Modern Neo-Brutalist, Split-Complementary Theme
   CSS: 2025
   Notes:
   - Designed to complement Bootstrap 5
   - Sections: Hero, Contact, Footer, Testimonials, Services, Pricing, Resources
   - Glass morphism, parallax-friendly, scroll-reveal, responsive grid/flex
   - Global button styles, card centering, fixed hero image handling
   - Success page: min-height 100vh, centered content (utility class provided)
   - Privacy/Terms: top padding adjustments via optional body classes
   =========================================================== */

/* 1. Root variables: split-complementary palette and neutrals
   - Base color set with two complementary accents
   - Gradient backgrounds and glass morphism tokens
*/
:root {
  /* Core palette (split-complementary) */
  --c-base: #1e3a8a;          /* deep blue (base) */
  --c-accent: #e11d48;        /* vibrant pink (complement) */
  --c-secondary: #f59e0b;     /* bright amber (secondary complement) */

  /* Neutrals and surfaces */
  --bg: #0b0f14;
  --surface: rgba(18, 22, 32, 0.9);
  --surface-soft: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.18);
  --text: #e9f0f7;
  --muted: #cbd5e1;

  /* Typography tokens */
  --font-heading: 'Montserrat', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Merriweather', Georgia, 'Times New Roman', serif;

  /* Radius & shadows for Neo-Brutalist blocks */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-soft: 0 8px 28px rgba(0, 0, 0, 0.25);
  --shadow-hard: 0 12px 40px rgba(0, 0, 0, 0.45);

  /* Glass morphism helpers */
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.15);
  --blur: saturate(1.25) blur(8px);

  /* Gradient accents for backgrounds and buttons */
  --grad-primary: linear-gradient(135deg, var(--c-base) 0%, #2b6cb0 60%, var(--c-secondary) 100%);
  --grad-button: linear-gradient(135deg, var(--c-base), var(--c-secondary));

  /* Interaction */
  --focus: 0 0 0 3px rgba(30, 144, 255, 0.5);
  --transition: all 0.25s ease;
  
  /* Social & links */
  --link: #8be9fd;
  --link-hover: #ffffff;
  --footer-link: rgba(255, 255, 255, 0.85);
}

/* 2. Global resets and base typography */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  height: 100%;
}

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
}

/* Bootstrap utility-like helpers (lightweight) */
.container { max-width: 1140px; padding-left: 1rem; padding-right: 1rem; }

/* 3. Typography helpers for section titles and body content */
.section-title {
  font-family: var(--font-heading);
  font-weight: 700;
  color: #f6f7fb;
  letter-spacing: .2px;
  margin: 0 0 .75rem;
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}

.hero .lead, .section-intro {
  font-family: var(--font-body);
  color: #e9f0f7;
  opacity: .95;
}

/* 4. Header (fixed) with glass morphism look */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  backdrop-filter: blur(8px) saturate(1.2);
  background: rgba(10, 12, 20, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  /* ensure legibility on light content */
}
.site-header .navbar-brand {
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
}
.site-header .nav-link {
  color: rgba(255, 255, 255, 0.92);
}
.site-header .nav-link:hover,
.site-header .nav-link:focus {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 5. Hero section (background image + overlay) */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1rem;
  min-height: 58vh; /* natural height fallback; no fixed px */
  color: #fff; /* critical: white text over any background */
  overflow: hidden;
}
.hero::before {
  /* optional gradient overlay for readability if image bright */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom right, rgba(0,0,0,.65), rgba(0,0,0,.25));
  z-index: 0;
  pointer-events: none;
}
.hero > .container,
.hero > .container > .content,
.hero .overlay { position: relative; z-index: 1; }
.hero .bg-image {
  position: absolute; inset: 0; width: 100%; height: 100%;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  /* allow page to supply image via inline style, CSS fallback if needed */
}
.hero .overlay {
  position: absolute; inset: 0;
  /* subtle vignette to improve contrast on text */
  background: linear-gradient(to bottom right, rgba(0,0,0,0.55), rgba(0,0,0,0.25));
  z-index: 0;
  pointer-events: none;
}
.hero h1 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 2.75rem;
  line-height: 1.05;
  margin: 0 0 .5rem;
  text-shadow: 0 2px 10px rgba(0,0,0,.4);
}
.hero p {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: rgba(255,255,255,.95);
  max-width: 860px;
  margin: 0 auto 1.5rem;
}
.hero .cta {
  display: inline-block;
  padding: 0.95rem 1.25rem;
  border-radius: 999px;
  color: #0b1220;
  background: var(--grad-button);
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
  transition: transform .25s ease, box-shadow .25s ease;
}
.hero .cta:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(0,0,0,.35); }

/* 6. Generic content blocks: sections with soft glass and subtle borders  */
.section {
  padding: 4rem 1rem;
}
.section + .section { margin-top: 1rem; }

/* Glass morphism panel used across cards/sections */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-soft);
}

/* 7. Cards (image-centered, fixed image height, centered content) */
.card,
.item,
.testimonial,
.team-member,
.product-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--text);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(0,0,0,.25); }
.card + .card { margin-top: 1rem; }

.card-image {
  height: 180px;               /* fixed height per requirement */
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  overflow: hidden;
  border-radius: 12px;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;           /* ensure fill without distortion */
  display: block;
  margin: 0 auto;              /* center image horizontally */
}
.card-content { padding: 0.75rem; }

/* Ensure images in all listed blocks are centered and fixed-height containers */
.image-container {
  height: 180px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0 auto;
}

/* 8. Section grids (responsive) */
.section-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}
@media (min-width: 992px) {
  .section-grid { grid-template-columns: 2fr 1fr; column-gap: 2rem; }
}
@media (min-width: 1200px) {
  .section-grid { grid-template-columns: 2.5fr 1.5fr; }
}

/* Pricing & Resources cards layout: 3-column on large, 1/2 on medium */
.pricing-grid,
.resources-grid,
.services-grid,
.testimonials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 768px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .resources-grid { grid-template-columns: repeat(2, 1fr); }
  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1200px) {
  .pricing-grid { grid-template-columns: repeat(3, 1fr); }
  .resources-grid { grid-template-columns: repeat(3, 1fr); }
  .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .section-grid { padding: 0 0.5rem; }
}

/* Read more links styling (Читать далее) */
a.readmore,
a.readmore:visited {
  color: var(--link);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dashed rgba(139, 233, 253, 0.6);
  padding-bottom: 1px;
}
a.readmore:hover,
a.readmore:focus {
  color: var(--link-hover);
  border-bottom-color: rgba(255,255,255,.9);
}
a.readmore::after {
  content: " Читать далее";
  font-weight: 700;
}

/* 9. Contact forms (Bootstrap-based) with enhanced visuals */
form.needs-validation input[type="text"],
form.needs-validation input[type="email"],
form.needs-validation textarea,
form.needs-validation select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.22);
  color: var(--text);
  transition: border-color .2s ease, background .2s ease;
}
form.needs-validation input:focus,
form.needs-validation textarea:focus {
  outline: none;
  border-color: rgba(140, 190, 255, 0.95);
  box-shadow: var(--focus);
  background: rgba(255,255,255,0.12);
}
form.needs-validation .form-label { font-family: var(--font-heading); font-weight: 700; color: #eaf0f8; margin-bottom: .25rem; }

/* 10. Footer: text links with text-only social section */
.site-footer {
  background: #0a0f15;
  color: rgba(255,255,255,.92);
  border-top: 1px solid rgba(255,255,255,.08);
}
.site-footer .container { display:flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 1rem 0; }
.site-footer .nav { padding: 0; margin: 0; }
.site-footer a {
  color: var(--footer-link);
  text-decoration: none;
  margin-right: 0.75rem;
}
.site-footer a:hover { color: #fff; text-decoration: underline; }

.social-links {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
}
.social-links a {
  color: var(--c-secondary);
  text-decoration: none;
  font-size: .95rem;
  padding: 0.25rem 0.5rem;
}
.social-links a:hover { color: #fff; }

/* Optional: footer social-icons (for future icon-based links) */
.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  color: var(--c-secondary);
  text-decoration: none;
}
.social-icons a:hover { background: rgba(255,255,255,.1); color: #fff; }

/* 11. Success page adjustments (minimal height 100vh, centered) */
#success-modal-content { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem; }

/* Ensure the modal overlay on success page is full-viewport height (fallback if CSS overrides) */
.modal.show {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

/* 12. Per-page top padding helpers (for privacy/terms) */
body.page-privacy main,
body.page-terms main {
  padding-top: 100px;
}

/* 13. Image optimization hints (non-overlapping, responsive) */
img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
}

/* 14. Utility: visually-hidden for accessibility if needed */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* 15. Accessibility: focus styles for keyboard users on interactive elements */
a:focus, button:focus, input:focus, textarea:focus, .btn:focus {
  outline: none;
  box-shadow: var(--focus);
}