/*
Theme Name: Dovecot
Author: ChatGPT och Andreas Eriksson
Description: Ljust fotoportföljtema med bildrutnät, gallerier och separat textarkiv.
Version: 1.1.2
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: dovecot
*/

/* 01. Modern WordPress CSS Reset — 2026
--------------------------------------------- */

/* Box sizing */
*,
*::before,
*::after {
	box-sizing: border-box;
}

/* Remove default spacing */
* {
	margin: 0;
}

/* Document */
html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}

/* Body */
body {
	min-height: 100vh;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6,
p {
	overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	line-height: 1.15;
	text-wrap: balance;
}

p {
	text-wrap: pretty;
}

/* Lists
	Keep semantic list markers by default.
*/
ul,
ol {
	padding-inline-start: 1.5em;
}

/* Images / media */
img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
}

img,
video {
	height: auto;
}

/* Prevent SVG overflow */
svg {
	overflow: visible;
}

/* Forms */
input,
button,
textarea,
select {
	font: inherit;
	color: inherit;
}

button,
input,
select,
textarea {
	margin: 0;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
	appearance: button;
}

button,
select {
	text-transform: none;
}

textarea {
	resize: vertical;
}

/* Links */
a {
	color: inherit;
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.15em;
}

/* Tables */
table {
	border-collapse: collapse;
	border-spacing: 0;
}

/* Horizontal rule */
hr {
	height: 0;
	color: inherit;
	border: 0;
	border-top: 1px solid currentColor;
}

/* Quotes */
blockquote,
q {
	quotes: none;
}

blockquote::before,
blockquote::after,
q::before,
q::after {
	content: "";
	content: none;
}

/* Font weight */
b,
strong {
	font-weight: bolder;
}

/* Code */
pre,
code,
kbd,
samp {
	font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

pre {
	overflow-x: auto;
	white-space: pre;
}

/* Hidden */
[hidden] {
	display: none !important;
}

/* Better focus defaults */
:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* Dialog */
dialog {
	padding: 0;
}

/* WordPress media */
figure {
	margin: 0;
}

iframe {
	max-width: 100%;
	border: 0;
}

/* WordPress captions */
.wp-caption,
.wp-caption img {
	max-width: 100%;
}

.wp-caption-text {
	overflow-wrap: break-word;
}

/* Gutenberg alignment helpers */
.alignleft {
	float: left;
}

.alignright {
	float: right;
}

.aligncenter {
	display: block;
	margin-inline: auto;
}

.alignwide,
.alignfull {
	max-width: none;
}

/* WordPress responsive embeds */
.wp-block-embed iframe {
	max-width: 100%;
}

/* WordPress galleries */
.wp-block-gallery img,
.wp-block-image img {
	height: auto;
	max-width: 100%;
}

/* Screen-reader text — WordPress compatible */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus {
	position: fixed;
	top: 5px;
	left: 5px;
	z-index: 100000;
	display: block;
	width: auto;
	height: auto;
	padding: 0.75rem 1rem;
	margin: 0;
	overflow: visible;
	clip: auto;
	white-space: normal;
	background: #fff;
	color: #000;
	font-size: 1rem;
	font-weight: 700;
	text-decoration: none;
}

/* Clear floats used by classic WordPress content */
.entry-content::after,
.post-content::after {
	display: table;
	clear: both;
	content: "";
}


/* 01. Grundstilar
--------------------------------------------- */

body,
button,
input,
select,
textarea {
	color: #242424;
	font-family: "Spectral", Georgia, serif;
	font-weight: 300;
	font-style: normal;
	font-size: 1.15rem;
	background: #fff;
	margin: 0;
	line-height: 1.7;
}

a {
	color: #1e1e1d;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

a:visited {
	color: #1e1e1d;
}

a:hover,
a:focus {
	color: #3858e9;
}

a:active {
	color: #1e1e1d;
}

a:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-weight: 700;
	color: #202020;
	line-height: 1.2;
	letter-spacing: -.025em;
	overflow-wrap: break-word;
}

p {
	margin-block: 0 1.25em;
}

strong,
b {
	font-weight: 700;
}

em,
i {
	font-style: italic;
}

small {
	font-size: .875em;
}

mark {
	padding: .08em .2em;
	background: #fff1b8;
	color: inherit;
}

a {
	color: inherit;
	text-decoration: none;
	text-underline-offset: .18em;
}

a:hover {
	text-decoration: underline;
}

blockquote {
	margin: 1.75em 0;
	padding: .25em 0 .25em 1.25em;
	border-left: 3px solid #ddd;
	color: #555;
	font-size: 1.1rem;
	line-height: 1.6;
}

blockquote p:last-child {
	margin-bottom: 0;
}

ul,
ol {
	margin-block: 0 1.25em;
	padding-left: 1.5em;
}

li + li {
	margin-top: 0;
}

hr {
	height: 1px;
	margin: 2.5rem 0;
	border: 0;
	background: #e8e8e8;
}

code,
kbd,
samp {
	font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
	font-size: .9em;
}

code {
	padding: .15em .35em;
	border-radius: 4px;
	background: #f4f4f4;
}

pre {
	padding: 1.25rem;
	overflow-x: auto;
	border-radius: 6px;
	background: #f4f4f4;
}

pre code {
	padding: 0;
	background: transparent;
}

:focus-visible {
	outline: 2px solid #555;
	outline-offset: 4px;
}

.screen-reader-text {
	position: absolute;
	clip: rect(1px, 1px, 1px, 1px);
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.screen-reader-text:focus {
	clip: auto;
	width: auto;
	height: auto;
	z-index: 100;
	background: #fff;
	padding: 1rem;
}


/* 02. Layout och navigering
--------------------------------------------- */

.site-wrap {
	width: min(100% - 40px, 1400px);
	margin-inline: auto;
}

.site-header {
	padding: 100px 0 50px;
}

.header-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 42px;
	text-align: center;
}

.site-main {
	padding-block: 32px 72px;
}

.site-footer {
	border-top: 1px solid #f5f4f4;
	padding: 24px 0;
	text-align: center;
}

.archive-heading {
	margin-bottom: 24px;
	font-size: 1.2rem;
	display: none;
}

.empty-note {
	color: #777;
	padding: 32px 0;
}

.archive .header-text-box,
.wp-singular .header-text-box {
	display: none;
}


/* 03. Fotokort och datum
--------------------------------------------- */

.photo-grid {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 12px;
}

.photo-card {
	position: relative;
	min-width: 0;
	background: #f4f4f4;
	overflow: hidden;
}

.photo-card__link {
	display: block;
	position: relative;
	aspect-ratio: 4 / 5;
	overflow: hidden;
}

.photo-card__link img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .3s ease;
}

.photo-card__link:hover img {
	transform: scale(1.035);
}

.photo-card__date {
	position: absolute;
	inset: auto 0 0;
	padding: 32px 12px 12px;
	color: #fff;
	background: linear-gradient(transparent, rgba(0, 0, 0, .65));
	opacity: 0;
	transition: opacity .2s;
	font-family: "League Mono", monospace;
	font-weight: 300;
	text-align: center;
	font-size: .55rem;
	text-transform: uppercase;
	letter-spacing: .095rem;
}

.photo-card:hover .photo-card__date,
.photo-card:focus-within .photo-card__date {
	opacity: 1;
}

.photo-card__badge {
	position: absolute;
	top: 10px;
	right: 10px;
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	color: #fff;
	background: rgba(0, 0, 0, .45);
	border-radius: 4px;
}

.photo-card__badge svg {
	width: 17px;
	height: 17px;
}


/* 04. Enskild bild och galleri
--------------------------------------------- */

.single-photo {
	max-width: 1050px;
	margin: auto;
}

.single-photo__image {
	display: block;
	margin: auto;
	max-height: 80vh;
	width: auto;
	object-fit: contain;
	cursor: zoom-in;
}

.single-gallery {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	max-width: 1050px;
	margin: auto;
}

.single-gallery a {
	display: block;
	aspect-ratio: 4 / 5;
	background: #f5f5f5;
	overflow: hidden;
}

.single-gallery img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.post-back {
	display: inline-block;
	margin: 0 0 22px;
	color: #777;
	font-size: .85rem;
}


/* 05. Lightbox
--------------------------------------------- */

.dovecot-lightbox[hidden] {
	display: none;
}

.dovecot-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: grid;
	place-items: center;
	background: rgba(255, 255, 255, 1);
	padding: 55px 66px;
}

.dovecot-lightbox__image {
	max-width: 100%;
	max-height: calc(100vh - 110px);
	width: auto;
	height: auto;
	object-fit: contain;
}

.dovecot-lightbox__button {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #f5f4f4;
	color: #222;
	line-height: 1;
}

.dovecot-lightbox__close {
	top: 16px;
	right: 18px;
}

.dovecot-lightbox__prev {
	left: 16px;
	top: 50%;
}

.dovecot-lightbox__next {
	right: 16px;
	top: 50%;
}

.dovecot-lightbox__prev,
.dovecot-lightbox__next {
	font-size: 0;
}

.dovecot-lightbox__prev::before,
.dovecot-lightbox__next::before {
	font-family: "fontello";
	font-style: normal;
	font-weight: normal;
	font-size: .75rem;
	line-height: 1;
	position: relative;
	top: 1px;
}

.dovecot-lightbox__prev::before {
	content: "\e800";
	left: -1px;
}

.dovecot-lightbox__next::before {
	content: "\e801";
	right: -1px;
}

.dovecot-lightbox__close,
.dovecot-lightbox__next,
.dovecot-lightbox__prev {
	cursor: pointer;
}

.dovecot-lightbox__count {
	position: absolute;
	bottom: 15px;
	font-size: .8rem;
}

.dovecot-lightbox__button[hidden],
.dovecot-lightbox__count[hidden] {
	display: none;
}

body.lightbox-open {
	overflow: hidden;
}


/* 06. Textsidor och externa länkar
--------------------------------------------- */

.site-title {
	font-family: "Oleo Script Swash Caps", cursive;
	font-size: 1.65rem;
	font-weight: 400;
	letter-spacing: .025em;
}

a.site-title {
	color: #1e1e1d;
	text-decoration: none;
}

.text-list,
.page-content,
.text-article {
	max-width: 760px;
	margin: auto;
}

.text-entry {
	padding: 26px 0;
	border-bottom: 1px solid #f5f4f4;
}

.text-entry:first-of-type {
	padding-top: 0;
}

.text-entry:last-of-type {
	padding-bottom: 0;
}

.text-entry h2 {
	font-size: 1.45rem;
}

.text-entry h2 a,
.format-link h2 a {
	color: #1e1e1d;
	text-decoration: none;
}

.format-link h2 {
	font-weight: 500;
	font-size: .85rem;
	text-transform: uppercase;
	letter-spacing: .095rem;
}

.entry-date {
	display: block;
	font-family: "League Mono", monospace;
	font-weight: 300;
	font-size: .67rem;
	letter-spacing: .095rem;
	margin: 5px 0 14px;
}

.entry-date a {
	color: #777;
}

.entry-date a:hover {
	color: #3858e9;
}

.entry-content {
	overflow-wrap: anywhere;
}

.entry-content a {
	text-decoration: underline;
}

.entry-content img {
	height: auto;
}

.external-arrow {
	display: inline-block;
	margin-left: .35em;
	font-size: .8em;
	vertical-align: super;
}

.page-content h1,
.text-article h1 {
	font-size: 3.75rem;
	margin-bottom: 20px;
}

.page-content p,
.text-article p {
	margin-bottom: 1em;
}

.page-content p:last-child,
.text-article p:last-child,
.site-wrap p:last-child {
	margin-bottom: 0;
}


/* 07. Sidnumrering
--------------------------------------------- */

.pagination {
	display: flex;
	justify-content: center;
	margin-top: 48px;
	background: transparent;
}

.pagination .nav-links {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px;
	background: transparent;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 50%;
	background: transparent;
	color: #999;
	font-size: .8rem;
	font-weight: 300;
	line-height: 1;
	text-decoration: none;
	transition:
		background-color .2s ease,
		color .2s ease,
		border-color .2s ease;
}

/* Aktuell sida */
.pagination .page-numbers.current {
	border-color: #242424;
	background: #242424;
	color: #fff;
	font-weight: 700;
}

/* Sidnummer vid muspekning */
.pagination a.page-numbers:hover,
.pagination a.page-numbers:focus-visible {
	border-color: #242424;
	background: transparent;
	color: #242424;
	text-decoration: none;
}

/* Punkter mellan sidnumren */
.pagination .page-numbers.dots {
	border-color: transparent;
	color: #999;
}

/* Föregående och nästa: endast pilar */
.pagination .page-numbers.prev,
.pagination .page-numbers.next {
	width: 38px;
	border: 0;
	background: transparent;
	color: #999;
	font-size: 0;
}

.pagination .page-numbers.prev::before,
.pagination .page-numbers.next::before {
	font-family: "fontello";
	font-size: .75rem;
	font-weight: normal;
	font-style: normal;
	line-height: 1;
}

.pagination .page-numbers.prev::before {
	content: "\e800";
}

.pagination .page-numbers.next::before {
	content: "\e801";
}

.pagination .page-numbers.prev:hover,
.pagination .page-numbers.next:hover {
	border: 0;
	background: transparent;
	color: #242424;
}

/* Anpassning på små skärmar */
@media (max-width: 480px) {
	.pagination .nav-links {
		gap: 3px;
	}

	.pagination .page-numbers {
		width: 34px;
		height: 34px;
		font-size: .85rem;
	}
}


/* 08. Dropdown-meny
--------------------------------------------- */

.site-nav {
	position: relative;
	z-index: 100;
}

.site-nav .primary-menu {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 28px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Alla menyalternativ */
.site-nav .primary-menu li {
	position: relative;
	list-style: none;
}

.site-nav .primary-menu a {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-family: "League Mono", monospace;
	font-weight: 300;
	letter-spacing: .095rem;
	text-transform: uppercase;
	font-size: .95rem;
	text-decoration: none;
	white-space: nowrap;
	transition: color .2s ease;
}

.site-nav .primary-menu a:hover,
.site-nav .primary-menu a:focus-visible,
.site-nav .primary-menu .current-menu-item > a,
.site-nav .primary-menu .current-menu-ancestor > a {
	color: #222;
}

/* Liten pil vid menyalternativ med undermeny */
.site-nav .primary-menu .menu-item-has-children > a::after {
	content: "";
	width: 7px;
	height: 7px;
	margin-top: -4px;
	border-right: 1px solid currentColor;
	border-bottom: 1px solid currentColor;
	transform: rotate(45deg);
	transition: transform .2s ease;
}

/* Rotera pilen när undermenyn öppnas */
.site-nav .primary-menu .menu-item-has-children:hover > a::after,
.site-nav .primary-menu .menu-item-has-children:focus-within > a::after {
	transform: rotate(225deg);
}

/* Första nivån av undermenyn */
.site-nav .primary-menu .sub-menu {
	position: absolute;
	top: calc(100% + 14px);
	left: 50%;
	min-width: 190px;
	margin: 0;
	padding: 10px 0;
	border: 1px solid #e7e7e7;
	background: #fff;
	box-shadow: 0 14px 35px rgba(0, 0, 0, .08);
	opacity: 0;
	visibility: hidden;
	transform: translate(-50%, -8px);
	transition:
		opacity .2s ease,
		visibility .2s ease,
		transform .2s ease;
}

/* Öppna undermenyn med mus eller tangentbord */
.site-nav .primary-menu li:hover > .sub-menu,
.site-nav .primary-menu li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
}

/* Länkar inuti undermenyn */
.site-nav .primary-menu .sub-menu li {
	width: 100%;
}

.site-nav .primary-menu .sub-menu a {
	display: flex;
	width: 100%;
	padding: 9px 18px;
	color: #777;
	font-size: .9rem;
}

.site-nav .primary-menu .sub-menu a:hover,
.site-nav .primary-menu .sub-menu a:focus-visible {
	background: #f7f7f7;
	color: #222;
	text-decoration: none;
}

/* Pil för en eventuell undermeny på nivå två */
.site-nav .primary-menu .sub-menu .menu-item-has-children > a::after {
	margin-left: auto;
	transform: rotate(-45deg);
}

.site-nav .primary-menu .sub-menu .menu-item-has-children:hover > a::after,
.site-nav .primary-menu .sub-menu .menu-item-has-children:focus-within > a::after {
	transform: rotate(135deg);
}

/* Nivå två öppnas åt höger */
.site-nav .primary-menu .sub-menu .sub-menu {
	top: -11px;
	left: calc(100% + 1px);
	transform: translate(8px, 0);
}

.site-nav .primary-menu .sub-menu li:hover > .sub-menu,
.site-nav .primary-menu .sub-menu li:focus-within > .sub-menu {
	transform: translate(0, 0);
}


/* 09. Mobil dropdown-meny
--------------------------------------------- */

@media (max-width: 700px) {
	.site-nav .primary-menu {
		flex-direction: column;
		gap: 14px;
	}

	.site-nav .primary-menu .sub-menu,
	.site-nav .primary-menu .sub-menu .sub-menu {
		position: static;
		min-width: 220px;
		margin: 10px auto 0;
		transform: none;
		box-shadow: none;
	}

	.site-nav .primary-menu li:hover > .sub-menu,
	.site-nav .primary-menu li:focus-within > .sub-menu {
		transform: none;
	}

	.site-nav .primary-menu .sub-menu {
		opacity: 1;
		visibility: visible;
		display: none;
	}

	.site-nav .primary-menu li:hover > .sub-menu,
	.site-nav .primary-menu li:focus-within > .sub-menu {
		display: block;
	}

	.site-nav .primary-menu .sub-menu {
		display: none;
		opacity: 0;
		visibility: hidden;
	}

	.site-nav .primary-menu li.submenu-open > .sub-menu {
		display: block;
		opacity: 1;
		visibility: visible;
		transform: none;
	}
}


/* 10. Anpassning till mindre skärmar
--------------------------------------------- */

@media (max-width: 1100px) {
	.photo-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (max-width: 700px) {
	body,
	button,
	input,
	select,
	textarea {
		font-size: .95rem;
	}

	.site-header {
		padding: 50px 0 24px;
	}

	.photo-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 7px;
	}

	.single-gallery {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 7px;
	}

	.site-wrap {
		width: min(100% - 24px, 1400px);
	}

	.header-inner {
		gap: 22px;
	}

	.dovecot-lightbox {
		padding: 52px 45px;
	}
}

@media (max-width: 420px) {
	.photo-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.dovecot-lightbox {
		padding: 55px 35px;
	}

	.dovecot-lightbox__prev {
		left: 3px;
	}

	.dovecot-lightbox__next {
		right: 3px;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}

/* Lightbox: placering på mobil */
@media (max-width: 700px) {
	.dovecot-lightbox {
		height: 100vh;
		height: 100dvh;
		box-sizing: border-box;
		padding: 55px 48px;
	}

	.dovecot-lightbox__image {
		max-width: 100%;
		max-height: calc(100vh - 110px);
		max-height: calc(100dvh - 110px);
		margin: 0;
		object-fit: contain;
	}

	.dovecot-lightbox__prev,
	.dovecot-lightbox__next {
		top: 50%;
		bottom: auto;
		transform: translateY(-50%);
		z-index: 2;
	}

	.dovecot-lightbox__prev {
		left: 3px;
	}

	.dovecot-lightbox__next {
		right: 3px;
	}
}