/* Parafia Miłosierdzia Bożego w Kornatce – style strony publicznej */

/* --- Czcionki (hostowane lokalnie, zmienna grubość) ------------------------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-serif-4-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Zmienne ---------------------------------------------------------------- */
:root {
  --navy: #1E3A5F;
  --navy-dark: #162C48;
  --red: #A3312B;
  --sky: #EAF1F7;
  --card: #F4F7FA;
  --border: #DCE5EE;
  --text: #1C2733;
  --muted: #4A5868;
  --pink: #F2C9C6;
  --white: #FFFFFF;

  /* Kolory zależne od motywu (jasny / ciemny). */
  --bg: #FFFFFF;          /* tło strony, nagłówka, przycisków obrysowanych */
  --heading: #1E3A5F;     /* nagłówki, linki, obramowania przycisków */
  --accent: #A3312B;      /* czerwony tekst i obrys fokusu */
  color-scheme: light;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --radius: 12px;
  --gap: 24px;
  --container: 1180px;
}

/* Ciemny motyw: automatycznie wg ustawień systemu albo wybrany przyciskiem
   (main.js ustawia <html data-theme="light|dark">). Granatowe tła zostają. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1722;
    --sky: #17263A;
    --card: #152131;
    --border: #2B3D53;
    --text: #E3E9F0;
    --muted: #A8B6C6;
    --heading: #B9D0EA;
    --accent: #F0928B;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1722;
  --sky: #17263A;
  --card: #152131;
  --border: #2B3D53;
  --text: #E3E9F0;
  --muted: #A8B6C6;
  --heading: #B9D0EA;
  --accent: #F0928B;
  color-scheme: dark;
}

/* --- Podstawy --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 112.5%; /* 18 px */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.2;
  color: var(--heading);
  margin: 0 0 0.5em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; font-weight: 600; }

p { margin: 0 0 1em; }

a { color: var(--heading); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

img { max-width: 100%; height: auto; display: block; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 720px) {
  .container { padding: 0 32px; }
}

.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.85rem; }

.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 100;
  background: var(--navy);
  color: var(--white);
  padding: 12px 16px;
  border-radius: 8px;
}
.skip-link:focus { top: 8px; color: var(--white); }

/* --- Przyciski -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 22px;
  border-radius: 10px;
  border: 2px solid var(--navy);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  line-height: 1.2;
  text-align: center;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-dark); border-color: var(--navy-dark); color: var(--white); }
.btn-outline { background: var(--bg); color: var(--heading); border-color: var(--heading); }
.btn-outline:hover { background: var(--sky); color: var(--heading); }

/* --- Nagłówek --------------------------------------------------------------- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 80px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--heading);
  padding: 8px 0;
  min-width: 0;
  flex: 1 1 0;
}
.brand-cross { width: 24px; height: 32px; fill: var(--red); flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; }
.brand-place { color: var(--muted); font-size: 0.9rem; letter-spacing: 0.04em; text-transform: uppercase; }

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
}
.main-nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--heading);
  border-radius: 8px;
}
.main-nav a:hover { background: var(--sky); color: var(--heading); }
.main-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--red); border-radius: 0; }

.nav-toggle,
.theme-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  border: 2px solid var(--heading);
  border-radius: 10px;
  background: var(--bg);
  color: var(--heading);
  font: 600 1rem var(--sans);
  cursor: pointer;
  flex-shrink: 0;
}

/* Przełącznik motywu – działa tylko z JS. Na komputerze stoi na końcu, za menu. */
.js .theme-toggle { display: inline-flex; justify-content: center; min-width: 48px; padding: 0 12px; }
.theme-toggle:hover { background: var(--sky); }
.theme-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-icon-sun, [data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun { display: block; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (min-width: 900px) {
  .theme-toggle { order: 1; }
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  position: relative;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }

@media (max-width: 899px) {
  .js .nav-toggle { display: inline-flex; }
  .main-nav { width: 100%; }
  .js .main-nav { display: none; }
  .js .nav-open .main-nav { display: block; }
  .main-nav ul { flex-direction: column; padding-bottom: 12px; }
  .main-nav a { border-top: 1px solid var(--border); border-radius: 0; min-height: 52px; }
  .main-nav a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--red); }
}
@media (max-width: 380px) {
  .header-inner { gap: 8px; }
  .brand { gap: 10px; }
}
@media (max-width: 420px) {
  .brand-name { font-size: 1rem; }
  .nav-toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

/* --- Pasek powitalny (strona główna) ----------------------------------------- */
.hero { background: var(--sky); border-bottom: 1px solid var(--border); }
.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
  padding-top: 20px;
  padding-bottom: 20px;
}
.hero-kicker {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 0.4em;
}
.hero h1 { font-size: 1.45rem; margin: 0; }
.hero-lead, .hero-photo { display: none; }

@media (min-width: 900px) {
  .hero-inner { grid-template-columns: 1.1fr 1fr; padding-top: 48px; padding-bottom: 48px; }
  .hero h1 { font-size: 2.3rem; margin-bottom: 0.4em; }
  .hero-lead { display: block; font-size: 1.1rem; color: var(--muted); max-width: 34em; margin: 0; }
  .hero-photo {
    display: block;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg);
  }
  .hero-photo img { width: 100%; height: 100%; object-fit: cover; }
  .hero-photo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border);
    color: var(--muted);
  }
}

/* Baner ze zdjęciem kościoła. Telefon: zdjęcie jako pasek, tekst pod nim.
   Komputer: zdjęcie na całą szerokość, tekst na niebie po lewej stronie. */
.hero-photo-bg { position: relative; background: var(--sky); }
.hero-img {
  display: block;
  width: 100%;
  height: 230px;
  object-fit: cover;
  object-position: 78% 6%; /* dzwonnica z krzyżem */
}
.photo-credit {
  position: absolute;
  top: 200px;
  right: 8px;
  margin: 0;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(28, 39, 51, 0.55);
  color: var(--white);
  font-size: 0.7rem;
}

@media (min-width: 900px) {
  .hero-photo-bg {
    min-height: 500px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-bottom: 0;
  }
  .hero-img {
    position: absolute;
    inset: 0;
    height: 100%;
    object-position: 60% 2%;
  }
  /* Rozjaśnienie nieba pod tekstem – czytelność granatowych liter. */
  .hero-photo-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0.6) 38%, rgba(255, 255, 255, 0) 62%);
  }
  .hero-photo-bg .hero-inner { position: relative; grid-template-columns: minmax(0, 560px); }
  /* Tekst na jasnym niebie zdjęcia – zawsze w kolorach jasnego motywu. */
  .hero-photo-bg .hero-text { --heading: #1E3A5F; --text: #1C2733; --accent: #A3312B; }
  .hero-photo-bg h1 { font-size: 2.6rem; }
  .hero-photo-bg .hero-lead { color: var(--text); }
  .photo-credit { top: auto; bottom: 10px; right: 12px; }
}
@media (min-width: 1500px) {
  .hero-photo-bg { min-height: 600px; }
}

/* --- Siatka strony głównej ---------------------------------------------------- */
.home-grid {
  display: grid;
  gap: var(--gap);
  padding-top: 24px;
  padding-bottom: 48px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "skroty"
    "msze"
    "ogloszenia"
    "zmarli"
    "kancelaria";
}
.shortcuts { grid-area: skroty; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.shortcuts .btn { min-height: 56px; }
.home-announcements { grid-area: ogloszenia; }
.home-masses { grid-area: msze; }
.home-dead { grid-area: zmarli; }
.home-office { grid-area: kancelaria; }
.home-grid .card { margin-bottom: 0; }

@media (min-width: 900px) {
  .home-grid {
    padding-top: 40px;
    grid-template-columns: minmax(0, 1fr) 380px;
    grid-template-rows: auto auto 1fr;
    column-gap: 40px;
    grid-template-areas:
      "ogloszenia msze"
      "ogloszenia zmarli"
      "ogloszenia kancelaria";
  }
  .shortcuts { display: none; }
  .home-masses, .home-dead, .home-office { align-self: start; }
}

.section-title {
  font-size: 1.6rem;
  padding-bottom: 0.35em;
  border-bottom: 3px solid var(--sky);
}

/* --- Karty -------------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: var(--gap);
}
.card > :last-child { margin-bottom: 0; }
.card-title { font-size: 1.35rem; }
.card-label {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.1em 0 0.4em;
}
.card-label-inline { font-weight: 600; }

.card-navy {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}
.card-navy .card-title { color: var(--white); }
.card-navy .card-label { color: var(--pink); }
.card-navy a { color: var(--white); }

.card-blue { background: var(--sky); }

.link-more { font-weight: 600; }
.link-more::after { content: " »"; }

/* Msze Święte */
.mass-times {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
}
.mass-times li { display: flex; flex-direction: column; }
.mass-time { font-family: var(--serif); font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.mass-place { font-size: 0.85rem; color: var(--pink); font-weight: 600; }
.mass-weekdays { margin: 0; }
.mass-weekdays div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.mass-weekdays div:first-child { border-top: 0; }
.mass-weekdays dd { margin: 0; font-weight: 700; font-size: 1.15rem; white-space: nowrap; }

.mass-times-big { flex-direction: column; gap: 14px; }
.mass-times-big li { flex-direction: row; align-items: baseline; gap: 16px; }
.mass-times-big .mass-time { min-width: 3.2em; font-size: 2.2rem; }
.mass-times-big .mass-place { font-size: 1.05rem; }
.mass-weekdays-big div { border-top-color: var(--border); padding: 12px 0; }
.mass-weekdays-big dd { font-family: var(--serif); font-size: 1.6rem; color: var(--heading); }

/* Msze za zmarłych */
.dead-list, .dead-terms { list-style: none; margin: 0; padding: 0; }
.dead-list > li { padding: 12px 0; border-top: 1px solid var(--border); }
.dead-list > li:first-child { border-top: 0; padding-top: 0; }
.dead-list > li:last-child { padding-bottom: 0; }
.dead-name { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; color: var(--heading); margin: 0 0 0.2em; }
.dead-terms li { padding-left: 18px; position: relative; }
.dead-terms li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.65em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
}

/* --- Ogłoszenia ----------------------------------------------------------------- */
.ann-date { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5em; }
.ann-date a { text-decoration: none; }
.ann-desc { font-size: 1.05rem; }
.ann-image {
  margin: 0 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}
.ann-image a { display: block; cursor: zoom-in; }
.ann-image img { width: 100%; }

.ann-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}
@media (min-width: 720px) {
  .ann-list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
}
.ann-item {
  display: flex;
  gap: 16px;
  align-items: center;
  height: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  text-decoration: none;
  color: var(--text);
}
.ann-item:hover { border-color: var(--heading); color: var(--text); }
.ann-item img {
  width: 88px;
  height: 110px;
  object-fit: cover;
  object-position: top;
  border-radius: 6px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.ann-item-text { display: flex; flex-direction: column; gap: 4px; }
.ann-item-date { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; color: var(--heading); }
.ann-item-desc { color: var(--muted); font-size: 0.9rem; }
@media (min-width: 720px) {
  .ann-item { flex-direction: column; align-items: stretch; }
  .ann-item img { width: 100%; height: 220px; }
}
.badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--red);
  color: var(--white);
  font: 600 0.7rem var(--sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pager { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.pager-next { margin-left: auto; }

/* --- Podstrony ----------------------------------------------------------------- */
.page { padding-top: 32px; padding-bottom: 56px; }
.page-narrow { max-width: 860px; }
.page-title { font-size: 2rem; }
.page-subtitle { display: block; font-size: 1.2rem; color: var(--muted); font-weight: 600; margin-top: 0.3em; }
.breadcrumb { margin-bottom: 12px; }
.breadcrumb a { font-weight: 600; text-decoration: none; }
.two-col { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .two-col { grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
}
.contact-list { margin: 0; }
.contact-list div { padding: 10px 0; border-top: 1px solid var(--border); }
.contact-list div:first-child { border-top: 0; padding-top: 0; }
.contact-list dt { font-weight: 600; color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.contact-list dd { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.prose h2 { margin-top: 1.4em; font-size: 1.35rem; }
.notice { background: var(--sky); border-left: 4px solid var(--red); padding: 12px 16px; border-radius: 6px; }

/* --- Stopka ---------------------------------------------------------------------- */
.site-footer {
  background: var(--navy);
  color: var(--white);
  border-top: 6px solid var(--red);
  font-size: 0.95rem;
}
.site-footer a { color: var(--white); }
.site-footer a:hover { color: var(--pink); }
.footer-inner {
  display: grid;
  gap: 24px;
  padding-top: 40px;
  padding-bottom: 24px;
}
@media (min-width: 720px) {
  .footer-inner { grid-template-columns: 1.2fr 1fr 1fr; }
}
.footer-name { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; }
.footer-label {
  color: var(--pink);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
}
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 16px;
  padding-bottom: 24px;
  color: #C9D4E1;
  font-size: 0.85rem;
}
.footer-bottom p { margin: 0; }

/* --- Powiększenie obrazka ------------------------------------------------------------ */
.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(10, 18, 30, 0.94);
  overflow: auto;
}
.lightbox::backdrop { background: rgba(10, 18, 30, 0.94); }
.lightbox img {
  max-width: none;
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: 72px 8px 24px;
}
.lightbox-close {
  position: fixed;
  top: 12px;
  right: 12px;
  min-height: 48px;
  padding: 0 18px;
  border: 2px solid var(--white);
  border-radius: 10px;
  background: var(--navy);
  color: var(--white);
  font: 600 1rem var(--sans);
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media print {
  .site-header, .site-footer, .shortcuts, .pager, .hint { display: none; }
}
