/* ======================================================
   LIGA ZADANIOWA – Optimized Styles for liga_front.html
   ====================================================== */
.bg_navi {
  background: var(--navy);
  color: #fff;
}


/* Local tokens (ensure availability when liga.css isn't loaded) */
:root {
  --navy: #34516e;
  --muted: #6b7785;
  font-size: 100%;
}

/* Prevent layout shift when vertical scrollbar appears/disappears */
html {
  scrollbar-gutter: stable;
}

/* small helpers used in osr_* pages */
.txt_navi { color: var(--navy); }
.w3-white, .bg-white { background: #fff !important; color: inherit; }


/* Base Styles */
html,
body {
    min-height: 100%;
}
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background: #fff; /* ensure white background inside iframe pages */
    color: #2d435e; /* readable default text color */
    font-size: 1.125rem; /* 18px → 1.125rem for scalable baseline */
    display: flex;             /* allow sticky footer layout */
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Header Styles */
.front_title {
    line-height: 2rem;
    text-align: center;
    padding: 1rem 0.5rem;      /* add small side padding */
    max-width: 980px;          /* cap width to fit middle column nicely */
    margin: 0 auto;            /* center in available space */
    box-sizing: border-box;    /* include padding in width */
}

/* Larger headings for better readability */
.front_title h1 {
    font-size: 2rem;
    margin: 0.25rem 0;
}
.front_title h2 {
    font-size: 1.5rem;
    margin: 0.25rem 0;
}

/* Shared title style for 'Liga Zadaniowa' headings */
.lz-title {
    font-size: 2rem;
    line-height: 2rem;
    margin: 1.5rem 0 0.25rem; /* unified spacing: 1.5rem above, slight below */
    text-align: center;
    color: #2d435e;
    font-weight: 400 !important; /* force not bold to match osr_* */
}
.lz-title a { color: inherit; text-decoration: none; font-weight: inherit !important; }

/* Ensure front-page H1 is not bold even with global/resets */
.front_title h1,
.front_title h1 a {
    font-weight: 400 !important;
}

/* Apply same top spacing for osr_* pages that use plain <h1> (no .lz-title) */
.front_title h1 {
    margin: 1.5rem 0 0.25rem !important; /* equal spacing with .lz-title */
    padding-top: 0 !important;        /* neutralize w3-padding differences */
}

/* Extra spacing on the front page to match osr_* pages */
.front_title .lz-title {
    margin-top: 1.5rem; /* similar to w3-margin-top spacing */
}

/* Advertisement Section */
/* .advertisement {
    display: inline-block;
    padding: 1rem 2rem;
    margin: 2rem auto;
    border: 1px solid #2d435e;
    border-radius: 10px;
    text-align: center;
    max-width: 90%;
} */

.advertisement {
    display: inline-block;
    padding: 1rem 1.5rem;      /* reduce side padding */
    margin: 2rem auto;         /* slightly smaller margin */
    border-top: 2px solid #2d435e;
    border-left: 1px solid lightgray;
    border-right: 1px solid lightgray;
    border-bottom: 2px solid #2d435e;
    border-radius: 10px;
    max-width: 720px;          /* keep card narrower */
    width: 100%;               /* responsive */
    box-sizing: border-box;
}


.advertisement img {
    max-width: 80px;
    margin: 0.5rem 0;
}

.advertisement h3 {
    /* color: #2d435e; */
    margin: 0.5rem 0;
}

/* Gift icon replacing the old gift.png */
.ad-gift-icon {
    font-size: 64px;     /* similar visual weight to the old image */
    line-height: 1;
    color: #2d435e;      /* match heading/nav color */
    margin: 0.5rem 0;
    display: inline-block;
}

/* Footer Styles */
.footer {
    line-height: 1.8rem;
    margin: 2rem 0;
    text-align: center;
    padding: 1rem;
}

/* Front page site footer (new) */
.site-footer {
  background: transparent;          /* no tinted background */
  border-top: 1px solid #e9edf3;    /* keep subtle separator */
  color: var(--muted);
  font-size: 0.85rem; /* smaller footer text */
}
.site-footer .footer-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 1rem 0.75rem;
  text-align: center;
  box-sizing: border-box;
}
/* Optional fill mode: make footer taller on large screens so columns reach down */
@media (min-width: 992px) {
  .site-footer.footer-fill .footer-container {
    min-height: 42svh; /* try ~42% of small viewport height */
    display: grid;
    place-items: stretch; /* let inner grid expand naturally */
  }
}
.site-footer h2 {
  margin: 0 0 0.6rem;
  font-size: 1rem; /* more compact heading */
  color: var(--navy);
  font-weight: 600;
  display: inline-block;                /* allow pill-like background */
  padding: 0.25rem 0.65rem;             /* subtle inner space */
  background: rgba(52, 81, 110, 0.06);  /* very light navy tint */
  border: 1px solid #e9edf3;            /* gentle outline */
  border-radius: 999px;                  /* soft pill */
}
.site-footer .footer-grid {
  display: grid;
  gap: 0.6rem 1rem;
  grid-template-columns: 1fr; /* default: single column */
  align-items: stretch;        /* make items equal height per row */
}
/* When in single-column mode, center the column and limit its width */
@media (max-width: 599.98px) {
  .site-footer .footer-container { display: flex; justify-content: center; flex-direction: column; align-items: center; }
  .site-footer .footer-grid {
    grid-template-columns: minmax(0, 520px); /* single track up to 520px */
    justify-content: center;                 /* center the track */
    width: auto;                             /* shrink to content */
    margin-left: 0;
    margin-right: 0;
  }
}
/* Name the grid areas for each member so we can control placement */
.site-footer .footer-grid .member--agnieszka { grid-area: agnieszka; }
.site-footer .footer-grid .member--maria { grid-area: maria; }
.site-footer .footer-grid .member--magdalena { grid-area: magdalena; }
.site-footer .footer-grid .member--zbigniew { grid-area: zbigniew; }
.site-footer .footer-grid .member--piotr { grid-area: piotr; }

/* Mobile (default, 1 column): set explicit vertical order */
.site-footer .footer-grid {
  grid-template-areas:
    "agnieszka"
    "zbigniew"
    "maria"
    "piotr"
    "magdalena";
}
@media (min-width: 600px) {
  /* Keep single-column layout between 600px and 1199.98px */
  .site-footer .footer-grid { grid-template-columns: 1fr; }
}
/* Center the single-column layout for all widths below 1200px */
@media (max-width: 1199.98px) {
  .site-footer .footer-container { display: flex; justify-content: center; flex-direction: column; align-items: center; }
  .site-footer .footer-grid {
    grid-template-columns: 1fr; /* single column */
    width: min(520px, 100%);    /* keep a comfortable max width */
    margin-left: auto;
    margin-right: auto;        /* center the grid itself */
    justify-content: center;
  }
}
/* Remove previous 3-column desktop layout; keep single column until 1200px */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .site-footer .footer-grid { grid-template-columns: 1fr; }
}

/* Extra-large screens: place all five boxes in one row */
@media (min-width: 1200px) {
  .site-footer .footer-container { max-width: 1360px; }
  .site-footer .footer-grid {
    grid-template-columns: repeat(5, 1fr);
    grid-template-areas: "agnieszka zbigniew maria piotr magdalena";
    gap: 0.5rem 0.6rem; /* slightly tighter gaps horizontally */
  }
  .site-footer .footer-col {
    line-height: 1.45;
    background: transparent;      /* remove card tint */
    border: 0;                    /* no card border */
    border-radius: 0;             /* no rounding */
    padding: 0.35rem 0;           /* tighter vertical rhythm */
  }
  /* Thin divider between consecutive member boxes (not after labels) */
  .site-footer .footer-grid .footer-col + .footer-col { border-top: 1px solid #e9edf3; }
  .site-footer .footer-grid .footer-label {
    color: var(--navy);
    font-weight: 600;
    text-align: center;
    margin: 0.45rem 0 0.2rem;     /* a touch more air above labels */
    opacity: 0.9;                 /* subtle de-emphasis */
    font-size: 0.95rem;
  }
  .site-footer .footer-col .member-name {
    display: block;                 /* names on their own line */
    line-height: 1.45;              /* match container line-height */
    margin-bottom: 2px;             /* small gap before meta line */
    font-weight: 600;               /* make name stand out */
    color: var(--navy);
  }
  @media (min-width: 520px) {
    .site-footer .footer-col .member-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  }
  .site-footer .footer-col .member-meta {
    display: block;
    white-space: nowrap;       /* keep on one line on all sizes */
    overflow: hidden;          /* avoid overflow */
    text-overflow: ellipsis;   /* show ellipsis when clipped */
    color: var(--muted);
    font-size: 0.9rem;
  }

}

/* Slight decorative flourish on the left column bottom-right corner */
@media (min-width: 992px) {
  .site-footer .footer-grid > .footer-col:first-child { border-bottom-right-radius: 14px; }
}

/* Keep certain footer bits on one line only on wider screens */
@media (min-width: 600px) {
  .nowrap { white-space: nowrap; }
}

/* Final overrides: stack footer into single centered column on all widths */
.site-footer .footer-grid {
  grid-template-columns: 1fr !important;
  grid-template-areas: none !important;
  justify-content: center;          /* center the single track */
  width: min(520px, 100%);
  margin-left: auto;
  margin-right: auto;
  gap: 0.5rem 0.6rem;               /* comfortable vertical spacing */
}
.site-footer .footer-grid .footer-label {
  color: var(--navy);
  font-weight: 600;
  text-align: center;
  margin: 0.25rem 0 0.1rem;
}

/* Minimal simple footer (used in liga_front.html) */
.simple-footer {
  text-align: center;
  white-space: nowrap;                       /* no mid-line wrapping; <br> still breaks lines */
  font-size: clamp(0.7rem, 1.4vw, 0.95rem);  /* small on phones, grows up to ~0.95rem */
  line-height: 1rem;
  color: var(--muted);
  padding: 0.75rem 0.5rem;
  border: 0;                                 /* no visible border on the footer itself */
  flex: 0 0 auto;                            /* do not stretch; plays well with body flex + main flex:1 */
}
.simple-footer .komitet {
  display: block;
  width: 100%;
  padding: 1rem;
  border-top: 0.5px solid #e9edf3;     /* thin line above */
  border-bottom: 1px solid #e9edf3;  /* thin line below */
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  background: #fff;
  color: #2d435e;
  font-weight: 600;
  line-height: 1rem;
  margin-bottom: 0.5rem;
}
.komitet_lokalny h3 {
  font-size: 1em;      /* normal text size */
  font-weight: 400;    /* normal weight label */
  line-height: 1.4;
  margin: 0.25rem 0 0.15rem;
}
.komitet_name { font-weight: 600; }
/* Labels (Przewodnicząca, Wiceprzewodniczący) */
.simple-footer b {
  display: block;
  color: var(--navy);
  font-weight: 600;
  margin: 0.25rem 0 0;             /* even tighter space below labels */
  opacity: 0.9;                 /* subtle de-emphasis */
  font-size: 0.95rem;
}
/* Responsive members layout */
.simple-footer .members {
  display: grid;
  grid-template-columns: 1fr;        /* stacked by default */
  gap: 0.3rem 0.5rem;                /* slightly more space between members */
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 1360px;
  margin: 0.25rem auto 0;            /* slightly closer to the title */
}
.simple-footer .member-item {
  text-align: center;
}
.simple-footer .member-item .name { display: block; font-weight: 600; color: var(--navy); }
.simple-footer .member-item .meta { display: block; color: var(--muted); white-space: normal; }
.simple-footer .labels-mobile { display: block; }

/* Large screens: Chair on its own row; 4 vices in one row below; show labels spanning full width */
@media (min-width: 1200px) {
  .simple-footer .members { grid-template-columns: repeat(4, 1fr); }
  .simple-footer .member-item.chair { grid-column: 1 / -1; }
  .simple-footer .labels-mobile { display: block; grid-column: 1 / -1; }
}

.simple-footer .wiceprzewodniczacy {line-height: 1.5rem;}

/* Navigation */
.osrodki-nav {
    background-color:#fff;
    border-bottom: 0px solid #ddd; 
    position: sticky; top: 0;          /* was: position: relative; */
    z-index: 100;
    padding: 8px 0;
    overflow-x: hidden;                 /* keep */
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);  /* add */
}
/* Show nav on desktop */
@media (min-width: 1183px) {
  .osrodki-nav { display: block !important; }
}
/* Show child nav on all widths below ~1187px (closes 1117–1186 gap) */
@media (max-width: 1186px) {
  .osrodki-nav { display: block !important; }
  .osrodki-nav .desktop-only { display: flex !important; }
}

/* Desktop Navigation */
nav > ul.w3-navbar {
    display: flex;
    justify-content: space-evenly;
    flex-wrap: wrap;
    margin: 0;
    padding: 0 8px;            /* small inner gutter */
    list-style: none;
    max-width: none; width: 100%;  /* allow full width for even distribution */
    box-sizing: border-box;
    gap: 6px 10px;             /* equal spacing between buttons */
}

nav > ul.w3-navbar > li {
    margin: 4px;               /* more breathing room between buttons */
    padding: 0;
}

nav > ul.w3-navbar > li > a {
    display: block;
    padding: 0.28rem 0.6rem;   /* tighter to fit more on one line */
    color: var(--navy);
    background-color: #f7f9fc;
    text-decoration: none;
    border: 1px solid #e0e4ea;
    border-radius: 999px;       /* pill shape */
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    font-size: 0.9rem;          /* match desktop white bar */
    line-height: 1.2;
    font-weight: 500;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent; /* avoid tap flash on mobile */
}

/* Active page indicator: same color scheme as hover (no lift) */
nav > ul.w3-navbar > li > a.active {
    background-color: var(--navy);
    color: #fff;
    border-color: var(--navy);
}

nav > ul.w3-navbar > li > a:hover {
    background-color: var(--navy);
    color: #fff;
    border-color: var(--navy);
}

/* Mouse down: keep stable, no lift */
nav > ul.w3-navbar > li > a:active {
    background-color: var(--navy);
    color: #fff;
    transform: none;
}

/* Active page never lifts on hover */
nav > ul.w3-navbar > li > a.active:hover {
    transform: none;
}

/* Remove focus ring on top nav buttons to avoid flicker on click */
nav > ul.w3-navbar > li > a:focus,
nav > ul.w3-navbar > li > a:focus-visible {
    outline: none;
}

/* Mobile Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: absolute;
    top: 8px;
    right: 15px;
    z-index: 1000;
}

.mobile-menu-toggle a {
    display: inline-block;
    background: none !important;
    color: #000 !important;
    padding: 6px 12px;
    text-decoration: none;
    font-size: 24px;
    line-height: 1;
    transition: all 0.2s ease;
    border: none !important;
    box-shadow: none !important;
}

.mobile-menu-toggle a:hover {
    background: none !important;
    transform: none;
    color: #333 !important;
}

/* Mobile Navigation */
#mobile-navigation {
    display: none;
    padding: 10px 0;
    background-color: #fff; /* keep mobile dropdown white as well */
    border-bottom: 0;
}

#mobile-navigation.w3-show {
    display: block;
}

body.noscroll {
    overflow: hidden;
}

/* ----------------------
   Rejon cards & tables
---------------------- */
.rejon_card {
    margin: 1.2rem auto;
    max-width: 900px;
    border: 1px solid #eee;
    border-radius: 6px;
    background: #fff;
    padding: 0.5rem 0 0.8rem 0;
    box-shadow: none;
}
.rejon_header {
    background: #f9f9f9;
    color: #2d435e;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    margin: 0 0 0.5rem 0;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.osrodki {
    width: 100%;
    border-collapse: collapse; /* collapse to single hairline grid */
}
.osrodki th,
.osrodki td {
    padding: 0.45rem 0.6rem;    /* smaller, compact cells */
    text-align: left;
    border: 1px solid #e6e9ee; /* neutral, subtle borders */
    font-size: 0.98rem;         /* a bit smaller text */
}
.osrodki th {
    background: none;
    color: #2d435e;
    font-weight: 500;
    width: 30%;
}
.osrodki tr:last-child td,
.osrodki tr:last-child th {
    border-bottom: 1px solid #e6e9ee; /* keep bottom border for full grid */
}
@media (max-width: 768px) {
    .osrodki th,
    .osrodki td {
        display: block;
        width: 100%;
        border: none;
        padding: 0.4rem 0.8rem;
    }
    .osrodki th {
        color: #2d435e;
        font-weight: 600;
        padding-top: 0.6rem;
    }
    .osrodki td {
        padding-bottom: 0.6rem;
    }
    .rejon_header {
        font-size: 1.05rem;
        text-align: center;
    }
}



/* ----------------------
   Helper button (optional, inside iframe pages)
---------------------- */
.open-parent-menu {
    display: none;
    border: 1px solid #ddd;
    background: #f9f9f9;
    color: #2d435e;
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    font-size: 0.95rem;
    cursor: pointer;
    margin: 0.5rem auto 1rem;
}
.open-parent-menu:hover {
    background: #e9eef4;
}
@media (max-width: 992px) {
    .open-parent-menu {
        display: inline-block;
    }
}

/* Instead of style */
.line_height_4rem {
    line-height: 4rem;
}

/* Mobile select-based menu */
.mobile-picker {
    display: none;
}
.mobile-picker-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.35rem;
}
.mobile-picker-select {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: #fff;
    color: #2d435e;
    font-size: 0.95rem;
}

/* Hide desktop list on small screens; show the picker instead */
@media (max-width: 992px) {
    .mobile-picker {
        display: block;
        margin-bottom: 1rem;
    }
}

/* Safety override: ensure child nav buttons are visible below desktop breakpoint */
@media (max-width: 1182.98px) {
  nav.osrodki-nav > ul.w3-navbar.desktop-only { display: flex !important; }
}

/* Strong final overrides for distribution and compactness */
.osrodki-nav > ul.w3-navbar {
  justify-content: space-evenly !important;
  width: 100% !important;
  max-width: none !important;
  gap: 6px 10px !important;
}
.osrodki-nav > ul.w3-navbar > li > a { padding: 0.28rem 0.6rem !important; }

/* Centered, non-stretched nav layout (final override) */
.osrodki-nav > ul.w3-navbar {
  display: flex !important;
  justify-content: center !important;   /* center the row */
  flex-wrap: wrap !important;
  gap: 6px 10px !important;             /* equal spacing between buttons */
  width: auto !important;               /* do not stretch across full width */
  max-width: 1100px !important;         /* cap width for nicer centering */
  margin-left: auto !important;
  margin-right: auto !important;        /* center the block itself */
}
.osrodki-nav > ul.w3-navbar > li {
  flex: 0 0 auto !important;            /* natural width per button */
  min-width: unset !important;
  max-width: none !important;
  margin: 0 !important;                 /* rely on gap, not margins */
}
.osrodki-nav > ul.w3-navbar > li > a {
  width: auto !important;               /* no stretching of buttons */
  text-align: center !important;
}

/* On very large screens, keep buttons centered; allow wrap to avoid overflow */
@media (min-width: 1200px) {
  .osrodki-nav > ul.w3-navbar {
    max-width: 1360px !important; /* wide but capped to avoid overflow */
    flex-wrap: wrap !important;   /* allow wrapping to prevent overflow */
    gap: 6px 8px !important;
  }
}

/* Desktop row balancing: ensure >=3 buttons on the last line using centered flex */
@media (min-width: 1200px) {
  .osrodki-nav > ul.w3-navbar {
    display: flex !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 6px 10px !important;
    width: auto !important;
    max-width: 1360px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  .osrodki-nav > ul.w3-navbar > li { margin: 0 !important; }
  .osrodki-nav > ul.w3-navbar > li > a { width: auto !important; text-align: center !important; }
}

@media (min-width: 993px) and (max-width: 1199.98px) {
  .osrodki-nav > ul.w3-navbar {
    display: flex !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 6px 10px !important;
    width: auto !important;
    max-width: 1100px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  .osrodki-nav > ul.w3-navbar > li { margin: 0 !important; }
  .osrodki-nav > ul.w3-navbar > li > a { width: auto !important; text-align: center !important; }
}

/* ----------------------
   Organizer cards (liga_organizatorzy.html)
   Compact, minimalist boxes and grid
---------------------- */
.box-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 980px;
  padding: 0 1rem 2rem;
  margin: 0 auto;
}
/* Centered single-column variant */
.box-grid--center {
  grid-template-columns: minmax(260px, 780px);
  justify-content: center;
}
@media (max-width: 768px) {
  .box-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
}

/* Card */
.doc-box {
  border: 1px solid #e9edf3;        /* delicate border */
  background: #f7f9fc;              /* very light silver */
  border-radius: 14px;
  overflow: hidden;                 /* clean edges */
  transition: box-shadow 0.12s ease, transform 0.12s ease;
  display: block;                   /* ensure anchor behaves as block */
  color: inherit;                   /* inherit text color */
  text-decoration: none;            /* no underline */
}
.doc-box:hover,
.doc-box:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12); /* soft lift */
}

/* Header */
.doc-box__header {
  background: #e0e4e9;             /* neutral header */
  color: var(--navy);
  padding: 0.7rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #d4d9e0;
}
.doc-box__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
  text-align: center;
}

/* Body */
.doc-box__body {
  background: #fff;
  color: #2d435e;
  padding: 0.8rem 1rem;
}

/* Organizer logos */
.org-card__logo {
  display: block;
  height: 68px;
  width: auto;
  margin: 0.25rem auto;
  object-fit: contain;
}
@media (min-width: 768px) {
  .org-card__logo { height: 92px; }
}

/* ======================================================
   Envelope-style callout (mail-card)
   ====================================================== */
.mail-card {
  max-width: 520px;
  margin: 0.75rem auto 1.1rem;
  background: #f7f9fc;                 /* very light silver */
  border: 1px solid #e0e4ea;            /* delicate border */
  border-radius: 14px;                  /* soft rounding */
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.mail-card > a {
  display: flex;
  align-items: center;
  justify-content: center; /* center icon + text horizontally */
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  color: inherit;
  text-decoration: none;
  text-align: center; /* center multi-line text */
}
.mail-card__icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e9eef5;                  /* subtle ghost circle */
  border: 1px solid #d8dee9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  font-size: 1.1rem;
}
.mail-card__title {
  font-weight: 600;
  line-height: 1.25;
}
.mail-card__desc { /* optional small description */
  display: block;
  font-size: 0.9rem;
  color: #6b7785;                        /* muted */
}
.mail-card:hover {
  background: #eef3f8;
  border-color: #d7dde6;
  box-shadow: 0 6px 18px rgba(0,0,0,0.10);
}
.mail-card > a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #dfe4ea, 0 8px 24px rgba(0,0,0,0.14);
  border-radius: 14px; /* match card rounding */
}

@media (min-width: 1200px) {
  .mail-card { max-width: 640px; }
}

/* ======================================================
   Aliases without w3- prefix (for gradual migration)
   ====================================================== */
/* Utilities */
.pad { padding: 1rem; }
.text-center { text-align: center; }

/* Container alias matching .w3-container center layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* Larger padding alias for former w3-padding-24 */
.pad-lg { padding: 1.5rem; }

/* Navbar alias (mirrors final centered non-stretched layout) */
nav > ul.navbar {
  display: flex !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  gap: 6px 10px !important;             /* equal spacing between buttons */
  width: auto !important;               /* do not stretch across full width */
  max-width: 1100px !important;         /* cap width for nicer centering */
  margin-left: auto !important;
  margin-right: auto !important;        /* center the block itself */
  padding: 0 8px;                       /* small inner gutter */
  list-style: none;                     /* remove bullets */
}
nav > ul.navbar > li {
  flex: 0 0 auto !important;            /* natural width per button */
  min-width: unset !important;
  max-width: none !important;
  margin: 0 !important;                 /* rely on gap, not margins */
}
nav > ul.navbar > li > a {
  display: block;
  padding: 0.28rem 0.6rem;              /* tighter to fit more on one line */
  color: var(--navy);
  background-color: #f7f9fc;
  text-decoration: none;
  border: 1px solid #e0e4ea;
  border-radius: 999px;                 /* pill shape */
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  font-size: 0.9rem;                    /* match desktop white bar */
  line-height: 1.2;
  font-weight: 500;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent; /* avoid tap flash on mobile */
}
nav > ul.navbar > li > a.active { background-color: var(--navy); color: #fff; border-color: var(--navy); }
nav > ul.navbar > li > a:hover { background-color: var(--navy); color: #fff; border-color: var(--navy); }
nav > ul.navbar > li > a:active { background-color: var(--navy); color: #fff; transform: none; }
nav > ul.navbar > li > a:focus, nav > ul.navbar > li > a:focus-visible { outline: none; }

@media (min-width: 1200px) {
  nav > ul.navbar { max-width: 1360px !important; gap: 6px 8px !important; }
}
@media (min-width: 993px) and (max-width: 1199.98px) {
  nav > ul.navbar { max-width: 1100px !important; }
}

/* ======================================================
   Responsive Styles
   ====================================================== */
@media (min-width: 993px) {
    .mobile-only {
        display: none !important;
    }
}

@media (max-width: 992px) {
    /* Always show the top menu; let items wrap to new lines */
    .desktop-only {
        display: flex !important;
    }

    .mobile-menu-toggle {
        display: none; /* no JS toggle, keep hidden */
    }

    .osrodki-nav {
        padding: 8px 15px; /* uniform padding, no space for toggle */
        min-height: 44px; /* Minimum touch target size */
    }

    nav > ul.w3-navbar {
        width: 100%;
        border: none;
        padding: 0.4rem 0.8rem;
    }
    .osrodki th {
        color: #2d435e;
        font-weight: 600;
        padding-top: 0.6rem;
    }
    .osrodki td {
        padding-bottom: 0.6rem;
    }
    .rejon_header {
        font-size: 1.05rem;
        text-align: center;
    }
}

/* Desktop Styles */
@media (min-width: 993px) {
    .w3-hide-small {
        display: block !important;
    }

    .w3-hide-medium.w3-hide-large {
        display: none !important;
    }

    #navigation {
        display: none !important;
    }

    nav > ul.w3-navbar {
        display: flex;
    }
}

/* Center content */
.w3-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Main grows to fill available height so footer sticks to bottom when short */
main { flex: 1 0 auto; }
footer.site-footer { flex: 0 0 auto; }

/* Logo styles */
.front_title img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 1rem;
}

/* Drawer Backdrop */
.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.drawer-backdrop.show {
    display: block;
}

body.noscroll {
    overflow: hidden;
}

.orange {color: orange;}
.green {color: green;}