/* ============================================
   IBRI — Shared Design System
   Used by all pages: index, brand, product, philosophy, mobile
   ============================================ */

:root {
  /* Type scale */
  --font-sans: 'Manrope', 'Helvetica Neue', Arial, sans-serif;     /* Display / UI / labels — like "Ibri", "ИМБИРНЫЙ" */
  --font-body: 'Inter', 'Manrope', 'Helvetica Neue', Arial, sans-serif; /* Paragraphs and secondary text */
  --font-serif: 'Cormorant Garamond', 'PT Serif', Georgia, serif;  /* Italic accents — "By Severin", "не приходится объяснять" */
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Brand palette */
  --indigo: #1F1B4A;
  --terracotta: #C75A2E;
  --gold: #C99858;
  --cream: #FAF4E8;
  --sand: #FAEEDA;
  --bottle: #5B3A2A;

  /* Radii */
  --border-radius-sm:  0;
  --border-radius: 0;
  --border-radius-lg:  0;
}

/* Reset + page chrome (cream frame around the site card) */
html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--indigo);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
}

/* Inner content container — used on header/footer rows that should stay narrow on huge monitors */
.container {
  max-width: 1280px;
  margin: 0 auto;
}

/* mobile.html keeps a small frame so the phone mock-ups feel like screens, not the site */
body.mobile-shell {
  background: #EFE7D6;
  padding: 24px 12px;
  max-width: 1280px;
  margin: 0 auto;
}

/* ============================================
   FONT BEHAVIOUR
   The uploaded fragments set `font-family: var(--font-sans)` on their outer wrapper.
   That cascades Manrope to everything. We override paragraphs to Inter via
   direct selectors (direct rules beat inherited inline font-family).
   ============================================ */
.ibri-page p,
.ibri-page li {
  font-family: var(--font-body);
}

/* The italic serif accents stay on the elements that explicitly set --font-serif inline. */

/* ============================================
   SITE HEADER  (consistent across all pages)
   ============================================ */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  background: var(--cream);
  border-bottom: 0.5px solid rgba(31, 27, 74, 0.1);
}

.site-header .brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.site-header .brand img {
  height: 32px;
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  gap: 28px;
  font-family: var(--font-sans);
  font-size: 14px;
}

.site-nav a {
  color: var(--indigo);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.site-nav a:hover {
  border-bottom-color: rgba(31, 27, 74, 0.3);
}

.site-nav a.is-active {
  font-weight: 500;
  border-bottom-color: var(--terracotta);
}

.site-header .contact {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--indigo);
  text-decoration: none;
}

/* Mobile header variant */
.site-header.mobile {
  padding: 14px 16px;
}
.site-header.mobile .brand { font-size: 22px; }

/* ============================================
   SITE FOOTER (consistent across all pages)
   ============================================ */
.site-footer {
  background: var(--indigo);
  padding: 36px 32px 32px;
  color: var(--cream);
}

.site-footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 32px;
  font-size: 13px;
  font-family: var(--font-body);
}

.site-footer .brand-block {
  font-family: var(--font-sans);
}

.site-footer .brand-block .mark {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.site-footer .brand-block .tagline {
  opacity: 0.7;
  line-height: 1.6;
  font-family: var(--font-body);
}

.site-footer .col-title {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 14px;
}

.site-footer .col-list {
  line-height: 2;
  opacity: 0.85;
}

.site-footer .col-list a {
  color: var(--cream);
  text-decoration: none;
  display: block;
}

.site-footer .col-list a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer-meta {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 0.5px solid rgba(250, 244, 232, 0.15);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  opacity: 0.55;
  letter-spacing: 0.3px;
}

/* ============================================
   PAGE WRAPPER
   ============================================ */
.ibri-page {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--indigo);
  max-width: 2500px;
  margin: 0 auto;
}

/* ============================================
   RESPONSIVE — TABLET (≤ 960px)
   Two-column hero grids collapse to one column;
   site header wraps nav under the brand.
   ============================================ */
@media (max-width: 960px) {
  .ibri-page [style*="grid-template-columns: 1.1fr 0.9fr"],
  .ibri-page [style*="grid-template-columns: 0.85fr 1.15fr"],
  .ibri-page [style*="grid-template-columns: 1fr 1.2fr"],
  .ibri-page [style*="grid-template-columns: 1.2fr 1fr"],
  .ibri-page [style*="grid-template-columns: 0.65fr 1.35fr"],
  .ibri-page [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  .ibri-page [style*="grid-template-columns: repeat(3, 1fr)"],
  .ibri-page [style*="grid-template-columns: repeat(3, minmax(0, 300px))"],
  .ibri-page [style*="grid-template-columns: repeat(3, minmax(0, 380px))"],
  .ibri-page [style*="grid-template-columns: repeat(4, 1fr)"],
  .ibri-page [style*="grid-template-columns: repeat(5, 1fr)"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    justify-content: stretch !important;
  }

  /* Hero headings & big display type shrink */
  .ibri-page h1[style*="font-size: 60px"],
  .ibri-page h1[style*="font-size: 56px"] {
    font-size: 40px !important;
    letter-spacing: -0.8px !important;
  }
  .ibri-page h1[style*="font-size: 48px"] {
    font-size: 36px !important;
  }
  .ibri-page h2[style*="font-size: 36px"] {
    font-size: 28px !important;
  }
  .ibri-page h2[style*="font-size: 32px"] {
    font-size: 26px !important;
  }

  /* Quote (italic serif) shrink */
  .ibri-page p[style*="font-size: 30px"] {
    font-size: 22px !important;
  }

  /* Section padding */
  .ibri-page > div[style*="padding: 64px"],
  .ibri-page > div[style*="padding: 72px"],
  .ibri-page > div[style*="padding: 56px"] {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  .ibri-page > div[style*="padding: 48px"] {
    padding: 32px 20px !important;
  }

  /* Header */
  .site-header {
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 20px;
  }
  .site-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    gap: 18px;
    padding-top: 6px;
    border-top: 0.5px solid rgba(31, 27, 74, 0.08);
  }

  /* Footer */
  .site-footer-grid {
    grid-template-columns: 1fr !important;
    gap: 24px;
  }
  .site-footer-meta {
    flex-direction: column;
    gap: 6px;
  }
}

/* ============================================
   RESPONSIVE — MOBILE (≤ 600px)
   Multi-column grids collapse to single column.
   ============================================ */
@media (max-width: 600px) {
  body { font-size: 14px; }

  .ibri-page [style*="grid-template-columns: repeat(3, 1fr)"],
  .ibri-page [style*="grid-template-columns: repeat(3, minmax(0, 300px))"],
  .ibri-page [style*="grid-template-columns: repeat(3, minmax(0, 380px))"],
  .ibri-page [style*="grid-template-columns: repeat(4, 1fr)"],
  .ibri-page [style*="grid-template-columns: repeat(5, 1fr)"],
  .ibri-page [style*="grid-template-columns: repeat(2, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    justify-content: stretch !important;
  }

  /* Product page main image block (individual product pages) — fits screen width */
  .ibri-page [style*="height: 640px"] {
    height: 420px !important;
    padding: 14px !important;
  }
  /* Hero image / portrait blocks */
  .ibri-page [style*="height: 540px"],
  .ibri-page [style*="height: 520px"],
  .ibri-page [style*="height: 480px"] {
    height: 360px !important;
  }
  /* 3 flavor cards image area on product.html */
  .ibri-page [style*="height: 460px"] {
    height: 320px !important;
  }

  .ibri-page h1[style*="font-size: 60px"],
  .ibri-page h1[style*="font-size: 56px"] {
    font-size: 32px !important;
    letter-spacing: -0.5px !important;
  }
  .ibri-page h1[style*="font-size: 48px"] {
    font-size: 30px !important;
  }
  .ibri-page h2[style*="font-size: 36px"] {
    font-size: 24px !important;
  }
  .ibri-page p[style*="font-size: 30px"] {
    font-size: 19px !important;
  }

  .ibri-page > div[style*="padding"] {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .site-header {
    padding: 12px 16px;
  }
  .site-header .brand { font-size: 22px; }
  .site-header .contact { display: none; }
  .site-nav { gap: 14px; font-size: 13px; }

  .site-footer { padding: 28px 20px; }
}

/* Make all anchors in page content inherit color by default for tidy look */
.ibri-page a {
  color: inherit;
}
