/*
 * Portfolio page only (template-portfolio-new.php). Loaded after service-pick.css,
 * which still holds the shared opening band (.dd-pf-hero) and the pill buttons
 * (.dd-pf-filters) that the News page also uses.
 * Breakpoints follow the rest of the theme: tablet <= 1023px, phone <= 767px.
 * No hover zoom anywhere: a hover only lifts a tile by 2px and adds a soft shadow.
 */

/* Pills (second row sits directly above the grid) */
.dd-pf-gallery .dd-pf-filters { margin: 0 0 22px; }

/* Featured projects (moved here from service-pick.css, unchanged) */
.dd-pf-projects .dd-svc-h2 { margin-bottom: 18px; }
.dd-pf-project { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 28px; align-items: center; padding: 20px; border-radius: 16px; background: #FDF8F4; }
.dd-pf-project + .dd-pf-project { margin-top: 16px; }
.dd-pf-project__photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 165px; gap: 10px; }
.dd-pf-project__photos--1 { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 340px; }
.dd-pf-project__photos--3 .dd-pf-open:first-child { grid-row: span 2; }
.dd-pf-project__photos .dd-pf-open { height: 100%; }
.dd-pf-project__text h3 { font-family: var(--font-secondary, 'Playfair Display', serif); font-size: 26px; line-height: 1.25; margin: 0 0 10px; }
.dd-pf-project__text p { font-size: 15px; line-height: 1.65; color: var(--svc-muted); }
.dd-pf-project__pieces { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.dd-pf-project__pieces li { padding-left: 14px; border-left: 2px dashed var(--svc-gold); line-height: 1.5; }
.dd-pf-project__pieces span { display: block; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--svc-pink); }

/* A featured-project photo: opens the viewer; no caption, no zoom */
.dd-pf-open { position: relative; display: block; width: 100%; height: 300px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: zoom-in; background: var(--svc-tint); transition: transform .2s ease, box-shadow .2s ease; }
.dd-pf-open img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; display: block; }
.dd-pf-open:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 0, 0, .14); }

/* "+N more" on the 4th photo of a project card; photos 5 and up are hidden buttons that only feed the viewer */
.dd-pf-open[hidden] { display: none; }
.dd-pf-open__more { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(20, 20, 20, .66); color: #FFFFFF; font-size: 22px; font-weight: 600; letter-spacing: .02em; }
.dd-pf-project__text h3 a { color: inherit; text-decoration: none; }
.dd-pf-project__text h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.dd-pf-project__link { margin: 14px 0 0 !important; }
.dd-pf-project__link a { color: var(--svc-pink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.dd-pf-project__link a:hover { color: var(--svc-pink-dark); }
.dd-pf-moreprojects[hidden] { display: none; }
.dd-pf-moreprojects { margin-top: 16px; }
.dd-pf-moreprojects .dd-pf-project + .dd-pf-project { margin-top: 16px; }
.dd-pf-allprojects { margin: 20px 0 0 !important; text-align: center; }
.dd-pf-allprojects[hidden] { display: none; }
.dd-pf-project__link a:focus-visible, .dd-pf-project__text h3 a:focus-visible { outline: 3px solid var(--svc-pink); outline-offset: 2px; }

/* A project's own page (single-dd_project.php) */
.dd-proj-back { display: inline-block; margin: 0 0 14px; font-size: 15px; font-weight: 600; color: var(--svc-pink); text-decoration: underline; text-underline-offset: 3px; }
.dd-proj-back:hover { color: var(--svc-pink-dark); }
.dd-proj-main { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: start; }
.dd-proj-story { font-size: 16px; line-height: 1.7; color: var(--svc-ink); }
.dd-proj-story p { margin: 0 0 14px; }
.dd-proj-pieces h2 { margin: 0 0 4px; font-family: var(--font-secondary, 'Playfair Display', serif); font-size: 22px; font-weight: 400; }
.dd-proj-photos { margin-top: 28px; }
.dd-proj-photos .dd-pf-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Grid area */
.dd-pf-area { scroll-margin-top: 90px; }
.dd-pf-all[hidden], .dd-pf-cat[hidden], .dd-pf-tiles li[hidden], .dd-pf-more-wrap[hidden] { display: none; }
.dd-pf-areahead { margin: 0 0 16px; font-family: var(--font-secondary, 'Playfair Display', serif); font-size: clamp(22px, 2.2vw, 28px); font-weight: 400; line-height: 1.2; color: var(--svc-ink); }
.dd-pf-areahead:focus { outline: none; }
.dd-pf-areahead span { margin-left: 8px; font-family: var(--font-primary, 'Poppins', sans-serif); font-size: 14px; color: var(--svc-muted); white-space: nowrap; }
.dd-pf-cathead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; margin: 0 0 16px; }
.dd-pf-cathead .dd-pf-areahead { margin: 0; }
.dd-pf-back { min-height: 44px; padding: 0 4px; border: 0; background: none; font: inherit; font-size: 15px; font-weight: 600; color: var(--svc-pink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.dd-pf-back:hover { color: var(--svc-pink-dark); }

.dd-pf-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.dd-pf-tiles li { margin: 0; padding: 0; }
.dd-pf-tile { position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--svc-tint); text-align: left; font: inherit; color: #FFFFFF; transition: transform .2s ease, box-shadow .2s ease; }
.dd-pf-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; display: block; }
.dd-pf-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 0, 0, .14); }
.dd-pf-tile--cat { color: #FFFFFF; }
/* The dark band sits only behind the words (white on it is 9:1 or better) */
.dd-pf-tile__words { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 2px; padding: 44px 14px 14px; background: linear-gradient(0deg, rgba(20, 20, 20, .9) 0, rgba(20, 20, 20, .78) 55%, rgba(20, 20, 20, 0) 100%); }
.dd-pf-tile__words strong { font-family: var(--font-secondary, 'Playfair Display', serif); font-size: 19px; font-weight: 400; line-height: 1.2; color: #FFFFFF; }
.dd-pf-tile__words span { font-size: 13px; color: #FFFFFF; }
.dd-pf-tile__chip { position: absolute; left: 8px; top: 8px; max-width: calc(100% - 16px); padding: 4px 10px; border-radius: 999px; background: rgba(20, 20, 20, .82); color: #FFFFFF; font-size: 12px; line-height: 1.3; }
.dd-pf-tile:focus-visible, .dd-pf-open:focus-visible, .dd-pf-back:focus-visible, .dd-pf-more:focus-visible { outline: 3px solid var(--svc-pink); outline-offset: 2px; }

.dd-pf-more-wrap { margin-top: 20px !important; text-align: center; }
.dd-pf-techs { margin-top: 32px; padding-top: 20px; border-top: 2px dashed var(--svc-gold); }
.dd-pf-techs ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.dd-pf-techs li { padding: 6px 14px; border-radius: 999px; background: var(--svc-blush); font-size: 14px; }

/* Viewer: a fixed full-screen overlay. The stage never changes size, so nothing jumps between photos. */
.dd-pf-viewer { position: fixed; inset: 0; z-index: 999999; display: flex; align-items: center; justify-content: center; padding: 52px 0 8px; background: rgba(16, 12, 14, .97); opacity: 0; transition: opacity .18s ease; overscroll-behavior: contain; touch-action: none; }
.dd-pf-viewer[hidden] { display: none; }
.dd-pf-viewer.is-open { opacity: 1; }
.dd-pf-viewer__box { display: flex; flex-direction: column; align-items: center; width: 92vw; }
.dd-pf-viewer__stage { display: flex; align-items: center; justify-content: center; width: 92vw; height: 82vh; height: min(82vh, calc(100dvh - 116px)); }
.dd-pf-viewer img.dd-pf-viewer__img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; object-position: 50% 50%; border-radius: 6px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .14); background: none; }
.dd-pf-viewer__cap { width: 100%; box-sizing: border-box; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0 10px; height: 56px; margin: 0 !important; padding: 0 12px; font-size: 14px; line-height: 1.3; text-align: center; color: #FFFFFF; }
.dd-pf-viewer__count { min-width: 5.5ch; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.dd-pf-viewer__label { color: #FFFFFF; }
.dd-pf-viewer__close, .dd-pf-viewer__nav { position: absolute; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #FFFFFF; font-family: Arial, sans-serif; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background-color .2s ease; }
.dd-pf-viewer__close { right: 12px; top: 4px; font-size: 30px; }
.dd-pf-viewer__nav { top: 50%; margin-top: -44px; font-size: 34px; padding-bottom: 4px; background: rgba(20, 20, 20, .55); }
.dd-pf-viewer__nav--prev { left: 12px; }
.dd-pf-viewer__nav--next { right: 12px; }
.dd-pf-viewer__close:hover, .dd-pf-viewer__nav:hover { background: rgba(255, 255, 255, .3); }
.dd-pf-viewer button:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 2px; }
.dd-pf-viewer.is-single .dd-pf-viewer__nav { display: none; }
html.dd-pf-locked { overflow: hidden; }

/* Tablets */
@media (max-width: 1023px) {
	.dd-pf-tiles, .dd-proj-photos .dd-pf-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.dd-proj-main { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.dd-pf-project__photos { grid-auto-rows: 130px; }
	.dd-pf-projects .dd-pf-project__pieces { display: none; }
}

/* Phones */
@media (max-width: 767px) {
	.dd-pf-tiles, .dd-proj-photos .dd-pf-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.dd-pf-open__more { font-size: 18px; }
	.dd-pf-tile__words { padding: 36px 10px 10px; }
	.dd-pf-tile__words strong { font-size: 16px; }
	.dd-pf-tile__words span { font-size: 12px; }
	.dd-pf-project { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 14px; }
	.dd-pf-project__photos, .dd-pf-project__photos--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 125px; gap: 8px; }
	.dd-pf-project__photos--4 .dd-pf-open:first-child { grid-row: auto; }
	.dd-pf-project__text h3 { font-size: 22px; }
	.dd-pf-moreprojects .dd-pf-project__pieces, .dd-pf-projects .dd-pf-project__pieces { display: none; } /* the pieces are on the project's own page; keeps the Portfolio page short on phones */
	.dd-pf-open { height: 200px; }
	.dd-pf-viewer__nav { top: auto; bottom: 8px; margin-top: 0; }
	.dd-pf-viewer__nav--prev { left: 8px; }
	.dd-pf-viewer__nav--next { right: 8px; }
	.dd-pf-viewer__cap { padding: 0 60px; }
}

@media (prefers-reduced-motion: reduce) {
	.dd-pf-open, .dd-pf-tile, .dd-pf-viewer, .dd-pf-viewer__close, .dd-pf-viewer__nav { transition: none; }
	.dd-pf-open:hover, .dd-pf-tile:hover { transform: none; }
}
/* Calm loading hint while a large photo arrives (no motion when reduced motion is asked for). */
.dd-pf-viewer__stage { background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0) 60%); }

/* Pieces: several shots of one garment. The grid shows ONE tile with a small "N views" badge; the viewer shows a
   strip of thumbnails + labels under the photo. White on the badge's dark ground is better than 12:1. */
.dd-pf-tile__views { position: absolute; right: 8px; bottom: 8px; padding: 4px 10px; border-radius: 999px; background: rgba(20, 20, 20, .86); color: #FFFFFF; font-size: 12px; font-weight: 600; line-height: 1.3; }
.dd-pf-viewer__strip { display: none; }
.dd-pf-viewer.has-pieces .dd-pf-viewer__strip { display: flex; align-items: flex-start; justify-content: center; gap: 6px; box-sizing: border-box; width: 92vw; height: 76px; padding-top: 6px; }
.dd-pf-viewer.has-pieces .dd-pf-viewer__stage { height: calc(82vh - 76px); height: min(calc(82vh - 76px), calc(100dvh - 192px)); }
.dd-pf-viewer__thumb { flex: 0 1 64px; min-width: 44px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0; border: 0; background: none; color: #FFFFFF; font: inherit; cursor: pointer; }
.dd-pf-viewer__thumb img { display: block; width: 44px; height: 50px; object-fit: cover; object-position: 50% 35%; border-radius: 4px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .24); opacity: .7; transition: opacity .2s ease; }
.dd-pf-viewer__thumb span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 14px; color: #FFFFFF; }
.dd-pf-viewer__thumb:hover img, .dd-pf-viewer__thumb[aria-current] img { opacity: 1; }
.dd-pf-viewer__thumb[aria-current] img { box-shadow: 0 0 0 2px #FFFFFF; }
.dd-pf-viewer__thumb[aria-current] span { font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
	.dd-pf-viewer__thumb img { transition: none; }
}
