/**
 * Ársrit Public Stílar
 * Hero, tabs, cards, kaflafletting – mobile-first design
 *
 * @package Arsrit
 */

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

:root {
	--arsrit-hero-height: 620px;
	--arsrit-hero-height-mobile: calc(100svh - 60px);
	--arsrit-hero-overlay: rgba(0, 0, 0, 0.42);
	--arsrit-hero-text: #ffffff;

	--arsrit-tab-bg: #ffffff;
	--arsrit-tab-border: #e2e8f0;
	--arsrit-tab-text: #374151;
	--arsrit-tab-active-text: #1a202c;
	--arsrit-tab-hover-bg: #f3f4f6;
	--arsrit-tab-radius: 999px;

	--arsrit-content-max-width: 1200px;
	--arsrit-content-padding: 2rem;
	--arsrit-content-padding-mobile: 1.25rem;

	--arsrit-card-radius: 8px;
	--arsrit-card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	--arsrit-card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.14);
	--arsrit-card-overlay: rgba(0, 0, 0, 0.35);

	--arsrit-nav-bg: #f8fafc;
	--arsrit-nav-text: #374151;
	--arsrit-nav-hover: #1a202c;
	--arsrit-focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.45);
}

/* ==========================================================================
   Reset
   ========================================================================== */

.arsrit-single,
.arsrit-archive {
	box-sizing: border-box;
}

.arsrit-single *,
.arsrit-single *::before,
.arsrit-single *::after,
.arsrit-archive *,
.arsrit-archive *::before,
.arsrit-archive *::after {
	box-sizing: inherit;
}

/* ==========================================================================
   HERO
   ========================================================================== */

.arsrit-hero {
	position: relative;
	width: 100%;
	min-height: var(--arsrit-hero-height);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background-color: #1a202c;
}

.arsrit-hero--no-image {
	background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
}

.arsrit-hero__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

.arsrit-hero__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to bottom,
		rgba(0, 0, 0, 0.0) 0%,
		rgba(0, 0, 0, 0.10) 20%,
		rgba(0, 0, 0, 0.55) 50%,
		rgba(0, 0, 0, 0.82) 100%
	);
	z-index: 1;
}

/* Textalagið – stækkar til að ýta tabs niður */
.arsrit-hero__content {
	position: relative;
	z-index: 2;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 3rem var(--arsrit-content-padding) 2rem;
	color: var(--arsrit-hero-text);
	text-align: center;
}

/* "SAMBAND SVEITARFÉLAGA Á SUÐURNESJUM" */
.arsrit-hero__org {
	margin: 0 0 1.25rem 0;
	font-size: clamp(0.625rem, 1.2vw, 0.8125rem);
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: #ffffff;
}

/* "Ársrit 2026" – stór serif titill */
.arsrit-hero__year-title {
	margin: 0 0 0.5rem 0;
	font-size: clamp(3rem, 8vw, 6.5rem);
	font-weight: 800;
	line-height: 1.0;
	letter-spacing: -0.02em;
}

/* "Inngangur" – kaflatitill undir */
.arsrit-hero__chapter-title {
	margin: 0.5rem 0 0;
	font-size: clamp(1.25rem, 3vw, 2rem);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #ffffff;
	text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* ==========================================================================
   TABS – neðst á hero, rounded pill stíll
   ========================================================================== */

.arsrit-tabs {
	position: relative;
	z-index: 2;
	width: 100%;
	padding: 1.5rem var(--arsrit-content-padding) 2rem;
	display: flex;
	justify-content: center;
}

/* Einn rounded container utan um alla flipana */
.arsrit-tabs__inner {
	display: inline-flex;
	background: rgba(255, 255, 255, 0.95);
	border-radius: 14px;
	padding: 0.25rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	max-width: calc(100vw - 2 * var(--arsrit-content-padding));
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.arsrit-tabs__inner::-webkit-scrollbar {
	display: none;
}

.arsrit-tabs__list {
	display: flex;
	gap: 5px;
	list-style: none;
	margin: 0;
	padding: 0;
	min-width: max-content;
}

.arsrit-tabs__item {
	flex-shrink: 0;
	margin-bottom: 0px;
}

.arsrit-tabs__link {
	display: inline-flex;
	align-items: center;
	padding: 0.625rem 1.5rem;
	color: #374151;
	font-size: 1rem;
	font-weight: 500;
	text-decoration: none !important;
	border-radius: 10px;
	background: transparent;
	transition: background 0.15s ease, color 0.15s ease;
	white-space: nowrap;
	border: none;
}

.arsrit-tabs__link:hover {
	background: rgba(0, 0, 0, 0.06);
	color: #1a202c;
}

.arsrit-tabs__link--active {
	background: #1a202c;
	color: #ffffff;
	font-weight: 600;
}

.arsrit-tabs__link:focus-visible {
	outline: none;
	box-shadow: var(--arsrit-focus-ring);
}

/* Mobile tabs */
@media (max-width: 640px) {
	.arsrit-hero__content {
		padding: 2rem var(--arsrit-content-padding-mobile) 1.5rem;
	}

	.arsrit-tabs {
		padding: 1rem var(--arsrit-content-padding-mobile) 1.5rem;
	}

	.arsrit-tabs__inner {
		max-width: calc(100vw - 2 * var(--arsrit-content-padding-mobile));
		/* Fade á hægri brún gefur til kynna scroll */
		-webkit-mask-image: linear-gradient(to right, black 80%, transparent 100%);
		mask-image: linear-gradient(to right, black 80%, transparent 100%);
	}

	.arsrit-tabs__link {
		font-size: 1rem;
		padding: 0.625rem 1.25rem;
	}
}

/* ==========================================================================
   EFNI KAFLA
   ========================================================================== */

.arsrit-content {
	padding: var(--arsrit-content-padding) 0 3rem;
}

.arsrit-content__inner {
	max-width: var(--arsrit-content-max-width);
	margin: 0 auto;
	padding: 0 var(--arsrit-content-padding);
}

/* Gutenberg block stílar inni í kafla */
.arsrit-content__inner > * + * {
	margin-top: 1.5rem;
}

/* Gutenberg content fylgir stillingum þema/WordPress */
.arsrit-content__inner .wp-block {
	max-width: var(--wp--style--global--content-size, var(--arsrit-content-max-width));
	max-width: var(--arsrit-content-max-width);
}

.arsrit-content__inner .alignwide {
	max-width: var(--wp--style--global--wide-size, var(--arsrit-content-max-width));
	width: 100%;
}

.arsrit-content__inner .alignfull {
	max-width: 100%;
	width: 100%;
	margin-left: calc(-1 * var(--arsrit-content-padding));
	margin-right: calc(-1 * var(--arsrit-content-padding));
}

.arsrit-content__inner h2 {
	font-size: clamp(1.375rem, 2.5vw, 1.75rem);
	font-weight: 700;
	line-height: 1.25;
	margin-top: 2.5rem;
	margin-bottom: 0.75rem;
}

.arsrit-content__inner h3 {
	font-size: clamp(1.125rem, 2vw, 1.375rem);
	font-weight: 600;
	line-height: 1.3;
	margin-top: 2rem;
	margin-bottom: 0.5rem;
}

.arsrit-content__inner p {
	line-height: 1.75;
}

.arsrit-content__inner img {
	max-width: 100%;
	height: auto;
	border-radius: 6px;
}

/* Mobile efni */
@media (max-width: 640px) {
	.arsrit-content {
		padding: var(--arsrit-content-padding-mobile) 0 2rem;
	}

	.arsrit-content__inner {
		padding: 0 var(--arsrit-content-padding-mobile);
	}
}

/* ==========================================================================
   KAFLAFLETTING (Previous / Next)
   ========================================================================== */

.arsrit-chapter-nav {
	border-top: 1px solid var(--arsrit-tab-border);
	background: var(--arsrit-nav-bg);
	padding: 1.25rem 0;
}

.arsrit-chapter-nav__inner {
	max-width: var(--arsrit-content-max-width);
	margin: 0 auto;
	padding: 0 var(--arsrit-content-padding);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
}

.arsrit-chapter-nav__prev,
.arsrit-chapter-nav__next {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--arsrit-nav-text);
	font-size: 0.9375rem;
	font-weight: 500;
	text-decoration: none;
	padding: 0.5rem 0.75rem;
	border-radius: 6px;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.arsrit-chapter-nav__prev:hover,
.arsrit-chapter-nav__next:hover {
	color: var(--arsrit-nav-hover);
	background: var(--arsrit-tab-border);
}

.arsrit-chapter-nav__prev:focus-visible,
.arsrit-chapter-nav__next:focus-visible {
	outline: none;
	box-shadow: var(--arsrit-focus-ring);
}

.arsrit-chapter-nav__label {
	font-size: 1.1em;
	line-height: 1;
}

.arsrit-chapter-nav__spacer {
	flex: 1;
}

@media (max-width: 640px) {
	.arsrit-chapter-nav__inner {
		padding: 0 var(--arsrit-content-padding-mobile);
		flex-direction: column;
		align-items: stretch;
	}

	.arsrit-chapter-nav__prev,
	.arsrit-chapter-nav__next {
		justify-content: center;
		padding: 0.75rem 1rem;
		border: 1px solid var(--arsrit-tab-border);
		background: white;
	}
}

/* ==========================================================================
   ARCHIVE – Hero
   ========================================================================== */

.arsrit-archive {
	min-height: 60vh;
}

.arsrit-archive__hero {
	position: relative;
	width: 100%;
	height: 420px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #1a202c;
}

.arsrit-archive__hero--no-image {
	background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
}

.arsrit-archive__hero-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

.arsrit-archive__hero-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to bottom,
		rgba(0, 0, 0, 0.0) 0%,
		rgba(0, 0, 0, 0.10) 20%,
		rgba(0, 0, 0, 0.55) 50%,
		rgba(0, 0, 0, 0.82) 100%
	);
	z-index: 1;
}

.arsrit-archive__hero-content {
	position: relative;
	z-index: 2;
	text-align: center;
	color: #ffffff;
	padding: 2rem var(--arsrit-content-padding);
}

.arsrit-archive__hero-subtitle {
	margin: 0 0 0.75rem 0;
	font-size: clamp(0.625rem, 1.2vw, 0.8125rem);
	font-weight: 600;
	letter-spacing: 0.2em;
	color: #ffffff;
}

.arsrit-archive__title {
	margin: 0;
	font-size: clamp(2.5rem, 6vw, 4.5rem);
	font-weight: 800;
	line-height: 1.0;
	letter-spacing: -0.02em;
	color: #ffffff;
}

@media (max-width: 640px) {
	.arsrit-archive__hero {
		height: 300px;
	}

	.arsrit-archive__hero-content {
		padding: 1.5rem var(--arsrit-content-padding-mobile);
	}
}

.arsrit-archive__content {
	padding: 3rem 0 5rem;
}

.arsrit-archive__container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 var(--arsrit-content-padding);
}

.arsrit-archive__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 2rem;
}

/* Card */
.arsrit-card {
	border-radius: var(--arsrit-card-radius);
	overflow: hidden;
	box-shadow: var(--arsrit-card-shadow);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	background: #ffffff;
}

.arsrit-card:hover {
	box-shadow: var(--arsrit-card-shadow-hover);
	transform: translateY(-2px);
}

.arsrit-card__link {
	display: block;
	text-decoration: none;
	color: inherit;
	height: 100%;
}

.arsrit-card__link:focus-visible {
	outline: none;
	box-shadow: var(--arsrit-focus-ring);
	border-radius: var(--arsrit-card-radius);
}

.arsrit-card__image-wrap {
	position: relative;
	padding-top: 62.5%;
	overflow: hidden;
	background: #e2e8f0;
}

.arsrit-card__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	transition: transform 0.3s ease;
}

.arsrit-card:hover .arsrit-card__image {
	transform: scale(1.03);
}

.arsrit-card__image-placeholder {
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
}

.arsrit-card__overlay {
	position: absolute;
	inset: 0;
	background: var(--arsrit-card-overlay);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.arsrit-card:hover .arsrit-card__overlay {
	opacity: 1;
}

.arsrit-card__body {
	padding: 1.25rem 1.5rem;
}

.arsrit-card__title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.25;
	color: #1a202c;
}

/* Archive tómt ástand */
.arsrit-archive__empty {
	text-align: center;
	padding: 4rem 0;
	color: #64748b;
	font-size: 1.1rem;
}

/* Mobile archive */
@media (max-width: 640px) {
	.arsrit-archive__header {
		padding: 2.5rem 0 2rem;
	}

	.arsrit-archive__header-inner {
		padding: 0 var(--arsrit-content-padding-mobile);
	}

	.arsrit-archive__content {
		padding: 2rem 0 3rem;
	}

	.arsrit-archive__container {
		padding: 0 var(--arsrit-content-padding-mobile);
	}

	.arsrit-archive__grid {
		grid-template-columns: 1fr;
		gap: 1.25rem;
	}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.arsrit-card,
	.arsrit-card__image,
	.arsrit-card__overlay,
	.arsrit-tabs__link,
	.arsrit-chapter-nav__prev,
	.arsrit-chapter-nav__next {
		transition: none !important;
	}
}

/* ==========================================================================
   GUTENBERG – Headings
   ========================================================================== */

.arsrit-heading-1 {
	display: inline-block;
	position: relative;
	color: #203F52 !important;
	font-size: clamp(2.75rem, 6vw, 6rem);
	font-weight: 900;
	line-height: 0.9;
	letter-spacing: -0.07em;
	margin-bottom: 2.5rem;
	z-index: 1;
}

.arsrit-heading-1::before {
	content: "";
	position: absolute;
	left: -0.12em;
	bottom: 0.02em;
	width: 105%;
	height: 0.32em;
	background: linear-gradient(
		90deg,
		rgba(255, 69, 0, 0.28),
		rgba(255, 69, 0, 0.05)
	);
	border-radius: 999px;
	z-index: -1;
}


.arsrit-heading-2 {
	position: relative;
	color: #203F52;
	font-size: clamp(2rem, 4vw, 4.5rem);
	font-weight: 850;
	line-height: 1;
	letter-spacing: -0.05em;
	margin: 0 0 2.5rem;
	padding-left: 2rem;
}

.arsrit-heading-2::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.1em;
	width: 7px;
	height: 0.85em;
	background: #FF4500;
	border-radius: 999px;
}

.arsrit-heading-2::after {
	content: "";
	position: absolute;
	left: 2rem;
	bottom: -0.5rem;
	width: 140px;
	height: 2px;
	background: linear-gradient(
		90deg,
		#FF4500,
		rgba(255, 69, 0, 0)
	);
}

.arsrit-heading-3 {
	display: inline-block;
	position: relative;
	background: #203F52;
	color: #fff !important;
	font-size: clamp(2.5rem, 6vw, 6rem);
	font-weight: 900;
	line-height: 1;
	letter-spacing: -0.06em;
	padding: 0.25em 0.55em 0.35em;
	margin: 0 0 2rem !important;
}

.arsrit-heading-3::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -18px;
	width: 100%;
	height: 10px;
	background: #FF4500;
}

.arsrit-heading-4 {
  color: #fff !important;
  font-weight: 700;
  background: #203F52;
  display: inline-block;
  padding: 0.2em 0.6em;
  border-left: 6px solid #FF4500;
  border-radius: 0 4px 4px 0;
}
