/* ==========================================================================
   modern.css - visual refresh for Internetowy Serwis Edukacyjny
   Loaded LAST in includes/header.html and includes/header_portal.html, so it
   only restyles the existing markup. No PHP, forms or links were changed.
   To go back to the old look, remove the <link ... modern.css> line.
   ========================================================================== */

:root {
  --red: #a30000;
  --red-dark: #7a0000;
  --red-soft: #fbeaea;
  --navy: #00283a;
  --navy-2: #0b3a50;
  --ink: #1f2933;
  --muted: #5f6b76;
  --line: #e6e2dc;
  --bg: #f6f4f1;
  --card: #ffffff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .14);
  --focus: 0 0 0 4px rgba(163, 0, 0, .14);
  --blue-dark: #003a70;   /* link color on white/light backgrounds */
  --red-hover: #8b0000;   /* link hover on white/light backgrounds */
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a, a:link, a:visited { color: var(--blue-dark); transition: color .15s ease, background-color .15s ease; }
a:hover { color: var(--red-hover); }
::selection { background: var(--red); color: #fff; }
img { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }

/* ---------- Top bar ---------- */
#topbar {
  background: var(--red-dark);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  padding: .35rem 0;
}
#topbar p { font-size: .78rem; letter-spacing: .02em; margin: 0; padding: .25rem 0; }
#topbar a, #topbar a:link, #topbar a:visited { color: rgba(255, 255, 255, .88); }
#topbar a:hover { color: var(--red-hover); }
#topbar p strong { font-weight: 600; }

/* ---------- Header / brand ---------- */
header { border-bottom: 0; box-shadow: 0 2px 0 rgba(0, 0, 0, .04); }
nav {
  background: radial-gradient(1200px 400px at 50% -120px, #c21414 0%, var(--red) 45%, var(--red-dark) 100%);
}
p.logo {
  color: #fff;
  font-size: 1.45rem;
  font-weight: 300;
  letter-spacing: .01em;
  line-height: 1.35;
  margin: 1rem auto 0;
  max-width: 900px;
  padding: 0 1rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .2);
  top: 0;
}
p.logo strong { font-weight: 700; }
nav .line > div > p:last-child { margin: 0; line-height: 1.2; }

/* ---------- Main menu (desktop) ---------- */
@media screen and (min-width: 769px) {
  .top-nav {
    background: rgba(0, 0, 0, .14);
    border-top: 1px solid rgba(255, 255, 255, .10);
    display: flex;
    justify-content: center;
    margin-top: 1.25rem;
  }
  .top-nav > ul.right { float: none; display: flex; flex-wrap: wrap; justify-content: center; margin: 0 auto; padding: .4rem 1rem; }
  .top-nav > ul > li { position: relative; }
  .top-nav > ul > li > a,
  .top-nav > ul > li > a:link,
  .top-nav > ul > li > a:visited {
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: #fff !important;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .06em;
    margin: .2rem .15rem;
    padding: .7rem 1.05rem;
  }
  .top-nav > ul > li:hover > a,
  .top-nav > ul > li > a:hover,
  .top-nav li.active-item > a {
    background: rgba(255, 255, 255, .14);
    border: 0;
    color: #fff;
  }
  /* "Witaj, ..." item in the portal */
  .top-nav > ul > li > a[style] { background: rgba(255, 255, 255, .95); color: var(--red) !important; }
  .top-nav > ul > li > a[style]:hover { background: #fff; }

  /* dropdowns */
  .top-nav ul ul {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 260px;
    padding: .4rem;
    top: calc(100% - 2px);
    left: 0;
  }
  .top-nav > ul > li:last-child ul { left: auto; right: 0; }
  .top-nav ul ul li a,
  .top-nav ul ul li a:link,
  .top-nav ul ul li a:visited {
    background: transparent !important;
    border: 0;
    border-radius: 8px;
    color: var(--ink) !important;
    font-size: .86rem;
    font-weight: 500;
    letter-spacing: 0;
    padding: .6rem .8rem;
    text-transform: none;
  }
  .top-nav ul ul li a:hover { background: var(--red-soft) !important; color: var(--red-hover) !important; }
  .top-nav ul ul .scroll { scrollbar-width: thin; }
}

/* Sticky menu (header.html adds .sticky while scrolling) */
#myMenu.sticky, #menu.sticky {
  background: rgba(122, 0, 0, .92) !important;
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
  margin-top: 0;
  opacity: 1 !important;
}

/* ---------- Scrolling news banner (pasek.php) ---------- */
marquee.marquee {
  background: transparent;
  border: 0;
  box-shadow: none;
  margin-top: 1rem;
  padding: .4rem 0;
}
marquee.marquee font { color: var(--ink) !important; }

/* ---------- Page sections ---------- */
/* Wider content cards (the page grid itself is 1140px) */
#features > .line, #contact > .line, #portal > .line,
#second-block > .line, #reklama > .line, #forth-block > .line {
  max-width: 80rem;
}
#features, #contact, #portal { background: transparent; padding: 3.5rem 1.25rem; }
#features > .line, #contact > .line, #portal > .line {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.75rem 2.5rem;
}
#features + #features, #contact + #map-block { padding-top: 0; }
#features p:not(.day):not(.month):not(.year), #contact p:not(.day):not(.month):not(.year), #portal p:not(.day):not(.month):not(.year) { font-size: .95rem; line-height: 1.75; color: var(--ink); }
#features h3, #contact h3, #portal h3 {
  color: var(--navy);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .06em;
}

h2.section-title {
  color: var(--navy);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
  margin: 0 0 2rem;
}
h2.section-title:after {
  background: var(--red);
  border-radius: 3px;
  height: 4px;
  margin: .9rem auto 0;
  width: 56px;
}

/* Feature band with picture (home page) */
#third-block, #about-us {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 auto;
  max-width: 1280px;
  overflow: hidden;
}
#third-block article, #about-us article { padding: 3rem; color: #fff; }
#third-block img, #about-us img { border-radius: var(--radius-sm); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }

/* Quote blocks (Jan Paweł II) */
#second-block { background: transparent; padding: 2rem 1.25rem; }
#second-block .margin {
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  padding: 1.5rem 1.25rem;
}
#second-block .margin:after { display: none; }
#second-block img { border-radius: 50%; width: 88px; height: 88px; object-fit: cover; display: block; margin: 0 auto; }
#second-block p { color: var(--muted) !important; line-height: 1.7; margin: .25rem 0; }
#second-block > .line > p { display: none; }

/* Sponsored blocks */
#reklama, #forth-block, #fifth-block { background: transparent; box-shadow: none; padding: 1.5rem 1.25rem; }
#reklama > .line, #forth-block > .line {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
#reklama img, #forth-block img { border-radius: var(--radius-sm); }
#reklama font, #forth-block font { color: var(--muted) !important; font-size: .78rem; }

/* "Strona zasilana przez ISE" */
#ise {
  background: linear-gradient(160deg, var(--navy) 0%, #001a26 100%);
  box-shadow: none;
  margin-top: 2rem;
  padding: 4rem 1.25rem;
}
#ise h2.section-title { color: #fff; font-size: 1.6rem; font-weight: 600; }
#ise h2.section-title:after { background: var(--red); }
#ise .margin-bottom > i {
  background: rgba(255, 255, 255, .08);
  border-radius: 12px;
  color: #fff;
  display: inline-block;
  font-size: 1.25rem;
  line-height: 44px;
  margin-bottom: .75rem;
  text-align: center;
  width: 44px;
}
#ise h3 { color: #fff; font-size: 1rem; line-height: 1.4; }
#ise, #ise p, #ise h3, #ise i, #ise strong, #ise font { color: #fff !important; }
#ise p { font-size: .88rem; line-height: 1.7; }
#ise hr { border-top-color: rgba(255, 255, 255, .25); }
/* links in this section look like the footer links: white, dark red on a white highlight on hover */
#ise a, #ise a:link, #ise a:visited { color: #fff !important; }

/* ---------- Forms ---------- */
form.customform input,
form.customform select,
form.customform textarea {
  background: #fff !important;
  border: 1px solid #d9d4cc;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, .04);
  color: var(--ink);
  font-size: .92rem;
  padding: .65rem .85rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
form.customform input, form.customform select { height: 2.85rem; }
form.customform textarea { min-height: 8rem; line-height: 1.6; }
form.customform input:hover, form.customform select:hover, form.customform textarea:hover { border-color: #bfb8ad; }
form.customform input:focus, form.customform select:focus, form.customform textarea:focus {
  border-color: var(--red);
  box-shadow: var(--focus);
  outline: none;
}
form.customform input::placeholder, form.customform textarea::placeholder { color: #9aa3ab; }
form.customform input[type="checkbox"], form.customform input[type="radio"] {
  accent-color: var(--red);
  box-shadow: none;
  height: 1.1rem;
  width: 1.1rem;
  vertical-align: middle;
}
form.customform input[type="file"] { padding: .45rem .6rem; height: auto; background: #faf9f7 !important; }
form.customform input[type="file"]::file-selector-button {
  background: var(--navy);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: .82rem;
  margin-right: .75rem;
  padding: .45rem .9rem;
}
form.customform p strong, form.customform label { color: var(--navy); font-size: .8rem; letter-spacing: .04em; }

/* Buttons */
a.color-btn, a.color-btn:link, a.color-btn:visited,
form.customform button, form.customform button.color-btn,
form.customform input[type="submit"], form.customform input[type="button"],
.button, a.button {
  background: var(--red);
  border: 1px solid var(--red);
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(163, 0, 0, .22);
  color: #fff !important;
  cursor: pointer;
  font-size: .86rem;
  font-weight: 600;
  height: auto;
  letter-spacing: .02em;
  padding: .8rem 1.5rem;
  text-align: center;
  transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
a.color-btn:hover, form.customform button:hover, form.customform button.color-btn:hover,
form.customform input[type="submit"]:hover, .button:hover, a.button:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  box-shadow: 0 6px 18px rgba(163, 0, 0, .3);
  color: #fff !important;
  transform: translateY(-1px);
}
a.color-btn:active, form.customform button:active { transform: translateY(0); }
a.white-btn { border-radius: 999px; }
form.customform button, a.color-btn { white-space: nowrap; min-width: 11rem; }

/* ---------- Tables ---------- */
#portal table, #features table, #contact table {
  background: var(--card);
  border: 1px solid var(--line);
  border-collapse: separate;
  border-radius: var(--radius-sm);
  border-spacing: 0;
  overflow: hidden;
  width: 100%;
}
#portal th, #features th, #contact th {
  background: var(--navy);
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .03em;
  padding: .7rem .8rem;
  text-align: left;
}
#portal td, #features td, #contact td { border-top: 1px solid var(--line); padding: .6rem .8rem; font-size: .9rem; }
#portal tr:nth-child(even) td, #features tr:nth-child(even) td { background: #faf9f7; }

/* Small helpers already used in the pages */
.error, font.error { color: var(--red); }
#contact i, #third-block i {
  background: var(--red-soft);
  border-radius: 10px;
  color: var(--red);
  line-height: 32px;
  width: 32px;
}
#third-block i { background: rgba(255, 255, 255, .15); color: #fff; }



/* Icon tags that also contain text (e.g. dates next to a calendar icon):
   letters fall back to the site font instead of a serif font */
[class^="icon-sli-"], [class*=" icon-sli-"] { font-family: 'sli', "Open Sans", system-ui, sans-serif; }
[class^="icon-"]:not([class^="icon-sli-"]) { font-family: 'mfg', "Open Sans", system-ui, sans-serif; }

/* Google map (home page and contact page) */
iframe[src*="google.com/maps"] {
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: block;
  margin: 0 auto 2rem;
  max-width: 1280px;
  width: calc(100% - 2.5rem);
}

/* ---------- Footer: dark navy with white text ---------- */
quicklinks {
  background: linear-gradient(160deg, #00283a 0%, #001a26 100%);
  border: 0;
  color: #fff;
  display: block;
  margin-top: 3rem;
  padding: 1.5rem 0 1rem;
}
/* the footer markup has inline grey colors (style="color:#808080"), hence !important */
quicklinks, quicklinks p, quicklinks h1, quicklinks h2, quicklinks h3, quicklinks h4, quicklinks h5, quicklinks h6,
quicklinks strong, quicklinks font, quicklinks i, quicklinks a, quicklinks a:link, quicklinks a:visited { color: #fff !important; }
quicklinks p { font-size: .8rem; }
quicklinks p, quicklinks a i { opacity: .9; }
quicklinks hr { background-color: rgba(255, 255, 255, .25) !important; color: rgba(255, 255, 255, .25) !important; }


/* ---------- Link hover colors ----------
   links are dark blue on white/light backgrounds and turn dark red on hover;
   white links on red/navy backgrounds also turn dark red (on a white highlight).
   !important is needed because many links carry inline colors (style=, <font>, <i>). */
a:not(.color-btn):not(.button):not(.white-btn):hover,
a:not(.color-btn):not(.button):not(.white-btn):hover * { color: var(--red-hover) !important; }

/* White links (on red or navy backgrounds) turn dark red on hover. Dark red text
   would be unreadable on red/navy, so the link gets a white highlight behind it. */
#topbar a:not(.color-btn):not(.button):not(.white-btn):hover, #topbar a:not(.color-btn):not(.button):not(.white-btn):hover *,
header nav a:not(.color-btn):not(.button):not(.white-btn):hover, header nav a:not(.color-btn):not(.button):not(.white-btn):hover *,
#third-block a:not(.color-btn):not(.button):not(.white-btn):hover, #third-block a:not(.color-btn):not(.button):not(.white-btn):hover *,
#about-us a:not(.color-btn):not(.button):not(.white-btn):hover, #about-us a:not(.color-btn):not(.button):not(.white-btn):hover *,
#ise a:not(.color-btn):not(.button):not(.white-btn):hover, #ise a:not(.color-btn):not(.button):not(.white-btn):hover *,
quicklinks a:not(.color-btn):not(.button):not(.white-btn):hover, quicklinks a:not(.color-btn):not(.button):not(.white-btn):hover *,
a.tab-label:not(.color-btn):not(.button):not(.white-btn):hover, a.tab-label:not(.color-btn):not(.button):not(.white-btn):hover * { color: var(--red-hover) !important; }
#topbar a:not(.color-btn):not(.button):not(.white-btn):hover,
header nav a:not(.color-btn):not(.button):not(.white-btn):hover,
#third-block a:not(.color-btn):not(.button):not(.white-btn):hover,
#about-us a:not(.color-btn):not(.button):not(.white-btn):hover,
#ise a:not(.color-btn):not(.button):not(.white-btn):hover,
quicklinks a:not(.color-btn):not(.button):not(.white-btn):hover {
  background-color: #fff !important;
  border-radius: 4px;
  box-shadow: 0 0 0 3px #fff;
}
/* menu items and tab buttons: the whole button turns white */
header nav .top-nav > ul > li:hover > a, a.tab-label:not(.color-btn):not(.button):not(.white-btn):hover { background: #fff !important; box-shadow: none; }
header nav .top-nav > ul > li:hover > a, header nav .top-nav > ul > li:hover > a * { color: var(--red-hover) !important; }

@media screen and (min-width: 769px) {
  /* dropdown menus and the "Witaj" button are white -> dark red */
  header nav .top-nav ul ul a:not(.color-btn):not(.button):not(.white-btn):hover { background-color: var(--red-soft) !important; box-shadow: none; }
  header nav .top-nav ul ul a:not(.color-btn):not(.button):not(.white-btn):hover, header nav .top-nav ul ul a:not(.color-btn):not(.button):not(.white-btn):hover *,
  header nav .top-nav > ul > li > a[style]:not(.color-btn):not(.button):not(.white-btn):hover { color: var(--red-hover) !important; }
}

/* ---------- Mobile ---------- */
@media screen and (max-width: 768px) {
  p.logo { font-size: 1.1rem; }
  .nav-text {
    background: rgba(0, 0, 0, .18);
    border-radius: 999px;
    color: #fff;
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .05em;
    line-height: 2.75;
    margin: 1rem auto;
    max-width: 260px;
    text-transform: uppercase;
  }
  .top-nav li a, .top-nav li a:link, .top-nav li a:visited { background: transparent !important; color: #fff !important; border: 0; }
  .top-nav li a:hover { background: rgba(255, 255, 255, .1) !important; }
  .top-nav li ul li a { background: rgba(0, 0, 0, .15) !important; }
  .top-nav > ul > li > a[style] { color: #fff !important; }
  #features, #contact, #portal { padding: 1.5rem .75rem; }
  #features > .line, #contact > .line, #portal > .line { padding: 1.75rem 1.25rem; border-radius: 12px; }
  h2.section-title { font-size: 1.5rem; }
  #third-block, #about-us { border-radius: 0; }
  #third-block article, #about-us article { padding: 1.75rem; }
  #second-block .margin { text-align: center; }
  #features iframe { width: 100%; height: 56vw; }
}


/* Phones: form fields one per row instead of squeezed side by side */
@media screen and (max-width: 600px) {
  form.customform .s-1, form.customform .s-2, form.customform .s-3, form.customform .s-4, form.customform .s-5, form.customform .s-6, form.customform .s-7, form.customform .s-8, form.customform .s-9, form.customform .s-10, form.customform .s-11 { width: 100% !important; float: none; }
}

/* ---------- Print ---------- */
@media print {
  #topbar, .top-nav, quicklinks, #reklama, #forth-block, #ise, #second-block { display: none !important; }
  body { background: #fff; }
  #features > .line, #contact > .line, #portal > .line { box-shadow: none; border: 0; }
}
