/* Accepted phone layout. No overrides apply above 760px. */
@media (max-width:760px){
  /* Home-page sacraments retain one full clickable link per row. */
  .P #sakramenty .sac-grid{grid-template-columns:1fr;gap:6px}
  .P #sakramenty .sacrament-item{display:grid;grid-template-columns:72px minmax(0,1fr);grid-template-rows:1fr auto auto 1fr;column-gap:16px;align-items:center;min-height:76px;text-align:left;border-radius:14px;overflow:hidden}
  .P #sakramenty .sacrament-item:hover{transform:none;box-shadow:none}
  .P #sakramenty .sacrament-icon{grid-row:1/-1;align-self:stretch;height:auto;min-height:76px}
  .P #sakramenty .sacrament-icon svg{height:50px;max-width:56px}
  /* This SVG inherits its outline styles on the sacraments page. Its drawing is 240 units
     tall instead of 190, so it gets the same scale (and line weight) as the other icons. */
  .P #sakramenty .sacrament-item[href="/sakramenty/#chorzy"] .sacrament-icon svg{height:calc(50px * 240 / 190);fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round}
  .P #sakramenty .sacrament-name{grid-row:2;min-width:0;padding:0 12px 0 0;font-size:20px;overflow-wrap:anywhere}
  .P #sakramenty .sacrament-action{grid-row:3;min-width:0;padding:3px 12px 0 0;overflow-wrap:anywhere}

  /* Only the home-page announcement actions use this compact arrangement. */
  .P #ogloszenia .acts{flex-direction:row;flex-wrap:wrap;align-items:center;gap:12px 10px;margin-top:22px}
  .P #ogloszenia .acts .btn{padding:0 18px}
  .P #ogloszenia .announcement-permalink{flex-basis:100%}

  /* Shared footer, including History's later stylesheet. */
  .P footer .foot{grid-template-columns:max-content minmax(0,1fr);gap:20px 28px}
  .P footer .foot > *{min-width:0}
  .P footer .foot > div,.P footer .foot .fl{grid-column:1/-1}
  .P footer .foot .fl{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px 20px}
  .P footer .foot a{overflow-wrap:anywhere}
  /* The second column of links starts exactly under the phone number. */
  @supports (grid-template-columns:subgrid){
    .P footer .foot .fl{grid-template-columns:subgrid;column-gap:normal}
  }
}

@media (max-width:360px){
  /* Keep both actions together at 320px without reducing their text size. */
  .P #ogloszenia .acts{display:grid;grid-template-columns:max-content minmax(0,1fr);column-gap:8px}
  .P #ogloszenia .acts .btn{min-width:0;padding:6px 10px}
  .P #ogloszenia .announcement-permalink{grid-column:1/-1}
  .P footer .foot{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);column-gap:16px}
}

/* The added phone shortcut leaves the established desktop grid unchanged. */
@media (min-width:761px){
  .P #sakramenty .sacrament-item-mobile{display:none}
}
