/* Department page layout — built on tokens.css custom properties.
   Applies only to .atfal-dept (page-department.php), loaded on
   /department/{slug}/ pages only. */

.atfal-dept {
	color: var(--color-grey-700);
	font-family: var(--font-body);
	background: var(--color-warm-white);
}
.atfal-dept h1,
.atfal-dept h2,
.atfal-dept h3 {
	color: var(--color-ink);
}
.atfal-dept a {
	color: inherit;
}
.atfal-dept img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* Fallback (no data entry yet): reuse the theme's normal content width so
   the raw WPBakery output still reads sanely rather than full-bleed. */
.atfal-dept--fallback .ad-body {
	max-width: var(--container-max);
	margin: 0 auto;
	padding: var(--space-7) var(--space-5);
}

/* Hero */
.ad-hero {
	position: relative;
	background: linear-gradient(160deg, #1a1a1a 0%, var(--color-ink) 55%, #0d0d0d 100%);
	color: var(--color-white);
	overflow: hidden;
}
.ad-hero__grid-pattern {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
	background-size: 56px 56px;
	-webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, #000 40%, transparent 100%);
	mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, #000 40%, transparent 100%);
	pointer-events: none;
}
.ad-hero__inner {
	position: relative;
	max-width: var(--container-max);
	margin: 0 auto;
	padding: var(--space-8) var(--space-5) var(--space-7);
}

/* Large faint department icon, top-right of the hero — balances the
   right-side whitespace left by the text column on wide screens instead of
   just further shrinking the readable line length. */
.ad-hero__watermark {
	position: absolute;
	top: -40px;
	right: 3%;
	font-size: 320px;
	line-height: 1;
	color: rgba(255,255,255,0.035);
	pointer-events: none;
	z-index: 0;
	transform: rotate(-8deg);
}
@media (max-width: 1100px) {
	.ad-hero__watermark { font-size: 220px; right: -20px; }
}
@media (max-width: 768px) {
	/* !important required: Font Awesome's own base rule sets
	   `display: inline-block` on `.fas` at the same specificity as this
	   class selector, and it's enqueued after this stylesheet — without
	   !important that later same-specificity rule wins the tie and the
	   icon stays visible regardless of this media query matching. */
	.ad-hero__watermark { display: none !important; }
}
.ad-hero__badge {
	display: inline-flex;
	align-items: center;
	font-size: var(--text-xs);
	font-weight: var(--weight-semibold);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--color-grey-100);
	background: rgba(255,255,255,0.06);
	border: 1px solid rgba(255,255,255,0.14);
	padding: var(--space-2) var(--space-4);
	border-radius: 999px;
	margin-bottom: var(--space-4);
}
.atfal-dept .ad-hero__title {
	font-size: var(--text-h1);
	font-weight: var(--weight-heavy);
	letter-spacing: -0.02em;
	line-height: var(--leading-tight);
	color: var(--color-white);
	margin: 0 0 var(--space-3);
}
.ad-hero__desc {
	font-size: var(--text-lg);
	line-height: var(--leading-relaxed);
	color: var(--color-grey-200);
	max-width: 640px;
	margin: 0 0 var(--space-6);
}

/* Department quick-switcher */
.ad-switcher {
	position: relative;
	margin: 0 calc(var(--space-5) * -1) calc(var(--space-2) * -1);
	padding-top: var(--space-5);
}
.ad-switcher__scroll {
	display: flex;
	gap: var(--space-2);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-behavior: smooth;
	padding: var(--space-1) var(--space-5) var(--space-3);
	/* Hide the native scrollbar cross-browser; scrolling itself stays fully active. */
	scrollbar-width: none;
	-ms-overflow-style: none;
	-webkit-overflow-scrolling: touch;
	/* Fade the rightmost ~48px so the row visibly hints it keeps scrolling. */
	-webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent 100%);
	mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent 100%);
}
.ad-switcher__scroll::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}
.ad-switcher__pill {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
	color: var(--color-grey-200);
	background: rgba(255,255,255,0.06);
	border: 1px solid rgba(255,255,255,0.1);
	padding: var(--space-2) var(--space-4);
	border-radius: 999px;
	white-space: nowrap;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.ad-switcher__pill i {
	font-size: 0.8rem;
	opacity: 0.8;
}
.ad-switcher__pill:hover,
.ad-switcher__pill:focus-visible {
	background: rgba(255,255,255,0.12);
	border-color: rgba(255,255,255,0.25);
	color: var(--color-white);
}
.ad-switcher__pill--active,
.ad-switcher__pill--active:hover,
.ad-switcher__pill--active:focus-visible {
	background: var(--color-red);
	border-color: var(--color-red);
	color: var(--color-white);
}

/* Body / grid */
.ad-body {
	max-width: var(--container-max);
	margin: 0 auto;
	padding: var(--space-7) var(--space-5) var(--space-8);
}
.ad-grid {
	display: grid;
	grid-template-columns: 4fr 8fr;
	gap: var(--space-6);
	align-items: start;
}

/* Secretary card */
.ad-card {
	background: var(--color-white);
	border: 1px solid var(--color-grey-200);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-md);
	padding: var(--space-6);
}
.ad-sidebar-sticky {
	position: sticky;
	top: var(--space-5);
	display: flex;
	flex-direction: column;
	gap: var(--space-5);
}
.ad-secretary-card {
	text-align: center;
}
.ad-secretary-card__photo {
	width: 112px;
	height: 112px;
	margin: 0 auto var(--space-4);
	border-radius: 50%;
	overflow: hidden;
	border: 3px solid var(--color-red-tint);
}
.ad-secretary-card__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.ad-secretary-card__name {
	font-size: var(--text-h3);
	font-weight: var(--weight-bold);
	color: var(--color-ink);
}
.ad-secretary-card__title {
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
	color: var(--color-red);
	margin-top: var(--space-1);
	margin-bottom: var(--space-5);
}
.ad-secretary-card__actions {
	display: flex;
	gap: var(--space-3);
	justify-content: center;
	margin-bottom: var(--space-5);
}
.ad-pill {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	padding: var(--space-2) var(--space-4);
	border-radius: 999px;
	background: var(--color-red-tint);
	color: var(--color-red-deep);
	font-size: var(--text-sm);
	font-weight: var(--weight-semibold);
	transition: background-color 0.15s ease, color 0.15s ease;
}
.ad-pill:hover,
.ad-pill:focus-visible {
	background: var(--color-red);
	color: var(--color-white);
}
.ad-secretary-card__note {
	font-size: var(--text-sm);
	color: var(--color-grey-600);
	line-height: var(--leading-normal);
	margin: 0 0 var(--space-5);
}
.ad-secretary-card__note a {
	color: var(--color-red);
	font-weight: var(--weight-semibold);
	text-decoration: underline;
}
.ad-secretary-card__facts {
	list-style: none;
	margin: 0;
	padding: var(--space-4) 0 0;
	border-top: 1px solid var(--color-grey-100);
	text-align: left;
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
}
.ad-secretary-card__facts li {
	font-size: var(--text-sm);
	color: var(--color-grey-700);
}

/* Annual plan */
.ad-plan__title {
	font-size: var(--text-h2);
	font-weight: var(--weight-bold);
	margin: 0 0 var(--space-5);
	padding-left: var(--space-4);
	border-left: 4px solid var(--color-red);
}
.ad-plan__title--responsibilities {
	margin-top: var(--space-7);
}
.ad-plan__empty {
	font-size: var(--text-base);
	color: var(--color-grey-600);
	font-style: italic;
	padding: var(--space-5);
	background: var(--color-grey-100);
	border-radius: var(--radius-md);
}
.ad-plan__group-label {
	font-size: var(--text-xs);
	font-weight: var(--weight-bold);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--color-grey-600);
	margin: var(--space-6) 0 var(--space-3);
	padding-top: var(--space-5);
	border-top: 1px solid var(--color-grey-100);
}
.ad-plan__group-label:first-child {
	margin-top: 0;
	padding-top: 0;
	border-top: none;
}
.ad-plan__grid {
	display: grid;
	gap: var(--space-3);
	margin-bottom: var(--space-2);
}
.ad-plan-item {
	display: flex;
	align-items: flex-start;
	gap: var(--space-3);
	background: var(--color-white);
	border: 1px solid var(--color-grey-100);
	border-radius: var(--radius-md);
	padding: var(--space-4);
	box-shadow: var(--shadow-sm);
}
.ad-plan-item__icon {
	color: var(--color-grey-300);
	font-size: 1rem;
	margin-top: 2px;
	flex-shrink: 0;
}
.ad-plan-item__text {
	flex: 1;
	font-size: var(--text-sm);
	color: var(--color-grey-700);
	line-height: var(--leading-normal);
}
.ad-plan-item__due {
	flex-shrink: 0;
	font-size: var(--text-xs);
	font-weight: var(--weight-bold);
	color: var(--color-grey-700);
	background: var(--color-grey-100);
	border: 1px solid var(--color-grey-200);
	padding: var(--space-1) var(--space-3);
	border-radius: 999px;
	white-space: nowrap;
}
.ad-plan-item__due--urgent {
	color: var(--color-red-deep);
	background: var(--color-red-tint);
	border-color: transparent;
}

/* Key Responsibilities — sidebar card */
.ad-responsibilities-card {
	padding: var(--space-6) var(--space-5);
}
.ad-responsibilities-card__title {
	font-size: var(--text-h3);
	font-weight: var(--weight-bold);
	margin: 0 0 var(--space-4);
}
.ad-responsibilities {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
}
.ad-responsibilities li {
	display: flex;
	align-items: flex-start;
	gap: var(--space-3);
	font-size: var(--text-xs);
	color: var(--color-grey-700);
	line-height: var(--leading-relaxed);
}
.ad-responsibilities__icon {
	flex-shrink: 0;
	margin-top: 0.15em;
	font-size: 0.85rem;
	color: var(--color-red);
}

/* "Show All Responsibilities" accordion — native <details>, no JS required */
.ad-responsibilities-more {
	margin-top: var(--space-4);
	padding-top: var(--space-4);
	border-top: 1px solid var(--color-grey-100);
}
.ad-responsibilities-more > ul {
	margin-top: var(--space-4);
}
.ad-responsibilities-more__toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2);
	cursor: pointer;
	list-style: none;
	font-size: var(--text-xs);
	font-weight: var(--weight-semibold);
	color: var(--color-red);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	user-select: none;
}
.ad-responsibilities-more__toggle::-webkit-details-marker {
	display: none;
}
.ad-responsibilities-more__toggle:hover,
.ad-responsibilities-more__toggle:focus-visible {
	color: var(--color-red-deep);
}
.ad-responsibilities-more__toggle i {
	font-size: 0.7rem;
	transition: transform 0.15s ease;
}
.ad-responsibilities-more__label-open { display: none; }
.ad-responsibilities-more[open] .ad-responsibilities-more__label-closed { display: none; }
.ad-responsibilities-more[open] .ad-responsibilities-more__label-open { display: inline; }
.ad-responsibilities-more[open] .ad-responsibilities-more__toggle i {
	transform: rotate(180deg);
}
@media (prefers-reduced-motion: reduce) {
	.ad-responsibilities-more__toggle i { transition: none; }
}

/* Resources */
.ad-resources {
	margin-top: var(--space-8);
}
.ad-resources__title {
	font-size: var(--text-h2);
	font-weight: var(--weight-bold);
	text-align: center;
	margin: 0 0 var(--space-6);
	position: relative;
	padding-bottom: var(--space-3);
}
.ad-resources__title::after {
	content: "";
	display: block;
	width: 64px;
	height: 3px;
	background: var(--color-red);
	margin: var(--space-3) auto 0;
}
.ad-resources__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--space-5);
}
.ad-resource-card {
	display: flex;
	flex-direction: column;
	background: var(--color-white);
	border: 1px solid var(--color-grey-100);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
	padding: var(--space-5);
	text-decoration: none;
	transition: box-shadow 0.2s ease-out, transform 0.2s ease-out;
}
.ad-resource-card:hover,
.ad-resource-card:focus-visible {
	box-shadow: var(--shadow-lg);
	transform: translateY(-4px);
}
.ad-resource-card__title {
	font-size: var(--text-base);
	font-weight: var(--weight-bold);
	color: var(--color-ink);
	margin-bottom: var(--space-2);
}
.ad-resource-card__desc {
	font-size: var(--text-sm);
	color: var(--color-grey-600);
	line-height: var(--leading-normal);
	margin-bottom: var(--space-3);
	flex: 1;
}
.ad-resource-card__cta {
	font-size: var(--text-xs);
	font-weight: var(--weight-semibold);
	color: var(--color-red);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}
.ad-resource-card__cta span {
	display: inline-block;
	transition: transform 0.15s ease;
}
.ad-resource-card:hover .ad-resource-card__cta span,
.ad-resource-card:focus-visible .ad-resource-card__cta span {
	transform: translateX(3px);
}

/* Explore Other Departments */
.ad-explore {
	margin-top: var(--space-8);
}
.ad-explore__grid {
	display: grid;
	/* 4 columns: 11 real departments fill two complete rows of 4 plus a
	   3-wide last row (only one gap short of full) — a much smaller,
	   less noticeable remainder than 5 columns left (a single card
	   stranded alone on its own row), so no special last-row centering
	   hack is needed here. */
	grid-template-columns: repeat(4, 1fr);
	gap: var(--space-6);
	/* Every implicit row track sizes to its own tallest card (the grid
	   default) — combined with align-items: stretch below, this is what
	   keeps cards in the same row equal height, with no fixed/percentage
	   height guessing that could clip a longer tagline. */
	grid-auto-rows: auto;
	align-items: stretch;
}
.ad-explore-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	text-align: center;
	gap: var(--space-3);
	/* No height/min-height here: a percentage height against this grid's
	   auto-sized rows is what caused the overlap bug (content could grow
	   past a fixed box without the row itself growing to fit it). Letting
	   the card size to its own content, then stretching to match its row
	   via align-items: stretch above, keeps rows correctly spaced no
	   matter how long a given tagline is. */
	background: var(--color-white);
	border: 1px solid rgba(228,225,222,0.8);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
	padding: var(--space-5);
	text-decoration: none;
	cursor: pointer;
	transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.ad-explore-card:hover,
.ad-explore-card:focus-visible {
	box-shadow: var(--shadow-lg);
	transform: translateY(-4px);
	border-color: #f87171;
}
.ad-explore-card__top {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-2);
}
.atfal-dept i.ad-explore-card__icon {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin-bottom: var(--space-1);
	border-radius: var(--radius-md);
	background: var(--color-red-tint);
	color: var(--color-red);
	font-size: 1.4rem;
	line-height: 1;
	transition: background-color 0.2s ease, color 0.2s ease;
}
.ad-explore-card:hover i.ad-explore-card__icon,
.ad-explore-card:focus-visible i.ad-explore-card__icon {
	background-image: linear-gradient(0deg, var(--color-red-deep), var(--color-red));
	color: var(--color-white);
}
.ad-explore-card__title {
	font-size: var(--text-sm);
	font-weight: var(--weight-bold);
	color: var(--color-ink);
}
.ad-explore-card__tagline {
	font-size: var(--text-sm);
	color: var(--color-grey-700);
	line-height: var(--leading-normal);
}
.ad-explore-card__arrow {
	position: absolute;
	top: var(--space-4);
	right: var(--space-4);
	font-size: var(--text-xs);
	color: var(--color-red);
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity 0.15s ease, transform 0.15s ease;
}
.ad-explore-card:hover .ad-explore-card__arrow,
.ad-explore-card:focus-visible .ad-explore-card__arrow {
	opacity: 1;
	transform: translateY(0);
}

.atfal-dept a:focus-visible,
.atfal-dept button:focus-visible {
	outline: none;
	box-shadow: var(--focus-ring);
}

/* Responsive */
@media (max-width: 900px) {
	.ad-grid { grid-template-columns: 1fr; }
	.ad-sidebar-sticky { position: static; margin-bottom: var(--space-2); }
	.ad-resources__grid { grid-template-columns: repeat(2, 1fr); }
	.ad-explore__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
	.ad-hero__inner { padding: var(--space-6) var(--space-4) var(--space-5); }
	.ad-switcher { margin: 0 calc(var(--space-4) * -1) calc(var(--space-2) * -1); }
	.ad-switcher__scroll { padding: 0 var(--space-4) var(--space-2); }
	.ad-body { padding: var(--space-5) var(--space-4) var(--space-7); }
	.ad-resources__grid { grid-template-columns: 1fr; }
	.ad-explore__grid { grid-template-columns: repeat(2, 1fr); }
	.ad-plan-item { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 420px) {
	.ad-explore__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	.ad-pill,
	.ad-resource-card,
	.ad-resource-card__cta span,
	.ad-switcher__pill,
	.ad-explore-card,
	.ad-explore-card__icon,
	.ad-explore-card__arrow {
		transition: none;
	}
	.ad-switcher__scroll {
		scroll-behavior: auto;
	}
}
