/* Pia Casa gallery: warm stone, terracotta, serif headings */
:root { --bg: #f6f1e9; --card: #fffdf9; --ink: #2b2620; --muted: #7a6f62; --line: #e4dccf; --accent: #a8532b; --dark: #1c1915; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
h1, h2 { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-weight: 600; letter-spacing: .01em; }
a { color: inherit; }
.muted { color: var(--muted); }

/* Home */
.hero { position: relative; min-height: 72vh; display: flex; align-items: flex-end; color: #fff; background: var(--dark); overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 62%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,16,12,.82) 0%, rgba(20,16,12,.45) 28%, rgba(20,16,12,0) 50%); }
.hero-txt { position: relative; z-index: 1; max-width: 1180px; width: 100%; margin: 0 auto; padding: 48px 24px; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); margin: 0 0 .15em; }
.hero p { font-size: 1.15rem; max-width: 640px; margin: 0 0 1.2em; color: #f3ece2; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.hero h1 { text-shadow: 0 2px 12px rgba(0,0,0,.45); }
.jump { display: flex; gap: 12px; flex-wrap: wrap; }
.jump a { text-decoration: none; border: 1px solid rgba(255,255,255,.6); padding: 8px 16px; border-radius: 999px; font-size: .95rem; }
.jump a:hover { background: #fff; color: var(--ink); }
.sec { max-width: 1180px; margin: 0 auto; padding: 48px 24px 8px; }
.sec h2 { font-size: 2rem; margin: 0; }
.lead { margin: .2em 0 1.4em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(60,40,20,.14); }
.card img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--line); }
.cap { display: block; padding: 10px 14px 12px; }
.cap b { display: block; font-weight: 600; }
.cap small { color: var(--muted); }
.num { float: right; font-family: Georgia, serif; color: var(--accent); font-weight: 700; }

/* Album */
.top { max-width: 1280px; margin: 0 auto; padding: 28px 24px 10px; }
.crumbs { font-size: .9rem; color: var(--muted); }
.crumbs a { color: var(--accent); text-decoration: none; }
.top h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: .2em 0 .1em; }
.part { max-width: 1280px; margin: 28px auto 10px; padding: 0 24px; font-size: 1.4rem; }
.part small { color: var(--muted); font: 400 .9rem system-ui, sans-serif; }
.grid { max-width: 1280px; margin: 12px auto 0; padding: 0 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.grid a { display: block; border-radius: 6px; overflow: hidden; background: var(--line); }
.grid img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; transition: transform .25s, opacity .2s; }
.grid a:hover img { transform: scale(1.04); }
.pager { max-width: 1280px; margin: 40px auto 0; padding: 0 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.nav { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-decoration: none; }
.nav img { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; }
.nav small { display: block; color: var(--accent); font-weight: 600; }
.nav.next { flex-direction: row-reverse; text-align: right; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 48px 24px 36px; }
.foot a { color: var(--accent); text-decoration: none; }

/* Viewer */
.lb { position: fixed; inset: 0; z-index: 50; background: rgba(14,12,10,.96); display: none; align-items: center; justify-content: center; touch-action: pan-y; }
.lb.on { display: flex; }
.lb img { width: 94vw; height: 84vh; max-width: 1100px; max-height: 825px; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb .bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 20px; color: #d9d1c5; display: flex; justify-content: space-between; font-size: .9rem; }
.lb button { position: absolute; background: rgba(255,255,255,.08); color: #fff; border: 0; cursor: pointer; border-radius: 999px; width: 52px; height: 52px; font-size: 26px; line-height: 52px; }
.lb button:hover { background: rgba(255,255,255,.2); }
.lb .x { top: 14px; right: 14px; font-size: 22px; }
.lb .p { left: 14px; top: 50%; margin-top: -26px; }
.lb .n { right: 14px; top: 50%; margin-top: -26px; }
@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 0 8px; }
  .lb .p, .lb .n { display: none; }
  .pager { grid-template-columns: 1fr; }
  .nav.next { flex-direction: row; text-align: left; }
  .hero { display: block; min-height: 0; }
  .hero-img { position: static; height: auto; aspect-ratio: 4/3; }
  .hero::after { display: none; }
  .hero-txt { padding: 22px 20px 28px; }
  .hero h1, .hero p { text-shadow: none; }
}
