/* Główna: aktualności ze zdjęciami jak na stronie Aktualności i sakramenty w jednym rzędzie na komputerze.
   Wzorzec: proby/do-akceptacji-2026-11-06/2-GLOWNA.html. Tylko strona główna ładuje ten plik. */
.P .news.hn{--hn-r:14px;--hn-gold:#8C6A14}
.P .hn .hd{align-items:center}
.P .hn-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:clamp(18px,2.4vw,30px)}
.P .hn-side{display:grid;grid-template-rows:1fr 1fr auto;gap:clamp(18px,2.4vw,30px)}
.P .hn-side:not(:has(.hn-card+.hn-card)){grid-template-rows:auto}
/* The former text-only cards style every article in .news; none of that applies here. */
.P .news.hn .hn-grid article,.P .news.hn .hn-grid article:nth-child(n){padding:0;border:0;min-width:0}
.P .news.hn p{max-width:none}

/* The newest entry: photo with the date, title and a short summary on it. The text is in normal flow at the
   bottom and the size below is a minimum: a long title (CMS allows 160 characters) makes the tile taller. */
.P .hn-feature{position:relative;display:flex;flex-direction:column;justify-content:flex-end;min-height:440px;border-radius:var(--hn-r);overflow:hidden;overflow:clip;background:#2D3937;box-shadow:0 18px 40px -22px rgba(31,38,33,.45);isolation:isolate}
.P .hn-feature img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 38%;transition:transform .9s cubic-bezier(.3,.8,.3,1)}
.P .hn-feature:hover img{transform:scale(1.05)}
.P .hn-txt{position:relative;z-index:2;margin-top:auto;padding:clamp(22px,3vw,36px);color:#fff}
/* The shade follows the text, starting 120 px above it: a short entry looks as before, and a long title gets
   at least the same darkness under every line. */
.P .hn-txt::before{content:"";position:absolute;z-index:-1;left:0;right:0;bottom:0;top:-120px;background:linear-gradient(180deg,rgba(20,26,24,0) 0,rgba(20,26,24,.3) 120px,rgba(20,26,24,.6) 235px,rgba(20,26,24,.88) 100%);pointer-events:none}
.P .hn-new{display:inline-flex;align-items:center;margin:0 0 12px;padding:5px 11px;border-radius:99px;background:#DDBC6C;color:#231d0c;font-weight:800;font-size:12px;letter-spacing:.06em;text-transform:uppercase}
.P .hn-feature .hn-meta{margin:0 0 6px;font-weight:700;font-size:15px;color:#F4F0E2}
.P .news.hn .hn-feature h3{--heading-min-size:24px;margin:0;font-size:clamp(30px,3.2vw,46px);line-height:1.02;letter-spacing:-.035em;text-wrap:balance;overflow-wrap:normal}
.P .hn-feature .ex p{margin-top:10px;color:#E9E5DA;font-size:18px;line-height:1.45;max-width:34em}
.P .hn-no-photo .hn-txt::before{display:none}
/* The drawing sits top right in normal flow. Its negative bottom margin (text padding + label + date) lets only
   the left-aligned label and date rise beside it; a long title starts below it instead of running across it. */
.P .hn-no-photo .hn-sign{flex:none;align-self:flex-end;width:min(38%,200px);margin:28px 28px calc(-64px - clamp(22px,3vw,36px))}
.P .hn-no-photo .hn-sign svg{width:100%;height:auto;fill:none;stroke:#DDBC6C;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round;opacity:.85}
.P .hn-no-photo .hn-sign .bf{fill:rgba(221,188,108,.14)}

/* Two smaller entries beside it, then the link to all entries. */
.P .hn-card{position:relative;display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1fr);border-radius:var(--hn-r);overflow:hidden;background:#fff;box-shadow:0 0 0 1.5px var(--li);transition:transform .35s cubic-bezier(.3,.8,.3,1),box-shadow .35s}
.P .hn-card:hover{transform:translateY(-4px);box-shadow:0 0 0 1.5px #D2BC7A,0 18px 40px -22px rgba(31,38,33,.45)}
.P .hn-ph{position:relative;overflow:hidden;min-height:200px;background:var(--so)}
.P .hn-ph img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transition:transform .7s cubic-bezier(.3,.8,.3,1)}
.P .hn-card:hover .hn-ph img{transform:scale(1.06)}
.P .hn-ph-sign{display:grid;place-items:center;background:#F7F4EC}
.P .hn-ph-sign .hn-sign{display:block;width:clamp(64px,46%,120px)}
.P .hn-sign svg{display:block;width:100%;height:auto;fill:none;stroke:#8A6433;stroke-width:2.8;stroke-linecap:round;stroke-linejoin:round}
.P .hn-sign .bf{fill:#EEE3CF}
.P .hn-sign .ray{stroke-width:2.2}
.P .hn-day{position:absolute;top:12px;left:12px;display:grid;justify-items:center;min-width:54px;padding:6px 5px 5px;border-radius:10px;background:#fff;color:#1F2621;box-shadow:0 6px 16px -8px rgba(0,0,0,.5);line-height:1}
.P .hn-day b{font:800 22px Archivo,"Helvetica Neue",Arial,sans-serif;letter-spacing:-.03em}
.P .hn-day span{margin-top:3px;font-weight:700;font-size:11px;letter-spacing:.08em;color:var(--hn-gold)}
.P .hn-body{display:flex;flex-direction:column;justify-content:center;padding:20px 22px;overflow-wrap:anywhere}
.P .news.hn .hn-card h3{--heading-min-size:18px;margin:0;font-size:clamp(22px,1.9vw,27px);line-height:1.1;letter-spacing:-.025em;text-wrap:balance;overflow-wrap:normal}
.P .hn-card .ex p{margin-top:8px;font-size:16px;line-height:1.45;color:#3D443F;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.P .hn-card h3 a,.P .hn-feature h3 a{color:inherit;text-decoration:none}
.P .hn-card h3 a::after,.P .hn-feature h3 a::after{content:"";position:absolute;inset:0;z-index:3}
.P .hn-card h3 a:focus-visible,.P .hn-feature h3 a:focus-visible{outline:none}
.P .hn-card:has(h3 a:focus-visible),.P .hn-feature:has(h3 a:focus-visible){outline:3px solid var(--hn-gold);outline-offset:3px}
.P .hn-all{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:64px;padding:0 22px;border-radius:var(--hn-r);background:var(--so);box-shadow:0 0 0 1.5px var(--li);color:var(--fg);font-weight:800;font-size:18px;text-decoration:none;transition:background .25s,box-shadow .25s}
.P .hn-all .nx-arrow{flex:none;width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;transition:transform .3s}
.P .hn-all:hover{background:#EFE6CF;box-shadow:0 0 0 1.5px #D2BC7A}
.P .hn-all:hover .nx-arrow{transform:translateX(5px)}
.P .hn-all:focus-visible{outline:3px solid var(--hn-gold);outline-offset:3px}
.P .hn-js .hn-reveal{opacity:0;transform:translateY(24px);transition:opacity .7s ease var(--d,0s),transform .7s cubic-bezier(.2,.7,.2,1) var(--d,0s),box-shadow .35s}
.P .hn-js .hn-reveal.is-in{opacity:1;transform:none}
.P .hn-js .hn-card.is-in:hover{transform:translateY(-4px)}

/* Sacraments: one row of seven on a computer, with Anointing of the Sick; the phone list stays as it is. */
@media(min-width:761px){
  .P #sakramenty .sac-grid{grid-template-columns:repeat(7,minmax(0,1fr));gap:12px}
  .P #sakramenty .sacrament-item-mobile{display:block}
  .P #sakramenty .sacrament-item{border-radius:14px;overflow:hidden;box-shadow:0 0 0 1.5px #E4D9C2}
  .P #sakramenty .sacrament-icon{height:118px}
  .P #sakramenty .sacrament-icon svg{height:66%}
  .P #sakramenty .sacrament-item[href="/sakramenty/#chorzy"] .sacrament-icon svg{height:calc(66% * 240 / 190);fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round}
  .P #sakramenty .sacrament-name{font-size:clamp(16px,1.25vw,19px);padding:14px 10px 0;min-height:3.4em;display:flex;align-items:center;justify-content:center;text-wrap:balance}
  .P #sakramenty .sacrament-action{font-size:14px;padding:4px 10px 16px}
}
@media(min-width:761px) and (max-width:1120px){
  .P #sakramenty .sac-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
}

/* Płynne przejście zdjęcia do wpisu (Chrome, Edge, Safari 18.2+); gdzie indziej zwykłe przejście strony.
   Zgoda na przejście (@view-transition) jest w <head> strony: scripts/news.mjs, NEWS_TRANSITION_OPT_IN. */
::view-transition-group(nx-photo){animation-duration:.5s;animation-timing-function:cubic-bezier(.3,.8,.3,1)}
::view-transition-old(nx-photo),::view-transition-new(nx-photo){height:100%;object-fit:cover;overflow:clip}
::view-transition-old(root),::view-transition-new(root){animation-duration:.3s}

@media(max-width:980px){
  .P .hn-grid{grid-template-columns:minmax(0,1fr)}
  .P .hn-side{grid-template-rows:none}
  /* 4:3 as before. With min-height:auto and overflow:clip a longer text grows the tile; no fixed minimum here,
     because a fixed one with aspect-ratio would widen the tile sideways. */
  .P .hn-feature{min-height:auto;aspect-ratio:4/3}
  .P .hn-no-photo .hn-sign{width:min(26%,140px)}
}
@media(max-width:760px){
  .P .hn .hd{margin-bottom:24px}
  .P .hn-feature .ex,.P .hn-card .ex{display:none}
  .P .news.hn .hn-feature h3{font-size:30px}
  .P .hn-card{grid-template-columns:112px minmax(0,1fr)}
  .P .hn-ph{min-height:112px}
  .P .hn-day{top:8px;left:8px;min-width:44px;padding:5px 4px 4px}
  .P .hn-day b{font-size:18px}
  .P .hn-day span{font-size:10px}
  .P .hn-body{padding:14px 16px}
  .P .news.hn .hn-card h3{font-size:21px}
  .P .hn-no-photo .hn-sign{width:76px;margin:18px 18px calc(-64px - clamp(22px,3vw,36px))}
  .P .hn-txt::before{top:-40px;background:linear-gradient(180deg,rgba(20,26,24,0) 0,rgba(20,26,24,.15) 40px,rgba(20,26,24,.35) 110px,rgba(20,26,24,.6) 190px,rgba(20,26,24,.88) 100%)}
}
@media(prefers-reduced-motion:reduce){
  .P .hn-js .hn-reveal{opacity:1;transform:none;transition:none}
  .P .hn-feature img,.P .hn-ph img,.P .hn-card,.P .hn-all,.P .hn-all .nx-arrow{transition:none}
  .P .hn-card:hover,.P .hn-js .hn-card.is-in:hover{transform:none}
  .P .hn-feature:hover img,.P .hn-card:hover .hn-ph img{transform:none}
}

/* Without JS a title keeps its size and an oversized word wraps inside the tile. */
@media (scripting:none){.P .news.hn .hn-feature h3,.P .news.hn .hn-card h3{overflow-wrap:anywhere}}
