/* Ireland Wide theme styles. Tokens come from theme.json (var(--wp--preset--...)). */

:root {
	--iw-bog: var(--wp--preset--color--bog);
	--iw-moss: var(--wp--preset--color--moss);
	--iw-ink: var(--wp--preset--color--ink);
	--iw-slate: var(--wp--preset--color--slate);
	--iw-line: var(--wp--preset--color--line);
	--iw-gorse: var(--wp--preset--color--gorse);
	--iw-mist: var(--wp--preset--color--mist);
	--iw-paper: var(--wp--preset--color--paper);
	--iw-on-green-link: #F6E3A1;
	--iw-on-green-muted: #B9C8BB;
	--iw-sans: var(--wp--preset--font-family--public-sans);
	--iw-serif: var(--wp--preset--font-family--literata);
	--iw-radius: 6px;
}

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { height: auto; }
:where(a, button, input, select, summary):focus-visible { outline: 3px solid var(--iw-gorse); outline-offset: 2px; }
.skip-link:focus { background: var(--iw-paper); color: var(--iw-ink); }

/* ---------- Header (sticky) ---------- */
/* The header template part sticks to the top of the window while the page scrolls.
   No transform, filter or backdrop-filter here: those would break the mobile menu overlay. */
.wp-site-blocks > header.wp-block-template-part,
header.wp-block-template-part:has(> .iw-header) {
	position: -webkit-sticky;
	position: sticky;
	top: 0;
	z-index: 100;
	transition: box-shadow 0.2s ease;
}
/* Logged in: sit under the WordPress admin bar (fixed above 600px wide only). */
.admin-bar .wp-site-blocks > header.wp-block-template-part,
.admin-bar header.wp-block-template-part:has(> .iw-header) { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) {
	.admin-bar .wp-site-blocks > header.wp-block-template-part,
	.admin-bar header.wp-block-template-part:has(> .iw-header) { top: 0; }
}
.iw-scrolled .wp-site-blocks > header.wp-block-template-part { box-shadow: 0 2px 14px rgba(22, 32, 26, 0.22); }
/* Anchor links (tables of contents, #faq) land below the header, not under it. */
html { scroll-padding-top: calc(var(--iw-header-h, 70px) + 1rem); }
.admin-bar { scroll-padding-top: calc(var(--iw-header-h, 70px) + var(--wp-admin--admin-bar--height, 32px) + 1rem); }
.iw-header { position: relative; z-index: 20; }
.iw-header__inner { gap: 1.5rem; }
.iw-logo img, .iw-logo .custom-logo { display: block; width: auto; max-height: 40px; }
.iw-header__nav { gap: 1rem; }
.iw-nav a { color: var(--iw-mist); text-decoration: none; }
.iw-nav a:hover, .iw-nav .current-menu-item > a { color: var(--iw-paper); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.iw-nav .iw-nav__cta > a { color: var(--iw-on-green-link); }
.iw-search .wp-block-search__button { background: transparent; color: var(--iw-mist); border: 0; padding: 0.4rem; }
.iw-search .wp-block-search__button svg { fill: currentColor; width: 1.4rem; height: 1.4rem; }
.iw-search .wp-block-search__input { font-family: var(--iw-sans); border-radius: var(--iw-radius); border: 1px solid var(--iw-line); }
.wp-block-navigation__responsive-container.is-menu-open { padding: 1.5rem; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { font-size: 1.25rem; }
@media (max-width: 781px) {
	.iw-logo img, .iw-logo .custom-logo { max-height: 30px; }
}

/* ---------- Shared pieces ---------- */
.iw-new {
	display: inline-block; font-family: var(--iw-sans); font-size: 0.75rem; font-weight: 700; line-height: 1;
	padding: 0.25rem 0.45rem; border-radius: 3px; background: var(--iw-gorse); color: var(--iw-ink); vertical-align: 0.1em;
}
.iw-section { margin-top: var(--wp--preset--spacing--50); }
.iw-section__title { margin: 0 0 1.5rem; font-size: var(--wp--preset--font-size--large); }
.iw-breadcrumbs { font-family: var(--iw-sans); font-size: 0.875rem; color: var(--iw-slate); margin-bottom: 1rem; }
.iw-breadcrumbs a { color: var(--iw-slate); }
.iw-breadcrumbs a:hover { color: var(--iw-bog); }
.iw-topic-label { margin: 0 0 0.5rem; font-family: var(--iw-sans); font-size: 0.875rem; font-weight: 650; }
.iw-topic-label a { color: var(--iw-moss); text-decoration: none; }

/* ---------- Hero ---------- */
.iw-hero { margin-top: 0; }
.iw-hero__cols { align-items: stretch; }
.iw-hero__title { color: var(--iw-paper); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; max-width: 16ch; margin: 0 0 1.25rem; }
.iw-hero__lede { color: var(--iw-mist); max-width: 60ch; line-height: 1.6; }
.iw-hero__trust { color: var(--iw-on-green-muted); font-family: var(--iw-sans); font-size: 0.9375rem; }
.iw-hero a { color: var(--iw-on-green-link); }
.iw-hero__actions { margin-top: 1.75rem; gap: 0.75rem; }
.is-style-iw-gorse .wp-block-button__link { background: var(--iw-gorse); color: var(--iw-ink) !important; }
.is-style-iw-gorse .wp-block-button__link:hover { background: #F2CB55; }
.is-style-iw-ghost .wp-block-button__link { background: transparent; color: var(--iw-mist) !important; box-shadow: inset 0 0 0 1.5px var(--iw-on-green-muted); }
.is-style-iw-ghost .wp-block-button__link:hover { background: rgba(255, 255, 255, 0.08); }

.iw-hero__news { border-left: 1px solid rgba(228, 235, 227, 0.22); padding-left: var(--wp--preset--spacing--40); }
.iw-hero__news-title { font-size: var(--wp--preset--font-size--medium); margin: 0 0 0.75rem; }
.iw-hero__news-title a { color: var(--iw-paper) !important; text-decoration: none; }
.iw-news-list { list-style: none; margin: 0; padding: 0; }
.iw-news-list__item { padding: 0.85rem 0; border-top: 1px solid rgba(228, 235, 227, 0.16); }
.iw-news-list__item:first-child { border-top: 0; padding-top: 0.25rem; }
.iw-news-list__meta { margin: 0 0 0.2rem; font-family: var(--iw-sans); font-size: 0.8125rem; color: var(--iw-on-green-muted); }
.iw-news-list__title { color: var(--iw-paper) !important; text-decoration: none; font-weight: 550; line-height: 1.35; display: block; }
.iw-news-list__title:hover { text-decoration: underline; text-underline-offset: 3px; }
.iw-hero__news-more { font-family: var(--iw-sans); font-size: 0.9375rem; font-weight: 600; margin-top: 1rem; }
@media (max-width: 781px) {
	.iw-hero__news { border-left: 0; padding-left: 0; border-top: 1px solid rgba(228, 235, 227, 0.22); padding-top: 1.5rem; }
}

/* ---------- Cards ---------- */
.iw-card { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.iw-card__media { display: block; overflow: hidden; border-radius: var(--iw-radius); background: var(--iw-line); aspect-ratio: 3 / 2; }
.iw-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.iw-card__body > * { margin: 0; }
.iw-card__topic { font-family: var(--iw-sans); font-size: 0.8125rem; font-weight: 650; margin-bottom: 0.3rem !important; }
.iw-card__topic a { color: var(--iw-moss); text-decoration: none; }
.iw-card__title { font-size: 1.125rem; line-height: 1.3; font-weight: 600; letter-spacing: -0.005em; }
.iw-card__title a { color: var(--iw-ink); text-decoration: none; }
.iw-card__title a:hover { color: var(--iw-moss); text-decoration: underline; text-underline-offset: 3px; }
.iw-card__excerpt { color: var(--iw-slate); margin-top: 0.5rem !important; font-size: 1rem; line-height: 1.6; }
.iw-card__meta { font-family: var(--iw-sans); font-size: 0.8125rem; color: var(--iw-slate); margin-top: 0.45rem !important; }

.iw-card--feature .iw-card__title { font-size: var(--wp--preset--font-size--large); line-height: 1.2; }
.iw-card--compact { flex-direction: row; gap: 1rem; align-items: flex-start; }
.iw-card--compact .iw-card__media { flex: 0 0 112px; aspect-ratio: 1 / 1; }
.iw-card--compact .iw-card__title { font-size: 1.0625rem; }

.iw-grid { display: grid; gap: 2rem 1.5rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1080px) { .iw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .iw-grid { grid-template-columns: 1fr; } }

/* Latest: one lead story, then a quieter list beside it. */
.iw-latest { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.iw-latest__rest { display: grid; gap: 1.25rem; }
.iw-latest__rest .iw-card + .iw-card { padding-top: 1.25rem; border-top: 1px solid var(--iw-line); }
@media (max-width: 900px) { .iw-latest { grid-template-columns: 1fr; } }

/* ---------- Topic rows ---------- */
.iw-topic + .iw-topic { margin-top: var(--wp--preset--spacing--50); }
.iw-topic__head { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 2rem; align-items: end; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 2px solid var(--iw-moss); }
.iw-topic__title { margin: 0; grid-column: 1; font-size: var(--wp--preset--font-size--large); }
.iw-topic__title a { color: var(--iw-ink); text-decoration: none; }
.iw-topic__intro { margin: 0; grid-column: 1; color: var(--iw-slate); font-size: 1rem; max-width: 62ch; }
.iw-topic__all { grid-column: 2; grid-row: 1 / span 2; font-family: var(--iw-sans); font-size: 0.9375rem; font-weight: 600; white-space: nowrap; }
@media (max-width: 640px) {
	.iw-topic__head { grid-template-columns: 1fr; }
	.iw-topic__all { grid-column: 1; grid-row: auto; margin-top: 0.5rem; }
}

/* ---------- Hubs ---------- */
.iw-hubs__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.75rem 2rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.iw-hubs__list li { padding-top: 1rem; border-top: 3px solid var(--iw-moss); }
.iw-hubs__list a { display: block; font-size: 1.25rem; font-weight: 650; color: var(--iw-ink); text-decoration: none; line-height: 1.25; }
.iw-hubs__list a:hover { color: var(--iw-moss); text-decoration: underline; text-underline-offset: 4px; }
.iw-hubs__list span { display: block; margin-top: 0.35rem; color: var(--iw-slate); font-size: 1rem; line-height: 1.55; }
@media (max-width: 900px) { .iw-hubs__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .iw-hubs__list { grid-template-columns: 1fr; } }

/* ---------- Seasonal ---------- */
.iw-seasonal { background: var(--iw-paper); border-radius: var(--iw-radius); padding: var(--wp--preset--spacing--40); border-left: 6px solid var(--iw-gorse); }
.iw-seasonal__title { margin: 0 0 1.5rem; font-size: var(--wp--preset--font-size--large); }

/* ---------- Trust ---------- */
.iw-trust { border-radius: var(--iw-radius); }
.iw-trust h2 { margin-top: 0; }
.iw-trust__links ul { list-style: none; padding: 0; margin: 0; }
.iw-trust__links li { padding: 0.8rem 0; border-top: 1px solid var(--iw-line); font-family: var(--iw-sans); font-weight: 600; }
.iw-trust__links li:first-child { border-top: 0; }

/* ---------- Single post ---------- */
.iw-single__title { font-size: var(--wp--preset--font-size--x-large); letter-spacing: -0.015em; margin: 0 0 1rem; }
.iw-byline { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; font-family: var(--iw-sans); font-size: 0.875rem; color: var(--iw-slate); margin: 0; }
.iw-byline a { color: var(--iw-ink); font-weight: 600; }
.iw-single__image { margin-top: var(--wp--preset--spacing--40) !important; }
.iw-single__image img { border-radius: var(--iw-radius); }
.iw-single__image .iw-single__credit { margin: 0.5rem 0 0; font-family: var(--iw-sans); font-size: var(--wp--preset--font-size--small); color: var(--iw-slate); text-align: left; }
.iw-content { margin-top: var(--wp--preset--spacing--40); }
.iw-content > * + * { margin-block-start: 1.25rem; }
.iw-content h2 { margin-top: 2.75rem; }
.iw-content h3 { margin-top: 2rem; }
.iw-content li + li { margin-top: 0.35rem; }
.iw-content img { border-radius: var(--iw-radius); }
.iw-content a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.iw-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.iw-content table { border-collapse: collapse; width: 100%; min-width: 520px; background: var(--iw-paper); }
.iw-content th, .iw-content td { border: 1px solid var(--iw-line); padding: 0.65rem 0.75rem; text-align: left; vertical-align: top; }
.iw-content thead th { background: var(--iw-bog); color: var(--iw-paper); }
.iw-content tbody tr:nth-child(even) td { background: #F6F7F3; }
.is-style-iw-note { background: var(--iw-paper); border-left: 4px solid var(--iw-moss); padding: 1.25rem 1.5rem; border-radius: var(--iw-radius); }
.iw-single__foot { margin-top: var(--wp--preset--spacing--50); }
.iw-tags { font-family: var(--iw-sans); font-size: 0.875rem; color: var(--iw-slate); }
.iw-author { display: flex; gap: 1.25rem; align-items: flex-start; margin-top: 2rem; padding-top: 1.5rem; border-top: 2px solid var(--iw-moss); }
.iw-author__avatar img { border-radius: 50%; display: block; }
.iw-author__text > * { margin: 0; }
.iw-author__name { font-weight: 650; font-size: 1.125rem; }
.iw-author__bio { margin-top: 0.4rem !important; color: var(--iw-slate); }
.iw-author__links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin-top: 0.75rem !important; font-family: var(--iw-sans); font-size: 0.875rem; font-weight: 600; }
.iw-related { margin-top: var(--wp--preset--spacing--50); }
.iw-related h2 { margin-bottom: 1.5rem; }
.iw-related__all { font-family: var(--iw-sans); font-weight: 600; margin-top: 1.5rem; }

/* ---------- Pages, archives, search ---------- */
.iw-page__title { font-size: var(--wp--preset--font-size--x-large); }
.iw-archive__title { font-size: var(--wp--preset--font-size--x-large); margin: 0 0 0.75rem; }
.iw-archive__intro { max-width: 70ch; color: var(--iw-slate); }
.iw-archive__head { margin-bottom: var(--wp--preset--spacing--40); }
.iw-grid--archive .iw-card--feature { grid-column: span 2; grid-row: span 2; }
@media (max-width: 560px) { .iw-grid--archive .iw-card--feature { grid-column: auto; } }
.iw-subtopics ul { list-style: none; margin: 1.25rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.iw-subtopics a { display: inline-block; font-family: var(--iw-sans); font-size: 0.875rem; font-weight: 600; padding: 0.4rem 0.75rem; border: 1px solid var(--iw-line); border-radius: 999px; background: var(--iw-paper); color: var(--iw-ink); text-decoration: none; }
.iw-subtopics a:hover { border-color: var(--iw-moss); color: var(--iw-moss); }
.iw-subtopics span { color: var(--iw-slate); font-weight: 500; margin-left: 0.25rem; }
.pagination, .navigation.pagination { margin-top: var(--wp--preset--spacing--40); font-family: var(--iw-sans); }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pagination .page-numbers { padding: 0.45rem 0.8rem; border: 1px solid var(--iw-line); border-radius: var(--iw-radius); text-decoration: none; color: var(--iw-ink); background: var(--iw-paper); }
.pagination .page-numbers.current { background: var(--iw-bog); color: var(--iw-paper); border-color: var(--iw-bog); }
.iw-search-page .wp-block-search__input { border-radius: var(--iw-radius); border: 1px solid var(--iw-line); padding: 0.7rem 0.9rem; font-family: var(--iw-sans); }
.iw-404__links { font-family: var(--iw-sans); font-weight: 600; }

/* ---------- Content + right sidebar ---------- */
/* Two columns on desktop (content left, sidebar right); the sidebar stacks under the content below 960px. */
.iw-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wp--preset--spacing--50);
	align-items: start;
}
@media (min-width: 960px) {
	.iw-layout {
		grid-template-columns: minmax(0, 1fr) 300px;
		column-gap: clamp(2.5rem, 4vw, 4rem);
	}
}
/* Inside the main column, "content" and "wide" both mean the full column width,
   so text, the featured image and wide blocks line up with each other. */
.iw-layout__main {
	--wp--style--global--content-size: 100%;
	--wp--style--global--wide-size: 100%;
	min-width: 0;
	margin: 0 !important;
	max-width: none !important;
}
@media (min-width: 960px) {
	.iw-single .iw-layout__main, .iw-page .iw-layout__main { max-width: 48rem !important; }
}
.iw-layout__main .alignfull,
.iw-layout__main .alignwide { max-width: 100% !important; margin-left: 0 !important; margin-right: 0 !important; width: auto; }
.iw-layout__main .iw-castle-map-embed { max-width: 100%; }
.iw-layout__side { min-width: 0; margin: 0 !important; }
.iw-layout > * { margin-block-start: 0 !important; }

/* Archive grids are narrower beside the sidebar: three across, then two, then one. */
.iw-layout .iw-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1180px) { .iw-layout .iw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .iw-layout .iw-grid { grid-template-columns: 1fr; } }

/* Sidebar widgets (standard widget markup: section.widget > h2.widget-title). */
.iw-sidebar { font-family: var(--iw-sans); font-size: 0.9375rem; line-height: 1.5; }
.iw-sidebar__inner { display: grid; gap: 1.5rem; }
.iw-sidebar .widget { background: var(--iw-paper); border-radius: var(--iw-radius); padding: 1.25rem; margin: 0; }
.iw-sidebar .widget > :first-child { margin-top: 0; }
.iw-sidebar .widget > :last-child { margin-bottom: 0; }
.iw-sidebar .widget-title,
.iw-sidebar .widget .wp-block-heading {
	font-family: var(--iw-sans); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
	color: var(--iw-bog); margin: 0 0 0.85rem; padding-bottom: 0.6rem; border-bottom: 2px solid var(--iw-moss);
}
.iw-sidebar ul { list-style: none; margin: 0; padding: 0; }
.iw-sidebar li { padding: 0.55rem 0; border-top: 1px solid var(--iw-line); }
.iw-sidebar li:first-child { border-top: 0; padding-top: 0; }
.iw-sidebar li:last-child { padding-bottom: 0; }
.iw-sidebar a { color: var(--iw-ink); text-decoration: none; font-weight: 550; }
.iw-sidebar a:hover { color: var(--iw-moss); text-decoration: underline; text-underline-offset: 3px; }
.iw-sidebar time, .iw-sidebar .post-date, .iw-sidebar .wp-block-latest-posts__post-date { display: block; margin-top: 0.15rem; font-size: 0.8125rem; color: var(--iw-slate); font-weight: 400; }
.iw-sidebar .widget_search, .iw-sidebar .widget_block:has(.wp-block-search) { padding: 0; background: none; }
.iw-sidebar .search-form, .iw-sidebar .wp-block-search__inside-wrapper { display: flex; gap: 0.5rem; }
.iw-sidebar .search-form label { flex: 1; }
.iw-sidebar .search-field, .iw-sidebar .wp-block-search__input {
	width: 100%; font-family: var(--iw-sans); font-size: 0.9375rem; padding: 0.65rem 0.8rem;
	border: 1px solid var(--iw-line); border-radius: var(--iw-radius); background: var(--iw-paper);
}
.iw-sidebar .search-submit, .iw-sidebar .wp-block-search__button {
	font-family: var(--iw-sans); font-weight: 600; font-size: 0.875rem; padding: 0.65rem 0.95rem; border: 0;
	border-radius: var(--iw-radius); background: var(--iw-moss); color: var(--iw-paper); cursor: pointer;
}
.iw-sidebar .search-submit:hover, .iw-sidebar .wp-block-search__button:hover { background: var(--iw-bog); }
.iw-side-posts li { display: flex; gap: 0.75rem; align-items: flex-start; }
.iw-side-posts__img { flex: 0 0 64px; }
.iw-side-posts__img img { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; display: block; }
.iw-side-posts span { min-width: 0; line-height: 1.35; }
.iw-widget-plan { background: var(--iw-bog) !important; color: var(--iw-mist); border-left: 5px solid var(--iw-gorse); }
.iw-side-cta > * { margin: 0; }
.iw-side-cta__title { font-family: var(--iw-serif); font-size: 1.1875rem; font-weight: 650; color: var(--iw-paper); line-height: 1.25; }
.iw-side-cta p + p { margin-top: 0.5rem; }
.iw-side-cta__link { margin-top: 0.9rem !important; }
.iw-side-cta__link a { display: inline-block; background: var(--iw-gorse); color: var(--iw-ink) !important; padding: 0.55rem 1rem; border-radius: var(--iw-radius); font-weight: 650; }
.iw-side-cta__link a:hover { background: #F2CB55; text-decoration: none !important; }
@media (max-width: 959px) {
	.iw-layout__side { padding-top: var(--wp--preset--spacing--40); border-top: 1px solid var(--iw-line); }
}

/* ---------- Footer ---------- */
.iw-footer a { color: var(--iw-mist); text-decoration: none; }
.iw-footer a:hover { color: var(--iw-paper); text-decoration: underline; text-underline-offset: 4px; }
.iw-footer__about { color: var(--iw-on-green-muted); font-size: 0.9375rem; max-width: 46ch; margin-top: 1.25rem; }
.iw-footer__heading { color: var(--iw-paper); font-family: var(--iw-sans); font-size: 0.9375rem; font-weight: 650; letter-spacing: 0; margin: 0 0 0.75rem; }
.iw-footer__links { list-style: none; padding: 0; margin: 0; font-family: var(--iw-sans); font-size: 0.9375rem; }
.iw-footer__links li + li { margin-top: 0.5rem; }
.iw-footer__legal { margin-top: var(--wp--preset--spacing--40); padding-top: 1.25rem; border-top: 1px solid rgba(228, 235, 227, 0.18); font-family: var(--iw-sans); font-size: 0.8125rem; color: var(--iw-on-green-muted); }

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

/* Castle map embed: give it the wide column so its controls fit. */
.iw-castle-map-embed { max-width: var(--wp--style--global--wide-size, 1240px); }
.iw-castle-map-embed #iw-castle-map-app { margin-left: 0; margin-right: 0; }
