/*
 * doruk akan: layout and component styles.
 *
 * Rule of thumb for this file: it controls layout and spacing only.
 * Every color comes from a palette swatch (Appearance → Editor → Styles →
 * Colors → Palette) and every font is inherited from Styles → Typography,
 * so nothing here needs to be edited to restyle the site.
 */

:root {
	--da-page: var(--wp--preset--color--page);
	--da-panel: var(--wp--preset--color--panel);
	--da-chrome: var(--wp--preset--color--chrome);
	--da-chrome-text: var(--wp--preset--color--chrome-text);
	--da-text: var(--wp--preset--color--text);
	--da-heading: var(--wp--preset--color--heading);
	--da-meta: var(--wp--preset--color--meta);
	--da-link: var(--wp--preset--color--link);
	--da-link-hover: var(--wp--preset--color--link-hover);
	--da-label: var(--wp--preset--color--label);
	--da-input: var(--wp--preset--color--input);
	--da-border: var(--wp--preset--color--border);
	--da-separator: var(--wp--preset--color--separator, var(--wp--preset--color--border));
	--da-highlight: var(--wp--preset--color--highlight);
	--da-radius: var(--wp--custom--radius, 6px);
	--da-blur: var(--wp--custom--surface-blur, 0px);
	--da-gap: clamp(1rem, 2.5vw, 2rem);
	--da-pad: clamp(1.25rem, 3.5vw, 2.75rem);

	/*
	 * Colors from version 1.0 of the theme, kept as aliases so anything
	 * saved with the old names keeps working.
	 */
	--wp--preset--color--base: var(--wp--preset--color--page);
	--wp--preset--color--surface: var(--wp--preset--color--panel);
	--wp--preset--color--contrast: var(--wp--preset--color--text);
	--wp--preset--color--muted: var(--wp--preset--color--meta);
	--wp--preset--color--accent: var(--wp--preset--color--link);
	--wp--preset--color--accent-soft: var(--wp--preset--color--highlight);
	--wp--preset--font-family--serif: var(--wp--preset--font-family--inter);
	--wp--preset--font-family--display: var(--wp--preset--font-family--inter);
	--wp--preset--font-family--sans: var(--wp--preset--font-family--inter);
}

/* ---------- Base ---------- */

.wp-site-blocks {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* Header flush to the top, footer pushed to the bottom on short pages. */
.wp-site-blocks > header,
.wp-site-blocks > header:first-child {
	margin-block-start: 0 !important;
}

.wp-site-blocks > footer {
	margin-top: auto !important;
}

.wp-site-blocks > main,
.wp-site-blocks > .da-main {
	flex: 1 0 auto;
}

html.da-scroll-lock {
	overflow: hidden;
}

/* Form controls use the site font instead of the browser default. */
button,
input,
select,
textarea,
.wp-element-button {
	font-family: inherit;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

/* Panels that sit on top of the page background (and any background image). */
.da-surface {
	background-color: var(--da-panel);
	border: 1px solid var(--da-border);
	border-radius: var(--da-radius);
	-webkit-backdrop-filter: blur(var(--da-blur));
	backdrop-filter: blur(var(--da-blur));
}

/* Every text link not otherwise styled follows Link / Link hover. */
.da-main a:where(:not(.wp-element-button)),
.da-footer-wrap a:where(:not(.wp-element-button)) {
	transition: color 0.15s ease;
}

/* ---------- Header (full width, scrolls with the page) ---------- */

.da-header-wrap {
	position: relative;
	z-index: 20;
	margin: 0 !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	background-color: var(--da-chrome);
	border-bottom: 1px solid var(--da-border);
	color: var(--da-chrome-text);
}

.wp-site-blocks > header {
	position: relative;
	z-index: 20;
}

/* The inner bar lines up with the content below; the outer band is full width. */
.da-header,
.da-header.da-surface {
	position: relative;
	gap: 1rem;
	padding: 0.85rem 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
}

.da-brand {
	margin: 0;
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.2;
	min-width: 0;
}

.da-brand a,
.da-header-wrap .da-brand a {
	color: var(--da-chrome-text);
	text-decoration: none;
}

.da-brand a:hover,
.da-header-wrap .da-brand a:hover {
	color: var(--da-link-hover);
}

.da-header-tools {
	gap: 0.25rem;
	flex-shrink: 0;
}

/* Icon + label buttons used by the All Posts and Search blocks. */
.da-iconbtn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin: 0;
	padding: 0.5rem 0.65rem;
	border: 0;
	border-radius: var(--da-radius);
	background: transparent;
	color: inherit;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	white-space: nowrap;
}

.da-iconbtn:hover,
.da-iconbtn[aria-expanded="true"] {
	background: var(--da-highlight);
	color: var(--da-link-hover);
}

.da-iconbtn:focus-visible {
	outline: 2px solid var(--da-link);
	outline-offset: 2px;
}

.da-icon {
	width: 1.25rem;
	height: 1.25rem;
	fill: currentColor;
	flex: none;
}

@media (max-width: 600px) {
	.da-compact-mobile .da-iconbtn__label {
		border: 0;
		clip: rect(1px, 1px, 1px, 1px);
		clip-path: inset(50%);
		height: 1px;
		margin: -1px;
		overflow: hidden;
		padding: 0;
		position: absolute;
		width: 1px;
	}
}

/* ---------- Two-column layout (home, archives, search) ---------- */

.da-main {
	padding-top: var(--da-gap);
	padding-bottom: var(--da-gap);
}

.wp-block-columns.da-layout {
	gap: var(--da-gap);
	align-items: flex-start;
	margin-bottom: 0;
}

.da-main-column,
.da-side-column {
	padding: var(--da-pad);
	min-width: 0;
}

/*
 * Section headings ("Recent posts", "Series").
 * Their look is set in Styles → Blocks → Heading → Section heading.
 * Centered by default; the block's own alignment buttons override this.
 */
:where(.is-style-section) {
	text-align: center;
}

/* Archive / search heading: the term or query is the headline. */
.da-archive-header {
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--da-border);
}

.da-archive-header > * {
	margin-block: 0;
}

.da-archive-header > * + * {
	margin-top: 0.6rem;
}

.da-archive-header .wp-block-term-description p {
	margin: 0;
}

/* ---------- Post cards ---------- */

.da-post-list {
	margin-top: 0;
}

.da-post-list .wp-block-post-template {
	margin: 0;
	padding: 0;
	list-style: none;
}

.da-post-list .wp-block-post-template > li {
	margin: 0;
}

/*
 * Separators between posts. Choose a style on the list's "Post Template"
 * block (Styles panel). Color: the "Post separators" palette swatch.
 */
.wp-block-post-template > li {
	position: relative;
}

/* Line (default), dashed, dotted. */
.da-post-list .wp-block-post-template > li + li,
.wp-block-post-template.is-style-sep-line > li + li {
	border-top: 1px solid var(--da-separator);
}

.wp-block-post-template.is-style-sep-dashed > li + li {
	border-top: 1px dashed var(--da-separator);
}

.wp-block-post-template.is-style-sep-dotted > li + li {
	border-top: 2px dotted var(--da-separator);
}

/* Short centered rule and ornament: no full-width line. */
.wp-block-post-template:is(.is-style-sep-rule, .is-style-sep-ornament, .is-style-sep-cards, .is-style-sep-space) > li + li {
	border-top: 0;
}

.wp-block-post-template.is-style-sep-rule > li + li::before {
	content: "";
	display: block;
	width: 4rem;
	height: 2px;
	margin: 0.5rem auto 0;
	background: var(--da-separator);
	border-radius: 2px;
}

.wp-block-post-template.is-style-sep-ornament > li + li::before {
	content: "\2022\2003\2022\2003\2022";
	display: block;
	margin-top: 0.75rem;
	color: var(--da-separator);
	font-size: 0.875rem;
	line-height: 1;
	text-align: center;
}

/* Cards: each post in its own box. */
.wp-block-post-template.is-style-sep-cards > li {
	padding: 0 clamp(1rem, 2.5vw, 1.5rem);
	border: 1px solid var(--da-separator);
	border-radius: var(--da-radius);
}

.da-post-list .wp-block-post-template.is-style-sep-cards > li + li,
.wp-block-post-template.is-style-sep-cards > li + li {
	margin-top: 1rem;
}

.wp-block-post-template.is-style-sep-cards {
	padding-top: 1.25rem !important;
}

.wp-block-post-template.is-style-sep-cards > li .da-card {
	padding-block: 1.25rem;
}

/* Space only. */
.da-post-list .wp-block-post-template.is-style-sep-space > li + li,
.wp-block-post-template.is-style-sep-space > li + li {
	margin-top: 1.5rem;
}

.da-card {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	padding: 1.75rem 0;
}

.da-card > * {
	margin-block: 0;
}

.da-card-image {
	margin-bottom: 0.6rem !important;
}

.da-card-image img,
.da-article-image img {
	border-radius: var(--da-radius);
}

.da-card-image a {
	display: block;
}

.da-card-title {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.25;
}

.da-card-meta {
	gap: 0.6rem;
	color: var(--da-meta);
	font-size: var(--wp--preset--font-size--small);
}

.da-card-meta > * {
	margin: 0;
}

.da-card-meta > * + *::before {
	content: "·";
	margin-inline-end: 0.6rem;
}

.da-card-terms .wp-block-post-terms__separator {
	color: var(--da-meta);
}

.da-card .wp-block-post-excerpt__excerpt {
	margin: 0;
}

.da-card .wp-block-post-excerpt__more-text {
	margin: 0.6rem 0 0;
	font-size: var(--wp--preset--font-size--small);
}

.da-card .wp-block-post-excerpt__more-link {
	font-weight: 600;
}

/* Variant from the "Post list: image beside text" pattern. */
@media (min-width: 600px) {
	.da-card--horizontal {
		display: grid;
		grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
		column-gap: 1.5rem;
		align-items: start;
	}

	.da-card--horizontal > .da-card-image {
		grid-row: 1 / span 6;
		margin-bottom: 0 !important;
	}

	.da-card--horizontal > :not(.da-card-image) {
		grid-column: 2;
		margin-bottom: 0.45rem;
	}
}

/* Variant from the "Post list: titles only" pattern. */
.da-card--compact {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.25rem 1rem;
	padding: 0.9rem 0;
}

.da-card--compact .da-card-title {
	font-size: var(--wp--preset--font-size--medium);
}

/* Pagination */
.da-post-list .wp-block-query-pagination {
	margin-top: 0.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--da-border);
	gap: 0.75rem;
}

.wp-block-query-pagination a {
	text-decoration: none;
}

.wp-block-query-pagination a:hover {
	text-decoration: underline;
}

.wp-block-query-pagination-numbers .page-numbers {
	display: inline-block;
	min-width: 2em;
	padding: 0.2em 0.4em;
	text-align: center;
	border-radius: var(--da-radius);
}

.wp-block-query-pagination-numbers .page-numbers.current {
	background: var(--da-heading);
	color: var(--da-panel);
}

.wp-block-query-no-results {
	padding-top: 1.25rem;
}

/* ---------- Single post / page ---------- */

.da-article {
	padding: var(--da-pad);
}

.da-article-header {
	margin-bottom: clamp(1.25rem, 3vw, 2.25rem);
}

.da-article-header > * {
	margin-block: 0;
}

.da-article-header > * + * {
	margin-top: 0.75rem;
}

.da-post-title {
	font-size: var(--wp--preset--font-size--xx-large);
	line-height: 1.1;
	text-wrap: balance;
}

.da-article-image {
	margin-bottom: clamp(1.25rem, 3vw, 2.25rem) !important;
}

.da-article-content {
	color: var(--da-text);
}

.da-article-content > p:first-child {
	margin-top: 0;
}

.da-article-content img {
	border-radius: var(--da-radius);
}

.da-article-footer {
	margin-top: clamp(2rem, 5vw, 3.5rem);
}

.da-article-tags {
	font-size: var(--wp--preset--font-size--small);
	text-transform: none !important;
	letter-spacing: 0 !important;
	font-weight: 400 !important;
	color: var(--da-meta);
}

.da-post-nav {
	gap: 1rem;
	padding-block: 1.25rem;
	border-block: 1px solid var(--da-border);
}

.da-post-nav a {
	text-decoration: none;
}

.da-post-nav a:hover {
	text-decoration: underline;
}

.da-post-nav .post-navigation-link-next {
	margin-inline-start: auto;
	text-align: right;
}

/*
 * Per-post "Post layout" options (editor sidebar).
 * Both follow the Content width in Styles → Layout: narrow is 120px less,
 * wide is 240px more.
 */
.da-article {
	--da-content-size: var(--wp--style--global--content-size, 720px);
}

body.da-width-narrow .da-article {
	--wp--style--global--content-size: calc(var(--da-content-size) - 120px);
}

body.da-width-wide .da-article {
	--wp--style--global--content-size: calc(var(--da-content-size) + 240px);
}

body.da-title-centered .da-article-header {
	text-align: center;
}

body.da-title-centered .da-article-header .da-card-meta,
body.da-title-centered .da-article-header .wp-block-post-terms {
	justify-content: center;
}

body.da-title-large .da-post-title {
	font-size: var(--wp--preset--font-size--huge);
	line-height: 1.02;
	letter-spacing: -0.025em;
}

body.da-title-hidden .da-post-title {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
}

/* "Post with hero image" template. */
.da-has-hero {
	padding-top: 0;
	overflow: hidden;
}

.da-hero {
	display: grid;
	margin-inline: calc(var(--da-pad) * -1) !important;
	margin-top: 0 !important;
	margin-bottom: clamp(1.5rem, 4vw, 3rem);
}

.da-hero > * {
	grid-area: 1 / 1;
	margin: 0 !important;
}

.da-hero:has(.da-hero-image) {
	min-height: min(72vh, 680px);
}

.da-hero-image {
	height: 100%;
}

.da-hero-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}

.da-hero-text {
	padding: var(--da-pad) var(--da-pad) 0;
}

.da-hero:has(.da-hero-image) .da-hero-text {
	position: relative;
	z-index: 1;
	align-self: end;
	padding: clamp(4rem, 12vw, 8rem) var(--da-pad) var(--da-pad);
	background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
	color: #fff;
}

.da-hero:has(.da-hero-image) .da-hero-text :is(.da-post-title, .da-card-meta, .da-card-meta *, .da-card-terms, .da-card-terms a) {
	color: #fff;
}

/* ---------- Inputs ---------- */

.da-comments .comment-form input:not([type="submit"]):not([type="checkbox"]),
.da-comments .comment-form textarea,
.wp-block-search__input {
	width: 100%;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--da-border);
	border-radius: var(--da-radius);
	background: var(--da-input);
	color: var(--da-text);
	font: inherit;
}

/* ---------- Comments ---------- */

.da-comments {
	margin-top: 2rem;
}

.da-comment {
	padding-block: 1rem;
	border-bottom: 1px solid var(--da-border);
}

.da-comment > * {
	margin-block: 0.35rem;
}

/* ---------- Footer (full width, at the bottom) ---------- */

.da-footer-wrap {
	margin: 0 !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	background-color: var(--da-chrome);
	border-top: 1px solid var(--da-border);
	color: var(--da-chrome-text);
}

.da-footer,
.da-footer.da-surface {
	padding: var(--da-pad) 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	font-size: var(--wp--preset--font-size--small);
}

.da-footer-columns {
	gap: var(--da-gap);
	margin-bottom: 0;
}

.da-footer-title {
	margin-top: 0;
	margin-bottom: 0.9rem;
	color: var(--da-chrome-text);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
}

.da-footer-title + * {
	margin-top: 0 !important;
}

/* Footer links: Link color, Link hover color. */
.da-footer-wrap a:where(:not(.wp-element-button)) {
	color: var(--da-link);
	text-decoration: none;
}

.da-footer-wrap a:where(:not(.wp-element-button)):hover {
	color: var(--da-link-hover);
	text-decoration: underline;
}

.da-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0;
}

.da-footer-wrap .da-tags a {
	display: inline-block;
	margin: 0 !important;
	padding: 0.3em 0.75em;
	border: 1px solid var(--da-border);
	border-radius: 999px;
	line-height: 1.4;
	text-decoration: none;
}

.da-footer-wrap .da-tags a:hover {
	border-color: var(--da-link-hover);
	text-decoration: none;
}

.da-archives {
	margin: 0;
	padding: 0;
	list-style: none;
}

.da-archives li {
	padding: 0.35rem 0;
	border-bottom: 1px dashed var(--da-border);
	color: var(--da-meta);
}

.da-colophon {
	margin-top: clamp(1.5rem, 4vw, 2.5rem);
	padding-top: 1rem;
	border-top: 1px solid var(--da-border);
	color: var(--da-meta);
	font-size: var(--wp--preset--font-size--x-small);
}

@media (max-width: 781px) {
	.da-footer-columns > .wp-block-column + .wp-block-column {
		padding-top: 1.25rem;
		border-top: 1px solid var(--da-border);
	}
}

/* ---------- Old color class names (version 1.0) ---------- */

.has-base-background-color { background-color: var(--wp--preset--color--page) !important; }
.has-surface-background-color { background-color: var(--wp--preset--color--panel) !important; }
.has-contrast-color { color: var(--wp--preset--color--text) !important; }
.has-muted-color { color: var(--wp--preset--color--meta) !important; }
.has-accent-color { color: var(--wp--preset--color--link) !important; }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
