/* Shared legibility and footer. Page-specific layouts remain in styles.css. */
@layer base {
  body { font-size: 16px; }
  p { line-height: 1.75; }
}
@layer components {
  .hero-footnote { flex-wrap: wrap; }
  .config-layout > div { min-width: 0; }
  .consent-checkbox span { min-width: 0; overflow-wrap: break-word; }
  .header-inner { gap: 22px; }
  .nav { gap: 18px; }
  .nav a { font-size: 14px; }
  .nav .dropdown-hub-link, .nav .dropdown-item-link, .nav .dropdown-country-header { font-size: 14px; }
  .nav .dropdown-speed-link { font-size: 14px; }
  .country-header-title { white-space: normal; line-height: 1.4; }
  .dp-card-subline, .dp-card-footer, .dp-card-footer-left, .dp-sticky-right, .dp-family-tabs { flex-wrap: wrap; }
  .dp-spec-pill-val { white-space: normal; overflow: visible; text-overflow: clip; }
  .dp-family-tab { white-space: normal; }
  .dp-sticky-bar { min-height: 76px; }
  .dp-sticky-name { line-height: 1.4; }
  .dp-panel-badge { white-space: normal; }
  .footer { width: 100%; max-width: none; padding: 64px 0 0; background: var(--white); border-top: 1px solid var(--line); }
  .footer-main { display: grid; grid-template-columns: 1.35fr 1fr 1fr 1fr; gap: 48px; padding-bottom: 48px; }
  .footer-brand .footer-description { color: var(--graphite); font-size: 16px; line-height: 1.8; max-width: 30ch; margin-top: 24px; }
  .footer-service-region { display: block; margin-top: 20px; color: var(--muted); font-size: 14px; }
  .footer-main .footer-nav { display: flex; flex-direction: column; align-items: start; gap: 12px; }
  .footer-nav-title { color: var(--ink); font-size: 16px; font-weight: 700; margin-bottom: 8px; }
  .footer-main .footer-nav a { color: var(--graphite); font-size: 14px; line-height: 1.6; padding-block: 3px; }
  .footer-main .footer-nav a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 4px; }
  .footer-bottom { border-top: 1px solid var(--line); padding-block: 24px; font-size: 13px; color: var(--muted); gap: 24px; }
  .footer-bottom a { font-size: 14px; color: var(--ink); }
}
@layer responsive {
  @media (max-width: 1200px) {
    .header-inner { gap: 16px; }
    .nav { gap: 12px; }
    .footer-main { gap: 32px; }
  }
  @media (max-width: 860px) {
    .footer-main { grid-template-columns: 1fr 1fr; gap: 32px; }
    .footer-brand { grid-column: 1 / -1; }
    .footer-brand .footer-description { max-width: 52ch; }
    .dp-sticky-bar { gap: 10px; }
  }
  @media (max-width: 540px) {
    .page-heading h1, h1 { font-size: clamp(38px, 10vw, 52px); overflow-wrap: break-word; }
    h2 { font-size: 32px; overflow-wrap: break-word; }
    .speed-heading, .dp-tier-header, .location-card-head { flex-wrap: wrap; gap: 12px; }
    .speed-heading p { margin-right: 0; }
    .visual-controls { flex-wrap: wrap; }
    .speed-options { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .speed-options button span { display: block; margin-top: 4px; }
    .network-tabs button > span { display: block; margin-left: 0; margin-top: 4px; }
    .config-block-title { flex-wrap: wrap; gap: 10px; }
    .config-block-title h2, .config-summary h2, .request-summary h2 { font-size: 28px; }
    .location-breadcrumbs, .location-card-actions { overflow-wrap: break-word; }
    .locations-hub-cta-card h2 { font-size: 28px; }
    .footer { padding-top: 40px; }
    .footer-main { gap: 28px 22px; padding-bottom: 32px; }
    .footer-nav { gap: 10px; }
    .footer-nav:last-child { grid-column: 1 / -1; }
    .footer-nav:last-child a { padding-block: 4px; }
    .footer-brand .footer-description { font-size: 16px; }
    .footer-bottom { flex-wrap: wrap; gap: 14px 24px; font-size: 13px; }
  }
}

@layer responsive {
  @media (min-width: 700px) and (max-width: 959px) {
    .header { background: var(--paper); height: 72px; }
    .header-inner { gap: 20px; }
    .brand { gap: 8px; }
    .brand-symbol { width: 50px; max-height: 20px; }
    .brand-divider { height: 20px; }
    .brand-wordmark { width: 108px; max-height: 20px; }
    .header-actions { margin-left: auto; margin-right: 40px; }
    .header-actions { gap: 8px; }
    .header-inner { gap: 8px; }
    .theme-options, .language-options { right: -42px; }
    .menu-toggle { position: absolute; right: 20px; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 10px; width: 40px; height: 44px; border: 0; background: transparent; }
    .menu-toggle span { height: 1.5px; width: 20px; background: var(--ink); }
    .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--paper); padding: 18px 24px 24px; border-bottom: 1px solid var(--line); max-height: calc(100vh - 72px); overflow-y: auto; }
    .nav-open { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
    .nav a { padding: 10px 0; font-size: 16px; }
    .nav-item-dropdown { display: flex; flex-direction: column; align-items: stretch; width: 100%; }
    .nav-dropdown-trigger-row { display: flex; justify-content: space-between; align-items: center; width: 100%; }
    .dropdown-chevron-btn { width: 38px; height: 38px; }
    .nav-dropdown-menu { position: static; min-width: 100%; box-shadow: none; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); padding: 8px 0; margin-top: 4px; margin-bottom: 6px; display: none; opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
    .mobile-expanded .nav-dropdown-menu { display: block; }
    .dropdown-countries-grid { grid-template-columns: 1fr; gap: 16px; padding: 12px 10px; }
    .dropdown-country-col { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
    .dropdown-country-header { justify-content: center; }
    .dropdown-country-col:last-child { border-bottom: none; }
    .dropdown-speed-sublist { display: flex; flex-wrap: wrap; flex-direction: row; gap: 8px; padding-top: 8px; justify-content: center; }
    .dropdown-speed-link { background: var(--white); border: 1px solid var(--line); padding: 10px 12px; font-size: 14px; justify-content: center; text-align: center; flex: 1 1 calc(50% - 8px); }
    .dropdown-speed-link .speed-arrow { display: none; }
  }
}

@layer components {
  /* Family Info Blocks */
  .family-info-blocks { margin: 60px auto; display: flex; flex-direction: column; gap: 60px; }
  .family-info-row { display: flex; align-items: center; gap: 40px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
  .family-info-row.info-reverse { flex-direction: row-reverse; }
  .family-info-img-wrapper { flex: 1; min-width: 0; }
  .family-info-img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 300px; }
  .family-info-content { flex: 1; padding: 40px; }
  .family-info-title { font-size: 24px; font-weight: 700; color: var(--text-base); margin-bottom: 16px; letter-spacing: -0.01em; }
  .family-info-text { font-size: 16px; line-height: 1.6; color: var(--text-muted); }
  .family-info-blocks--editorial .family-info-row { align-items: stretch; gap: 0; }
  .family-info-blocks--editorial .family-info-content { min-width: 0; }
  .family-info-blocks--editorial .family-info-text + .family-info-text { margin-top: 16px; }
  .family-info-figure { margin: 0; height: 100%; min-height: 360px; position: relative; display: flex; flex-direction: column; }
  .family-info-blocks--editorial .family-info-img { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; object-fit: cover; }
  .family-info-credit { position: relative; margin-top: auto; padding: 12px 16px; font-size: 13px; line-height: 1.5; color: var(--text-muted); background: var(--surface-soft); overflow-wrap: anywhere; }
  .family-info-credit a { color: inherit; text-decoration: underline; }

  /* Promotional Telegram block (between catalog and editorial blocks) */
  .dp-page:has(> .promo-telegram) { padding-bottom: 0; }
  .promo-telegram { margin-top: 32px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
  .promo-telegram--text { grid-template-columns: 1fr; }
  .promo-telegram-content { padding: 40px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 14px; }
  .promo-telegram-content .eyebrow { margin: 0; }
  .promo-telegram-title { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: -0.01em; color: var(--text-base); }
  .promo-telegram-text { margin: 0; max-width: 62ch; font-size: 16px; line-height: 1.6; color: var(--text-muted); }
  .promo-telegram-btn { gap: 12px; margin-top: 8px; }
  .promo-telegram-figure { margin: 0; position: relative; min-height: 320px; display: flex; flex-direction: column; }
  .promo-telegram-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
}

@layer responsive {
  @media (max-width: 768px) {
    .family-info-row, .family-info-row.info-reverse { flex-direction: column; }
    .family-info-content { padding: 30px 20px; }
    .family-info-img { min-height: 200px; }
    .family-info-figure { min-height: 0; height: auto; }
    .family-info-blocks--editorial .family-info-img { position: static; height: 260px; min-height: 0; }
    .promo-telegram { grid-template-columns: 1fr; }
    .promo-telegram-content { padding: 28px 20px; }
    .promo-telegram-title { font-size: 24px; }
    .promo-telegram-btn { width: 100%; }
    .promo-telegram-figure { min-height: 0; }
    .promo-telegram-img { position: static; height: 240px; }
  }
}
