/*
Theme Name: Namazowszu Magazyn
Theme URI: https://namazowszu.pl/
Author: Namazowszu.pl
Description: Lekki, responsywny motyw magazynowy dla portalu regionalnego namazowszu.pl.
Version: 1.4.2
Text Domain: namazowszu-magazyn
*/

:root {
  --nm-ink: #172a3a;
  --nm-ink-soft: #4d5b64;
  --nm-green: #2f6846;
  --nm-green-dark: #1f4c32;
  --nm-red: #b33a32;
  --nm-cream: #faf8f3;
  --nm-paper: #ffffff;
  --nm-line: #e5e1d8;
  --nm-shadow: 0 18px 50px rgba(23, 42, 58, .10);
  --nm-radius: 18px;
  --nm-wide: 1240px;
  --nm-reading: 760px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--nm-ink);
  background: var(--nm-cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--nm-green-dark); text-decoration-thickness: .08em; text-underline-offset: .16em; }
a:hover { color: var(--nm-red); }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.nm-wrap { width: min(calc(100% - 40px), var(--nm-wide)); margin-inline: auto; }
.nm-kicker { margin: 0 0 10px; color: var(--nm-red); font-size: .76rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.nm-section { padding: 68px 0; }
.nm-section--paper { background: var(--nm-paper); }
.nm-section--green { color: #fff; background: var(--nm-green-dark); }
.nm-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.nm-section-heading h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.02; letter-spacing: -.035em; }
.nm-section-link { flex: 0 0 auto; font-size: .9rem; font-weight: 750; text-decoration: none; }

/* Header */
.nm-topline { color: #fff; background: var(--nm-green-dark); font-size: .78rem; letter-spacing: .045em; }
.nm-topline .nm-wrap { display: flex; justify-content: space-between; gap: 20px; padding-block: 8px; }
.nm-site-header { position: relative; z-index: 20; background: rgba(250,248,243,.96); border-bottom: 1px solid var(--nm-line); }
.nm-header-main { display: grid; grid-template-columns: auto 1fr auto; align-items: center; min-height: 92px; gap: 34px; }
.nm-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--nm-ink); text-decoration: none; }
.nm-brand-mark { display: grid; place-items: center; width: 44px; height: 44px; color: #fff; background: var(--nm-red); border-radius: 50% 50% 50% 12%; font-family: Georgia, serif; font-size: 1.35rem; font-weight: 700; }
.nm-brand-name { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.45rem, 2.2vw, 2rem); font-weight: 700; letter-spacing: -.035em; }
.nm-nav .menu { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; list-style: none; }
.nm-nav .menu > li { position: relative; }
.nm-nav a { color: var(--nm-ink); font-size: .88rem; font-weight: 750; text-decoration: none; }
.nm-nav a:hover { color: var(--nm-red); }
.nm-nav .menu > .menu-item-has-children > a::after { content: "\25BE"; display: inline-block; margin-left: 6px; color: var(--nm-green); font-size: .72em; }
.nm-nav .sub-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 10px);
  left: -14px;
  display: block;
  min-width: 230px;
  margin: 0;
  padding: 10px;
  list-style: none;
  background: var(--nm-paper);
  border: 1px solid var(--nm-line);
  border-radius: 12px;
  box-shadow: var(--nm-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.nm-nav .sub-menu::before { content: ""; position: absolute; inset: -11px 0 auto; height: 12px; }
.nm-nav .sub-menu li { width: 100%; }
.nm-nav .sub-menu a { display: block; padding: 9px 11px; border-radius: 8px; white-space: nowrap; }
.nm-nav .sub-menu a:hover, .nm-nav .sub-menu a:focus { color: var(--nm-red); background: var(--nm-cream); }
.nm-nav .menu > li:hover > .sub-menu,
.nm-nav .menu > li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.nm-search-toggle, .nm-menu-toggle { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; color: var(--nm-ink); background: transparent; border: 1px solid var(--nm-line); border-radius: 50%; cursor: pointer; }
.nm-menu-toggle { display: none; }
.nm-search-panel { display: none; position: absolute; inset: 100% 0 auto; padding: 20px; background: var(--nm-paper); box-shadow: 0 20px 30px rgba(23,42,58,.12); }
.nm-search-panel.is-open { display: block; }
.search-form { display: flex; width: min(100%, 720px); margin: 0 auto; }
.search-field { min-width: 0; flex: 1; padding: 14px 18px; border: 1px solid var(--nm-line); border-radius: 999px 0 0 999px; }
.search-submit { padding: 14px 22px; color: #fff; background: var(--nm-green); border: 0; border-radius: 0 999px 999px 0; font-weight: 750; cursor: pointer; }

/* Home hero */
.nm-home-hero { padding: 44px 0 70px; }
.nm-home-hero-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(320px,.75fr); gap: 22px; }
.nm-lead, .nm-mini-card, .nm-card { position: relative; overflow: hidden; background: var(--nm-paper); border-radius: var(--nm-radius); box-shadow: var(--nm-shadow); }
.nm-lead { min-height: 600px; }
.nm-lead > a, .nm-mini-card > a { position: absolute; inset: 0; color: #fff; text-decoration: none; }
.nm-lead img, .nm-mini-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.nm-lead:hover img, .nm-mini-card:hover img { transform: scale(1.025); }
.nm-image-fallback { width: 100%; height: 100%; background: linear-gradient(135deg, var(--nm-green), var(--nm-ink)); }
.nm-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 25%, rgba(10,20,27,.9) 100%); }
.nm-lead-content { position: absolute; inset: auto 0 0; padding: clamp(28px,5vw,58px); color: #fff; }
.nm-lead-content h1 { max-width: 850px; margin: 0 0 14px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.05rem, 4.25vw, 4.1rem); line-height: 1; letter-spacing: -.04em; text-wrap: balance; }
.nm-lead-meta { font-size: .86rem; opacity: .82; }
.nm-side-stories { display: grid; grid-template-rows: repeat(2, minmax(0,1fr)); gap: 22px; }
.nm-mini-card { min-height: 285px; }
.nm-mini-content { position: absolute; inset: auto 0 0; padding: 26px; }
.nm-mini-content h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.35rem,2.1vw,1.85rem); line-height: 1.08; letter-spacing: -.025em; }

/* Discovery */
.nm-discovery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.nm-discovery-card { min-height: 220px; display: flex; flex-direction: column; justify-content: space-between; padding: 28px; color: #fff; text-decoration: none; border-radius: var(--nm-radius); background: var(--nm-green); transition: transform .2s ease, box-shadow .2s ease; }
.nm-discovery-card:nth-child(2) { background: #76563c; }
.nm-discovery-card:nth-child(3) { background: #315d70; }
.nm-discovery-card:nth-child(4) { background: #7c473f; }
.nm-discovery-card:hover { color: #fff; transform: translateY(-4px); box-shadow: var(--nm-shadow); }
.nm-discovery-number { font-family: Georgia, serif; font-size: 3.3rem; opacity: .35; line-height: 1; }
.nm-discovery-card h3 { margin: 28px 0 0; font-family: Georgia, serif; font-size: 1.65rem; line-height: 1.05; }

/* Cards */
.nm-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 28px; }
.nm-card { box-shadow: none; border: 1px solid var(--nm-line); transition: transform .2s ease, box-shadow .2s ease; }
.nm-card:hover { transform: translateY(-4px); box-shadow: var(--nm-shadow); }
.nm-card-image { aspect-ratio: 16 / 10; overflow: hidden; background: #dce3df; }
.nm-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.nm-card:hover .nm-card-image img { transform: scale(1.035); }
.nm-card-body { padding: 24px; }
.nm-card h3 { margin: 0 0 12px; font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; line-height: 1.13; letter-spacing: -.02em; }
.nm-card h3 a { color: var(--nm-ink); text-decoration: none; }
.nm-card h3 a:hover { color: var(--nm-red); }
.nm-card-excerpt { margin: 0; color: var(--nm-ink-soft); font-size: .93rem; }
.nm-card-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 12px; color: var(--nm-green); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.nm-visual-card { position: relative; min-height: 310px; overflow: hidden; border-radius: var(--nm-radius); box-shadow: var(--nm-shadow); }
.nm-visual-card > a { position: absolute; inset: 0; color: #fff; text-decoration: none; }
.nm-visual-card img, .nm-visual-card .nm-image-fallback { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.nm-visual-card:hover img { transform: scale(1.035); }
.nm-visual-card-content { position: absolute; inset: auto 0 0; padding: 24px; }
.nm-visual-card-content h3 { margin: 0; color: #fff; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.35rem, 2vw, 1.75rem); line-height: 1.08; letter-spacing: -.025em; text-wrap: balance; }
.nm-section--green .nm-section-link { color: #fff; }
.nm-section--green .nm-card { color: var(--nm-ink); background: var(--nm-paper); border: 0; }

/* Articles */
.nm-page-header { padding: 70px 0 42px; border-bottom: 1px solid var(--nm-line); }
.nm-page-header h1 { max-width: 920px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.6rem,6vw,5rem); line-height: .98; letter-spacing: -.05em; }
.nm-article-header { padding: 68px 0 38px; }
.nm-article-header-inner { max-width: 980px; }
.nm-article-title { margin: 0 0 22px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.65rem,6vw,5.5rem); line-height: .97; letter-spacing: -.052em; }
.nm-article-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; color: var(--nm-ink-soft); font-size: .86rem; }
.nm-article-hero { width: min(calc(100% - 40px), 1120px); margin: 0 auto 50px; overflow: hidden; border-radius: var(--nm-radius); background: #e6e3dc; }
.nm-article-hero img { width: 100%; max-height: 720px; object-fit: cover; }
.nm-article-body { width: min(calc(100% - 40px), var(--nm-reading)); margin: 0 auto; padding-bottom: 70px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.08rem,2vw,1.22rem); line-height: 1.82; }
.nm-article-body > :first-child { margin-top: 0; }
.nm-article-body h2, .nm-article-body h3, .nm-article-body h4 { color: var(--nm-ink); font-family: Inter, ui-sans-serif, system-ui, sans-serif; line-height: 1.15; }
.nm-article-body h2 { margin-top: 2.3em; font-size: 2rem; }
.nm-article-body h3 { margin-top: 2em; font-size: 1.55rem; }
.nm-article-body figure, .nm-article-body img { max-width: min(100%, 980px); }
.nm-article-body img { border-radius: 12px; }
.nm-article-body blockquote { margin: 2em 0; padding: 1px 0 1px 24px; color: var(--nm-green-dark); border-left: 4px solid var(--nm-green); font-size: 1.25em; }
.nm-article-body a { overflow-wrap: anywhere; }
.nm-tags { display: flex; flex-wrap: wrap; gap: 8px; width: min(calc(100% - 40px), var(--nm-reading)); margin: 0 auto 70px; }
.nm-tags a { padding: 7px 12px; color: var(--nm-green-dark); background: #e9f0eb; border-radius: 999px; font-size: .8rem; font-weight: 700; text-decoration: none; }
.nm-related { border-top: 1px solid var(--nm-line); }

/* Archives and footer */
.nm-content-list { min-height: 50vh; }
.nav-links { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.nav-links a, .nav-links span { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border: 1px solid var(--nm-line); border-radius: 999px; text-decoration: none; }
.nav-links .current { color: #fff; background: var(--nm-green); border-color: var(--nm-green); }
.nm-empty { padding: 100px 0; text-align: center; }
.nm-site-footer { color: #fff; background: #10232f; }
.nm-footer-grid { display: grid; grid-template-columns: 1.2fr repeat(3,1fr); gap: 46px; padding: 64px 0; }
.nm-site-footer h2, .nm-site-footer h3 { margin-top: 0; font-family: Georgia, serif; }
.nm-site-footer a { color: rgba(255,255,255,.82); }
.nm-site-footer ul { margin: 0; padding: 0; list-style: none; }
.nm-site-footer li { margin-bottom: 8px; }
.nm-footer-bottom { padding: 18px 0; border-top: 1px solid rgba(255,255,255,.13); color: rgba(255,255,255,.65); font-size: .78rem; }

@media (max-width: 980px) {
  .nm-header-main { grid-template-columns: 1fr auto auto; min-height: 78px; gap: 10px; }
  .nm-menu-toggle { display: grid; }
  .nm-nav { display: none; position: absolute; inset: 100% 0 auto; padding: 24px 20px; background: var(--nm-paper); border-bottom: 1px solid var(--nm-line); box-shadow: var(--nm-shadow); }
  .nm-nav.is-open { display: block; }
  .nm-nav .menu { align-items: stretch; flex-direction: column; gap: 0; }
  .nm-nav .menu > li { width: 100%; }
  .nm-nav a { display: block; padding: 11px 4px; border-bottom: 1px solid var(--nm-line); }
  .nm-nav .sub-menu { position: static; display: block; min-width: 0; padding: 0 0 4px 18px; background: transparent; border: 0; border-radius: 0; box-shadow: none; opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
  .nm-nav .sub-menu::before { display: none; }
  .nm-nav .sub-menu a { padding: 9px 4px; white-space: normal; }
  .nm-home-hero-grid { grid-template-columns: 1fr; }
  .nm-lead { min-height: 530px; }
  .nm-side-stories { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .nm-discovery-grid, .nm-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .nm-footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .nm-wrap { width: min(calc(100% - 28px), var(--nm-wide)); }
  .nm-topline .nm-wrap span:last-child { display: none; }
  .nm-brand-mark { width: 38px; height: 38px; }
  .nm-brand-name { font-size: 1.4rem; }
  .nm-home-hero { padding-top: 18px; }
  .nm-lead { min-height: 490px; }
  .nm-lead-content { padding: 26px; }
  .nm-side-stories { grid-template-columns: 1fr; }
  .nm-mini-card { min-height: 255px; }
  .nm-section { padding: 50px 0; }
  .nm-section-heading { align-items: start; flex-direction: column; gap: 8px; }
  .nm-discovery-grid, .nm-grid, .nm-footer-grid { grid-template-columns: 1fr; }
  .nm-discovery-card { min-height: 175px; }
  .nm-page-header, .nm-article-header { padding-top: 46px; }
  .nm-article-hero { width: 100%; border-radius: 0; }
  .nm-article-body { width: min(calc(100% - 32px), var(--nm-reading)); }
}
