/*
 * Φωτογραφικό Αρχείο — /fotografiko-archeio/
 * Shared-data implementation: the visible grids are the canonical FooBox
 * groups used by /to-idiomelo/, not copies of them.
 */

.im-photo-archive {
	--im-archive-content: 1540px;
	--im-archive-columns: 4;
	--im-archive-ink: #251f1b;
	--im-archive-muted: #766e66;
	--im-archive-accent: #8a7c5f;
	--im-archive-active: #7d201c;
	--im-archive-paper: #f7f4ef;
	--im-archive-paper-alt: #eee9e1;
	--im-archive-line: rgba(50, 42, 35, 0.16);
	--im-archive-shadow: 0 14px 38px rgba(38, 30, 23, 0.10);
	color: var(--im-archive-ink);
	background: #fff;
}

/* ---------------------------------------------------------
   HERO — uses /assets/images/fotografiko-archeio-hero.webp
   --------------------------------------------------------- */

.im-photo-archive .im-photo-archive-hero {
	position: relative;
	isolation: isolate;
	width: 100%;
	max-width: none !important;
	min-height: clamp(470px, 54vw, 680px) !important;
	margin: 0;
	overflow: hidden;
	background-color: #d4c5ad;
	background-image: url("../images/fotografiko-archeio-hero.webp");
	background-position: center;
	background-size: cover;
}

.im-photo-archive .im-photo-archive-hero.wp-block-cover {
	padding: 0;
}

.im-photo-archive .im-photo-archive-hero .wp-block-cover__image-background {
	z-index: 0;
	object-fit: cover;
	object-position: center;
}

.im-photo-archive .im-photo-archive-hero::after,
.im-photo-archive .im-photo-archive-hero__shade {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background:
		linear-gradient(90deg,
			rgba(30, 23, 17, 0.86) 0%,
			rgba(30, 23, 17, 0.67) 28%,
			rgba(30, 23, 17, 0.28) 58%,
			rgba(30, 23, 17, 0.05) 82%,
			transparent 100%),
		linear-gradient(0deg, rgba(24, 18, 13, 0.18), transparent 45%);
}

.im-photo-archive .im-photo-archive-hero__shade {
	z-index: 1;
}

.im-photo-archive .im-photo-archive-hero .wp-block-cover__inner-container,
.im-photo-archive .im-photo-archive-hero__inner {
	position: relative;
	z-index: 2;
	width: min(calc(100% - 48px), var(--im-archive-content));
	max-width: var(--im-archive-content) !important;
	margin-inline: auto;
}

.im-photo-archive .im-photo-archive-hero__inner {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: clamp(470px, 54vw, 680px);
	padding-block: clamp(74px, 9vw, 130px);
}

.im-photo-archive .im-photo-archive-hero .wp-block-cover__inner-container > .im-photo-archive-hero__inner {
	width: min(1080px, 82%);
	max-width: 1080px !important;
	margin-inline: 0;
}

.im-photo-archive .im-photo-archive-hero__eyebrow {
	margin: 0 0 13px;
	color: rgba(255,255,255,.88);
	font-size: .76rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
}

.im-photo-archive .im-photo-archive-hero__title,
.im-photo-archive .im-page-title.im-photo-archive-hero__title {
	width: 100%;
	max-width: none !important;
	margin: 0;
	color: #fff;
	font-size: clamp(3.3rem, 6.1vw, 6.2rem);
	font-weight: 600;
	line-height: .95;
	letter-spacing: -.035em;
	text-wrap: pretty;
}

.im-photo-archive .im-photo-archive-hero__copy {
	max-width: 58ch;
	margin: 23px 0 0;
	color: rgba(255,255,255,.92);
	font-size: clamp(1rem, 1.4vw, 1.18rem);
	line-height: 1.7;
}

/* ---------------------------------------------------------
   TOP ANCHOR NAVIGATION
   --------------------------------------------------------- */

.im-photo-archive .im-photo-archive-nav {
	position: relative;
	z-index: 4;
	width: min(calc(100% - 48px), var(--im-archive-content));
	max-width: var(--im-archive-content) !important;
	margin: -34px auto 44px;
	padding: clamp(22px, 2.6vw, 31px);
	background: rgba(255,255,255,.975);
	border: 1px solid var(--im-archive-line);
	box-shadow: var(--im-archive-shadow);
}

.im-photo-archive .im-photo-archive-nav__label {
	margin: 0 0 15px;
	color: var(--im-archive-muted);
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .11em;
	text-align: center;
	text-transform: uppercase;
}

.im-photo-archive .im-photo-archive-nav__links.wp-block-buttons {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;
}

.im-photo-archive .im-photo-archive-nav__button.wp-block-button {
	width: 100%;
}

.im-photo-archive .im-photo-archive-nav__button .wp-block-button__link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	width: 100%;
	min-height: 56px;
	padding: 12px 15px;
	color: var(--im-archive-ink);
	background: var(--im-archive-paper);
	border: 1px solid transparent;
	border-radius: 0;
	font-size: .9rem;
	font-weight: 620;
	line-height: 1.3;
	text-align: left;
	transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.im-photo-archive .im-photo-archive-nav__button .wp-block-button__link:hover,
.im-photo-archive .im-photo-archive-nav__button .wp-block-button__link:focus-visible {
	color: var(--im-archive-active);
	background: #fff;
	border-color: var(--im-archive-accent);
}

/* ---------------------------------------------------------
   SINGLE GLOBAL LAYOUT BAR — mirrors the /nea/ interaction
   --------------------------------------------------------- */

.im-photo-archive .im-photo-archive-layoutbar {
	width: min(calc(100% - 48px), var(--im-archive-content));
	max-width: var(--im-archive-content) !important;
	margin: 0 auto;
	border-top: 1px solid var(--im-archive-line);
	border-bottom: 1px solid var(--im-archive-line);
}

.im-photo-archive .im-photo-archive-layoutbar__inner {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	min-height: 74px;
	gap: 12px;
}

.im-photo-archive .im-photo-archive-layoutbar__label {
	color: #968b81;
	font-size: .78rem;
	font-weight: 500;
}

.im-photo-archive .im-photo-archive-layoutbar__controls {
	display: inline-flex;
	align-items: stretch;
	padding: 4px;
	background: #fff;
	border: 1px solid #ded8d1;
}

.im-photo-archive .im-photo-layout-button {
	display: grid;
	place-items: center;
	width: 40px;
	height: 38px;
	margin: 0;
	padding: 0;
	color: #746c65;
	background: transparent;
	border: 0;
	border-radius: 0;
	cursor: pointer;
	transition: color 150ms ease, background-color 150ms ease;
}

.im-photo-archive .im-photo-layout-button:hover,
.im-photo-archive .im-photo-layout-button:focus-visible {
	color: var(--im-archive-ink);
	background: var(--im-archive-paper);
}

.im-photo-archive .im-photo-layout-button.is-active,
.im-photo-archive .im-photo-layout-button[aria-pressed="true"] {
	color: #fff;
	background: var(--im-archive-active);
}

.im-photo-archive .im-photo-layout-button:focus-visible {
	outline: 2px solid var(--im-archive-active);
	outline-offset: 2px;
}

.im-photo-archive .im-photo-layout-icon {
	display: grid;
	grid-template-columns: repeat(var(--icon-cols), 4px);
	grid-template-rows: repeat(3, 4px);
	gap: 2px;
	pointer-events: none;
}

.im-photo-archive .im-photo-layout-icon > span {
	width: 4px;
	height: 4px;
	background: currentColor;
}

/* Hide the old per-section controls from the Gutenberg structure even before JS removes them. */
.im-photo-archive .im-photo-grid-controls {
	display: none !important;
}

/* ---------------------------------------------------------
   COLLECTION SECTIONS
   --------------------------------------------------------- */

.im-photo-archive .im-photo-archive-collections {
	margin: 0;
	padding: clamp(32px, 4vw, 54px) 0 0;
}

.im-photo-archive .im-photo-archive-section {
	width: 100%;
	max-width: none !important;
	margin: 0;
	padding: clamp(62px, 7vw, 98px) max(24px, calc((100vw - var(--im-archive-content)) / 2));
	scroll-margin-top: 112px;
}

.im-photo-archive .im-photo-archive-section--tinted {
	background: var(--im-archive-paper);
}

.im-photo-archive .im-photo-archive-section > .im-photo-archive-section__header,
.im-photo-archive .im-photo-archive-section > .im-photo-archive-grid,
.im-photo-archive .im-photo-archive-section > .im-photo-archive-back {
	width: 100%;
	max-width: var(--im-archive-content) !important;
	margin-inline: auto;
}

.im-photo-archive .im-photo-archive-section__header {
	display: block;
	margin-bottom: clamp(27px, 3.4vw, 40px);
	padding-bottom: 19px;
	border-bottom: 1px solid var(--im-archive-line);
}

.im-photo-archive .im-photo-archive-section .im-eyebrow {
	margin: 0 0 7px;
	color: var(--im-archive-accent);
	font-size: .74rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.im-photo-archive .im-photo-archive-section h2 {
	max-width: 24ch;
	margin: 0;
	color: var(--im-archive-ink);
	font-size: clamp(2.3rem, 4.7vw, 4.25rem);
	font-weight: 600;
	line-height: 1;
	letter-spacing: -.028em;
	text-wrap: balance;
}

/* ---------------------------------------------------------
   CANONICAL FOOBOX GALLERIES, MOUNTED VISIBLY
   --------------------------------------------------------- */

/* Hidden everywhere while the shortcode is still acting as a source bank. */
.im-photo-archive .im-story-gallery-bank {
	display: none !important;
}

.im-photo-archive .im-photo-archive-grid {
	width: 100%;
	max-width: var(--im-archive-content) !important;
}

.im-photo-archive .im-photo-archive-grid.is-empty {
	padding: 24px;
	color: var(--im-archive-muted);
	background: var(--im-archive-paper-alt);
	border: 1px solid var(--im-archive-line);
}

.im-photo-archive .im-photo-archive-empty-message {
	margin: 0;
}

.im-photo-archive .im-photo-archive-gallery,
.im-photo-archive .im-photo-archive-grid > .im-story-gallery-group {
	width: 100%;
	max-width: none !important;
}

.im-photo-archive .im-photo-archive-gallery {
	display: grid;
	grid-template-columns: repeat(var(--im-archive-columns), minmax(0, 1fr));
	gap: clamp(10px, 1.25vw, 17px);
	align-items: start;
}

.im-photo-archive .im-photo-archive-item {
	position: relative;
	display: block;
	min-width: 0;
	overflow: hidden;
	color: #fff;
	background: #ded7cc;
	text-decoration: none;
	cursor: zoom-in;
	box-shadow: 0 1px 0 rgba(37,31,27,.04);
	transition: transform 180ms ease, box-shadow 180ms ease;
}

.im-photo-archive .im-photo-archive-item::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(0deg, rgba(22,17,13,.60), transparent 44%);
	opacity: 0;
	transition: opacity 180ms ease;
}

.im-photo-archive .im-photo-archive-item:hover,
.im-photo-archive .im-photo-archive-item:focus-visible {
	z-index: 2;
	transform: translateY(-2px);
	box-shadow: 0 17px 36px rgba(38,30,23,.16);
}

.im-photo-archive .im-photo-archive-item:hover::after,
.im-photo-archive .im-photo-archive-item:focus-visible::after,
.im-photo-archive .im-photo-archive-item.has-caption::after {
	opacity: 1;
}

.im-photo-archive .im-photo-archive-item:focus-visible {
	outline: 3px solid var(--im-archive-active);
	outline-offset: 3px;
}

.im-photo-archive .im-photo-archive-image {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	background: #ded7cc;
	transition: transform 300ms cubic-bezier(.2,.7,.2,1);
}

.im-photo-archive .im-photo-archive-item:hover .im-photo-archive-image,
.im-photo-archive .im-photo-archive-item:focus-visible .im-photo-archive-image {
	transform: scale(1.025);
}

.im-photo-archive .im-photo-archive-caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	padding: 22px 16px 14px;
	color: #fff;
	font-size: .84rem;
	font-weight: 520;
	line-height: 1.35;
	text-shadow: 0 1px 7px rgba(0,0,0,.38);
}

.im-photo-archive .im-photo-archive-back {
	margin-top: clamp(28px, 3vw, 42px);
	font-size: .86rem;
	font-weight: 620;
	text-align: right;
}

.im-photo-archive .im-photo-archive-back a {
	color: var(--im-archive-muted);
	text-decoration: none;
	text-underline-offset: 4px;
}

.im-photo-archive .im-photo-archive-back a:hover,
.im-photo-archive .im-photo-archive-back a:focus-visible {
	color: var(--im-archive-active);
	text-decoration: underline;
}

/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */

@media (max-width: 1320px) {
	.im-photo-archive .im-photo-archive-hero .wp-block-cover__inner-container > .im-photo-archive-hero__inner {
		width: min(920px, 78%);
	}
}

@media (max-width: 1100px) {
	.im-photo-archive .im-photo-archive-nav__links.wp-block-buttons {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 1024px) {
	.im-photo-archive {
		--im-archive-columns: 2 !important;
	}

	.im-photo-archive .im-photo-archive-layoutbar {
		display: none;
	}
}

@media (max-width: 760px) {
	.im-photo-archive .im-photo-archive-hero {
		min-height: 520px !important;
		background-position: center;
	}

	.im-photo-archive .im-photo-archive-hero::after,
	.im-photo-archive .im-photo-archive-hero__shade {
		background: linear-gradient(0deg,
			rgba(28,21,16,.88) 0%,
			rgba(28,21,16,.62) 48%,
			rgba(28,21,16,.20) 100%);
	}

	.im-photo-archive .im-photo-archive-hero .wp-block-cover__inner-container,
	.im-photo-archive .im-photo-archive-hero__inner {
		width: min(calc(100% - 32px), var(--im-archive-content));
	}

	.im-photo-archive .im-photo-archive-hero__inner {
		justify-content: flex-end;
		min-height: 520px;
		padding-block: 70px 44px;
	}

	.im-photo-archive .im-photo-archive-hero .wp-block-cover__inner-container > .im-photo-archive-hero__inner {
		width: 100%;
	}

	.im-photo-archive .im-photo-archive-hero__title,
	.im-photo-archive .im-page-title.im-photo-archive-hero__title {
		font-size: clamp(3rem, 14vw, 4.6rem);
	}

	.im-photo-archive .im-photo-archive-nav {
		width: min(calc(100% - 28px), var(--im-archive-content));
		margin-top: -22px;
		margin-bottom: 34px;
		padding: 17px;
	}

	.im-photo-archive .im-photo-archive-nav__links.wp-block-buttons {
		grid-template-columns: 1fr;
		gap: 6px;
	}

	.im-photo-archive .im-photo-archive-section {
		padding-inline: 20px;
		scroll-margin-top: 78px;
	}
}

@media (max-width: 600px) {
	.im-photo-archive {
		--im-archive-columns: 1 !important;
	}

	.im-photo-archive .im-photo-archive-gallery {
		gap: 14px;
	}

	.im-photo-archive .im-photo-archive-section h2 {
		font-size: clamp(2.2rem, 11vw, 3.25rem);
	}

	.im-photo-archive .im-photo-archive-back {
		text-align: left;
	}
}

@media (prefers-reduced-motion: reduce) {
	.im-photo-archive *,
	.im-photo-archive *::before,
	.im-photo-archive *::after {
		scroll-behavior: auto !important;
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
	}
}

/* =========================================================
   FINAL WIDTH / FULL-BLEED OVERRIDES
   2026-09-17
   ========================================================= */

/* The archive is intentionally allowed to break out of any
   GeneratePress/Gutenberg content-size constraint. */
.im-photo-archive {
	--im-archive-content: 1680px;
	overflow-x: clip;
}

/* Remove the hero photo-count badge entirely. */
.im-photo-archive .im-photo-archive-hero__eyebrow {
	display: none !important;
}

/* With the eyebrow gone, let the title sit naturally in the hero. */
.im-photo-archive .im-photo-archive-hero__title,
.im-photo-archive .im-page-title.im-photo-archive-hero__title {
	margin-top: 0 !important;
}

/* Let the category navigation and the single layout controller use
   the same wide desktop measure as the galleries. */
.im-photo-archive .im-photo-archive-nav,
.im-photo-archive .im-photo-archive-layoutbar {
	box-sizing: border-box;
	width: min(calc(100vw - 64px), var(--im-archive-content)) !important;
	max-width: none !important;
}

/* Every collection becomes a genuine full-width page section,
   independent of the width of its Gutenberg parent container. */
.im-photo-archive .im-photo-archive-section {
	box-sizing: border-box;
	position: relative;
	width: 100vw !important;
	max-width: none !important;
	margin-right: 0 !important;
	margin-left: calc(50% - 50vw) !important;
	padding-right: clamp(24px, 3vw, 48px) !important;
	padding-left: clamp(24px, 3vw, 48px) !important;
}

/* Defeat Gutenberg's generated is-layout-constrained rules on the
   actual editorial content. These are the widths that matter. */
.im-photo-archive .im-photo-archive-section > .im-photo-archive-section__header,
.im-photo-archive .im-photo-archive-section > .im-photo-archive-grid,
.im-photo-archive .im-photo-archive-section > .im-photo-archive-back {
	box-sizing: border-box;
	width: 100% !important;
	max-width: var(--im-archive-content) !important;
	margin-right: auto !important;
	margin-left: auto !important;
}

.im-photo-archive .im-photo-archive-grid,
.im-photo-archive .im-photo-archive-grid > .im-story-gallery-group,
.im-photo-archive .im-photo-archive-gallery {
	width: 100% !important;
	max-width: none !important;
}

/* A little more breathing room now that the sections are visually larger. */
.im-photo-archive .im-photo-archive-section__header {
	margin-bottom: clamp(32px, 3vw, 48px) !important;
}

/* Keep the full-bleed architecture on tablets/mobile, but use sane gutters. */
@media (max-width: 760px) {
	.im-photo-archive .im-photo-archive-nav,
	.im-photo-archive .im-photo-archive-layoutbar {
		width: calc(100vw - 28px) !important;
	}

	.im-photo-archive .im-photo-archive-section {
		padding-right: 20px !important;
		padding-left: 20px !important;
	}
}

/* =========================================================
   SITE-WIDTH ALIGNMENT CORRECTIONS
   Hero/nav = site content width.
   Gallery editorial content = wide archive width.
   Section backgrounds remain full bleed.
   ========================================================= */

.im-photo-archive {
	--im-site-content: var(--content-width, 1220px);
	--im-archive-content: 1680px;
}

/* Keep the hero itself full width, but restore its original visual height. */
.im-photo-archive .im-photo-archive-hero,
.im-photo-archive .im-photo-archive-hero.wp-block-cover {
	min-height: 540px !important;
}

.im-photo-archive .im-photo-archive-hero__inner {
	min-height: 540px !important;
	padding-block: 72px !important;
}

/* The hero copy belongs to the site's normal 1220px editorial axis,
   not the extra-wide photographic archive axis. */
.im-photo-archive .im-photo-archive-hero .wp-block-cover__inner-container {
	box-sizing: border-box;
	width: min(calc(100% - 48px), var(--im-site-content)) !important;
	max-width: var(--im-site-content) !important;
	margin-right: auto !important;
	margin-left: auto !important;
}

.im-photo-archive .im-photo-archive-hero .wp-block-cover__inner-container > .im-photo-archive-hero__inner,
.im-photo-archive .im-photo-archive-hero--auto > .im-photo-archive-hero__inner {
	box-sizing: border-box;
	width: min(1080px, 100%) !important;
	max-width: 1080px !important;
	margin-right: 0 !important;
	margin-left: 0 !important;
}

/* The category bar and /nea/-style layout selector also follow the
   site's normal content measure. Do not let them inherit 1680px. */
.im-photo-archive .im-photo-archive-nav,
.im-photo-archive .im-photo-archive-layoutbar {
	box-sizing: border-box;
	width: min(calc(100% - 48px), var(--im-site-content)) !important;
	max-width: var(--im-site-content) !important;
	margin-right: auto !important;
	margin-left: auto !important;
}

/* Keep the four collection sections truly full bleed. */
.im-photo-archive .im-photo-archive-section {
	width: 100vw !important;
	max-width: none !important;
	margin-left: calc(50% - 50vw) !important;
	margin-right: 0 !important;
}

/* But give the photographs substantially more room than ordinary
   editorial content. */
.im-photo-archive .im-photo-archive-section > .im-photo-archive-section__header,
.im-photo-archive .im-photo-archive-section > .im-photo-archive-grid,
.im-photo-archive .im-photo-archive-section > .im-photo-archive-back {
	width: 100% !important;
	max-width: var(--im-archive-content) !important;
	margin-right: auto !important;
	margin-left: auto !important;
}

@media (max-width: 1024px) {
	.im-photo-archive .im-photo-archive-hero,
	.im-photo-archive .im-photo-archive-hero.wp-block-cover,
	.im-photo-archive .im-photo-archive-hero__inner {
		min-height: 480px !important;
	}

	.im-photo-archive .im-photo-archive-hero__inner {
		padding-block: 58px !important;
	}
}

@media (max-width: 760px) {
	.im-photo-archive .im-photo-archive-hero,
	.im-photo-archive .im-photo-archive-hero.wp-block-cover,
	.im-photo-archive .im-photo-archive-hero__inner {
		min-height: 430px !important;
	}

	.im-photo-archive .im-photo-archive-hero .wp-block-cover__inner-container,
	.im-photo-archive .im-photo-archive-nav,
	.im-photo-archive .im-photo-archive-layoutbar {
		width: calc(100% - 28px) !important;
	}

	.im-photo-archive .im-photo-archive-hero__inner {
		padding-block: 46px !important;
	}
}
