/* =============================
   Crystal Odyssey – Professional Corporate Theme
   Style: professional_corporate (blue/gray palette, structured layout)
   Fonts: Trebuchet MS (display), Verdana (body)
   Layout: Mobile-first, Flexbox-only
   ============================= */

/* -----------------------------
   1) CSS Reset / Normalize
   ----------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Verdana, Tahoma, Segoe UI, Arial, sans-serif; line-height: 1.6; color: #14212B; background: #FFFFFF; }
img, svg { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
ul, ol { margin: 0 0 16px; padding-left: 20px; }
h1, h2, h3, h4, h5, h6, p { margin: 0 0 16px; }
a { color: inherit; text-decoration-color: rgba(14,42,71,.25); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: rgba(14,42,71,.5); }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

/* -----------------------------
   2) Theme Variables
   ----------------------------- */
:root {
  --primary: #0E2A47; /* deep corporate blue */
  --secondary: #9C3D00; /* warm copper accent */
  --accent: #F5F7FA; /* light background */
  --bg: #FFFFFF;
  --text: #14212B; /* near-black text */
  --muted: #5A6B7A; /* gray text */
  --border: #D9E1E8; /* light border */
  --border-strong: #C5D0DA;
  --surface: #FFFFFF;
  --shadow: 0 6px 16px rgba(14, 42, 71, 0.08), 0 1px 3px rgba(14, 42, 71, 0.08);
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px;
  --focus: #2F6FA3;
}

/* -----------------------------
   3) Typography
   ----------------------------- */
:where(h1, h2, h3, h4) { font-family: "Trebuchet MS", Verdana, Tahoma, Arial, sans-serif; color: var(--primary); line-height: 1.25; }
h1 { font-size: 32px; letter-spacing: 0.2px; }
h2 { font-size: 24px; letter-spacing: 0.2px; }
h3 { font-size: 18px; letter-spacing: 0.2px; color: #0E2A47; }
@media (min-width: 768px) {
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
  h3 { font-size: 20px; }
}
@media (min-width: 1200px) {
  h1 { font-size: 48px; }
  h2 { font-size: 32px; }
  h3 { font-size: 22px; }
}

p { color: var(--text); }
small, .small { font-size: 14px; color: var(--muted); }
strong { color: #0E2A47; }

/* Focus styles for accessibility */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* -----------------------------
   4) Layout Containers (Flexbox-only)
   ----------------------------- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; display: flex; flex-direction: column; gap: 20px; }
.content-wrapper { display: flex; flex-direction: column; gap: 24px; }
section { padding: 40px 0; display: flex; }
section > .container { justify-content: center; }

/* Mandatory spacing patterns */
.section { margin-bottom: 60px; padding: 40px 20px; }
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; padding: 20px; transition: transform .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(14,42,71,.12), 0 2px 6px rgba(14,42,71,.08); }
.content-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.text-image-section { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.testimonial-card { display: flex; align-items: center; gap: 20px; padding: 20px; background: #FFFFFF; border: 1px solid var(--border-strong); border-left: 4px solid var(--secondary); border-radius: var(--radius-md); box-shadow: var(--shadow); }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* Responsive alignment */
@media (max-width: 768px) { .text-image-section { flex-direction: column; } }

/* Ensure minimal spacing between blocks */
section + section { margin-top: 20px; }
.text-section + .text-section, .testimonial-card + .testimonial-card, .card + .card { margin-top: 20px; }

/* -----------------------------
   5) Header & Navigation
   ----------------------------- */
header { position: sticky; top: 0; background: #FFFFFF; border-bottom: 1px solid var(--border); z-index: 1000; display: flex; flex-direction: column; }
header .container { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; }
.brand img { height: 42px; width: auto; }

/* Desktop main navigation */
.main-nav { display: none; align-items: center; gap: 24px; }
.main-nav a { color: var(--primary); padding: 10px 8px; border-radius: 6px; transition: background-color .2s ease, color .2s ease; }
.main-nav a:hover { background: var(--accent); }

.header-cta { display: none; align-items: center; }
.header-cta a { display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; background: var(--secondary); color: #FFFFFF; border-radius: 8px; box-shadow: var(--shadow); transition: transform .2s ease, background .2s ease; }
.header-cta a:hover { transform: translateY(-2px); background: #7E3200; }

/* Mobile burger */
.mobile-menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 10px 20px; border-radius: 8px; background: var(--accent); color: var(--primary); box-shadow: 0 1px 2px rgba(14,42,71,.08) inset; }

/* Mobile menu overlay */
.mobile-menu { position: fixed; inset: 0; display: flex; flex-direction: column; background: rgba(14,42,71,0.98); color: #FFFFFF; padding: 20px; transform: translateX(100%); opacity: 0; visibility: hidden; transition: transform .35s ease, opacity .35s ease, visibility .35s ease; z-index: 1100; }
.mobile-menu[aria-hidden="false"] { transform: translateX(0); opacity: 1; visibility: visible; }
.mobile-menu-close { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; color: #FFFFFF; background: rgba(255,255,255,0.08); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.mobile-nav { display: flex; flex-direction: column; gap: 14px; margin-top: 60px; }
.mobile-nav a { display: flex; align-items: center; min-height: 44px; padding: 12px 10px; border-radius: 8px; color: #FFFFFF; background: rgba(255,255,255,0.06); }
.mobile-nav a:hover { background: rgba(255,255,255,0.12); }

/* Show desktop nav on wider screens; hide burger */
@media (min-width: 992px) {
  .mobile-menu-toggle { display: none; }
  .main-nav { display: flex; }
  .header-cta { display: flex; }
}

/* -----------------------------
   6) Hero Section
   ----------------------------- */
.hero { background: var(--accent); border-bottom: 1px solid var(--border); }
.hero .container { padding-top: 24px; padding-bottom: 24px; }
.tagline-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 14px; color: var(--primary); background: #E9EFF5; border: 1px solid var(--border); border-left: 4px solid var(--secondary); border-radius: 999px; }
.hero p { max-width: 820px; color: var(--muted); }

/* CTA buttons */
.cta-group { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-group a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border-radius: 10px; font-weight: 600; letter-spacing: .2px; transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease; border: 1px solid transparent; }
.cta-group a:first-child { background: var(--primary); color: #FFFFFF; box-shadow: var(--shadow); }
.cta-group a:first-child:hover { transform: translateY(-2px); background: #0B223A; }
.cta-group a + a { background: #FFFFFF; color: var(--primary); border-color: var(--border-strong); }
.cta-group a + a:hover { background: var(--accent); }

/* Trust badges */
.trust-badges { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.trust-badges > div { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #FFFFFF; border: 1px solid var(--border); border-radius: 10px; }
.trust-badges img { width: 22px; height: 22px; }
.trust-badges p { margin: 0; color: var(--muted); font-size: 14px; }

/* Quick contact line */
.contact-short { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted); }
.contact-short img { width: 18px; height: 18px; margin-right: 6px; display: inline-block; }
.contact-short p { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }

/* -----------------------------
   7) Content Sections & Cards
   ----------------------------- */
.text-section { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px; background: #FFFFFF; border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow); }
.text-section p img { width: 18px; height: 18px; margin-right: 8px; display: inline-block; vertical-align: middle; }
.text-section a { color: var(--primary); font-weight: 600; }

/* Alternate subtle background for every other top-level section */
section:nth-of-type(odd).hero ~ section:nth-of-type(even) { background: #FFFFFF; }
section:nth-of-type(odd).hero ~ section:nth-of-type(odd) { background: var(--accent); }

/* Ensure lists have breathing room */
.text-section li + li { margin-top: 6px; }

/* -----------------------------
   8) Testimonials (High Contrast)
   ----------------------------- */
.testimonial-card p { margin: 0; color: var(--text); }
.testimonial-card p + p { color: var(--muted); }

/* -----------------------------
   9) Footer
   ----------------------------- */
footer { background: var(--primary); color: #E8EEF4; padding: 32px 0; margin-top: 20px; display: flex; }
footer .container { gap: 20px; }
footer .content-wrapper { flex-direction: column; gap: 20px; }
footer nav { display: flex; flex-wrap: wrap; gap: 14px 20px; }
footer nav a { color: #E8EEF4; opacity: 0.9; padding: 6px 8px; border-radius: 6px; }
footer nav a:hover { background: rgba(255,255,255,.08); opacity: 1; }
.footer-brand { display: flex; align-items: center; }
.footer-brand img { height: 40px; }
footer .text-section { background: transparent; border: 0; box-shadow: none; padding: 0; color: #E8EEF4; }
.social-links { display: flex; gap: 12px; }
.social-links a { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; background: rgba(255,255,255,.08); border-radius: 8px; }
.social-links a:hover { background: rgba(255,255,255,.16); }
.contact-mini { display: flex; flex-direction: column; gap: 6px; }

/* -----------------------------
   10) Utility & Helper Layouts
   ----------------------------- */
.align-center { display: flex; align-items: center; }
.justify-between { display: flex; justify-content: space-between; }
.wrap { display: flex; flex-wrap: wrap; gap: 20px; }

/* -----------------------------
   11) Buttons (generic, used by links)
   ----------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { transform: translateY(-2px); background: #0B223A; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #7E3200; }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--accent); }

/* -----------------------------
   12) Mobile Menu & Header Spacing Adjustments
   ----------------------------- */
@media (min-width: 768px) {
  header .container { padding-top: 6px; padding-bottom: 6px; }
  .hero .container { padding-top: 32px; padding-bottom: 32px; }
}

/* -----------------------------
   13) Forms (for cookie modal toggles etc.)
   ----------------------------- */
label { display: flex; align-items: center; gap: 10px; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; }

/* Toggle style (optional for cookie modal) */
.toggle { position: relative; width: 46px; height: 26px; border-radius: 999px; background: #CBD6E0; transition: background .2s ease; display: inline-flex; align-items: center; padding: 3px; }
.toggle::after { content: ""; width: 20px; height: 20px; background: #FFFFFF; border-radius: 50%; transition: transform .2s ease; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
input[type="checkbox"].toggle-input { position: absolute; opacity: 0; pointer-events: none; }
input.toggle-input:checked + .toggle { background: #2F6FA3; }
input.toggle-input:checked + .toggle::after { transform: translateX(20px); }

/* -----------------------------
   14) Cookie Consent Banner & Modal
   ----------------------------- */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; background: #FFFFFF; border-top: 1px solid var(--border); box-shadow: 0 -8px 20px rgba(14,42,71,0.08); z-index: 1200; padding: 14px 16px; display: flex; }
.cookie-banner .container { flex-direction: column; gap: 12px; }
.cookie-banner .cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-banner .cookie-actions .btn-accept { background: var(--primary); color: #fff; }
.cookie-banner .cookie-actions .btn-reject { background: #FFFFFF; color: var(--primary); border: 1px solid var(--border-strong); }
.cookie-banner .cookie-actions .btn-settings { background: var(--secondary); color: #fff; }
/* Hidden by default; use [data-open="true"] to display */
.cookie-banner { transform: translateY(100%); opacity: 0; visibility: hidden; transition: transform .35s ease, opacity .35s ease, visibility .35s ease; }
.cookie-banner[data-open="true"] { transform: translateY(0); opacity: 1; visibility: visible; }

/* Cookie Preferences Modal */
.cookie-modal { position: fixed; inset: 0; background: rgba(14,42,71,0.62); z-index: 1300; display: flex; justify-content: center; align-items: flex-end; padding: 16px; opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s ease; }
.cookie-modal[aria-hidden="false"] { opacity: 1; visibility: visible; }
.cookie-modal .modal-content { background: #FFFFFF; border-radius: var(--radius-lg); box-shadow: var(--shadow); width: 100%; max-width: 720px; display: flex; flex-direction: column; gap: 16px; padding: 20px; transform: translateY(20px); transition: transform .3s ease; }
.cookie-modal[aria-hidden="false"] .modal-content { transform: translateY(0); }
.cookie-modal .modal-header { display: flex; align-items: center; justify-content: space-between; }
.cookie-modal .modal-body { display: flex; flex-direction: column; gap: 12px; }
.cookie-modal .cookie-category { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); }
.cookie-modal .modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
@media (min-width: 768px) { .cookie-modal { align-items: center; } }

/* -----------------------------
   15) Images inside text and icon alignment
   ----------------------------- */
.text-section p > img, .contact-mini p > img, .contact-short p > img { display: inline-block; vertical-align: middle; margin-right: 8px; }

/* -----------------------------
   16) Page-specific minor tweaks
   ----------------------------- */
/* Footer newsletter and contact snippets use .text-section — remove card look inside footer already handled */

/* Wydarzenia lists tighter */
.page-wydarzenia .text-section ul { margin-bottom: 0; }

/* -----------------------------
   17) High-level responsiveness
   ----------------------------- */
@media (min-width: 768px) {
  .container { gap: 24px; }
  .content-wrapper { gap: 28px; }
  .trust-badges { gap: 18px; }
}

@media (min-width: 1024px) {
  /* Example two-column layout using flex-wrap in containers if needed */
  .content-grid > * { flex: 1 1 calc(50% - 20px); }
  .card-container > .card { flex: 1 1 calc(33% - 24px); }
}

/* -----------------------------
   18) Tables (if any in legal pages)
   ----------------------------- */
table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }

/* -----------------------------
   19) Prevent overlaps & z-index sanity
   ----------------------------- */
.hero, section, footer { position: relative; z-index: 1; }

/* -----------------------------
   20) Print friendly (basic)
   ----------------------------- */
@media print {
  .mobile-menu-toggle, .mobile-menu, .cookie-banner, .cookie-modal { display: none !important; }
  header { position: static; }
  a { text-decoration: none; }
}
