/*
 Theme Name:   Scoil Chiaráin Child
 Theme URI:    https://scoilchiarain.ie
 Description:  Child theme for Scoil Chiaráin based on parent theme.
 Author:       Scoil Chiaráin
 Author URI:   https://scoilchiarain.ie
 Template:     twentytwentyfour
 Version:      1.0.0
 Text Domain:  scoil-chiarain
*/

:root {
	--forest: #f9f9f9;
	--forest-dark: #f9f9f9;
	--sun: #f2c230;
	--meadow: #eaf1e6;
	--ink: #17231d;
	--muted: #55645b;
	--line: #d5e0d3;
	--font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	font: 400 1.125rem/1.7 var(--font);
	color: var(--ink);
	background: #fff;
}

img {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--forest);
}

.container {
	width: min(1440px, 100% - 2.5rem);
	margin-inline: auto;
}

:focus-visible {
	outline: 3px solid var(--sun);
	outline-offset: 2px;
	box-shadow: 0 0 0 5px var(--forest-dark);
}

.skip-link {
	position: absolute;
	left: 1rem;
	top: -5rem;
	z-index: 300;
	background: var(--sun);
	color: var(--ink);
	padding: .6rem 1rem;
	font-weight: 700;
}

.skip-link:focus {
	top: 1rem;
}

/* ---------- Header ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 200;
	background: #fff;
	border-bottom: 1px solid var(--line);
}

.topbar {
    background: #f9f9f9;
    color: #555555;
    font-size: 1rem;
}

.topbar .container {
	display: flex;
	flex-wrap: wrap;
	gap: .25rem 1.75rem;
	padding: .4rem 0;
	justify-content: space-between;
}

.topbar a {
	color: #333;
	text-decoration: none;
}

.topbar a:hover {

	color: #1a4d2e;
}

.mainbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: .7rem 0;
}

.brand {
	display: block;
	text-decoration: none;
	color: var(--forest);

	padding-top: .8rem;
}

.brand strong {
	display: block;
	font-size: 1.55rem;
	line-height: 1.1;
}

.brand small {
	display: block;
	font-size: .85rem;
	color: var(--muted);
}

.nav-toggle {
	font: 700 1rem var(--font);
	background: #143426;
	color: #fff;
	border: 0;
	border-radius: 6px;
	padding: .6rem 1rem;
	cursor: pointer;
}

#primary-nav {
	display: none;
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	background: #fff;
	border-bottom: 1px solid var(--line);
	max-height: calc(100vh - 7rem);
	overflow: auto;
	padding: .5rem 1.25rem 1.25rem;
}

#primary-nav.is-open {
	display: block;
}

.menu, .submenu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.menu a {
	display: flex;
	align-items: center;
	padding: .65rem .5rem;
	color: var(--ink);
	text-decoration: none;
	font-weight: 700;
}

.submenu a {
	font-weight: 400;
	padding-left: 1.5rem;
	color: var(--muted);
}

.menu a:hover {
	color: #153426;
	text-decoration: underline;
}

.menu .cta a {
	background: var(--sun);
	color: var(--ink);
	border-radius: 6px;
	text-align: center;
	margin-top: .75rem;
}

.menu .cta a:hover {
	text-decoration: none;
	background: #e6b51e;
}

/* Caret Icon Styling for Menu Items */
.desktop-caret {
	display: inline-block;
	width: 10px;
	height: 10px;
	margin-left: 6px;
	fill: currentColor;
	transition: transform 0.2s ease;
}

@media (min-width:1000px) {
	.nav-toggle {
		display: none;
	}

	#primary-nav {
		display: block;
		position: static;
		border: 0;
		padding: 0;
		overflow: visible;
		max-height: none;
	}

	.menu {
		display: flex;
		align-items: center;
		gap: .15rem;
	}

	.menu > li {
		position: relative;
	}

	.menu > li > a {
		padding: .6rem .75rem;
		border-bottom: 3px solid transparent;
	}

/* AFTER - Only show yellow underline on hover for links without submenus */
.menu > li:not(.has-sub):hover > a, 
.menu > li:not(.has-sub):focus-within > a {
	border-bottom-color: var(--sun);
	text-decoration: none;
}

/* Ensure links with submenus keep a transparent bottom border on hover */
.menu > li.has-sub:hover > a, 
.menu > li.has-sub:focus-within > a {
	border-bottom-color: transparent;
	text-decoration: none;
}
	/* Rotate caret on hover on desktop */
	.menu > li:hover > a .desktop-caret {
		transform: rotate(180deg);
	}

	.submenu {
		position: absolute;
		left: 0;
		top: 100%;
		min-width: 16rem;
		background: #fff;
		border: 1px solid var(--line);
		border-top: 3px solid var(--sun);
		padding: .4rem 0;
		opacity: 0;
		visibility: hidden;
		transform: translateY(4px);
		transition: opacity .15s, transform .15s;
	}

	.menu li:hover > .submenu, 
	.menu li:focus-within > .submenu {
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.submenu a {
		padding: .5rem 1rem;
		color: var(--ink);
	}

	.submenu a:hover {
		background: var(--meadow);
		text-decoration: none;
	}

	.menu .cta a {
		margin: 0 0 0 .5rem;
		padding: .6rem 1.2rem;
	}

	/* Hide mobile-only button on desktop */
	.submenu-toggle {
		display: none !important;
	}
}

/* ---------- Page template ---------- */
.page-hero {
	background: var(--forest);
	color: var(--ink);
	padding: 2.25rem 0 2.75rem;
}

.page-hero h1 {
	margin: .4rem 0 0;
	font-size: clamp(2rem, 4.5vw, 3rem);
	line-height: 1.15;
}

.breadcrumbs ol {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: .4rem;
	margin: 0;
	padding: 0;
	font-size: .95rem;
}

.breadcrumbs li + li::before {
	content: "/";
	margin-right: .4rem;
	opacity: .6;
}

.breadcrumbs a {
	color: #161616;
}

.page-layout {
	display: grid;
	gap: 2.5rem;
	padding: 2.5rem 0 4rem;
}

@media (min-width:1000px) {
	.page-layout {
		grid-template-columns: minmax(0, 1fr) 300px;
		gap: 4rem;
	}
}



.entry-content h2 {
	font-size: 1.7rem;
	line-height: 1.25;
	margin: 2.25rem 0 .5rem;
}

.entry-content h3 {
	font-size: 1.3rem;
	margin: 1.75rem 0 .4rem;
}

.entry-content p, .entry-content ul, .entry-content ol {
	margin: 0 0 1.1rem;
}

.entry-content li {
	margin-bottom: .35rem;
}

.entry-content blockquote {
	margin: 1.5rem 0;
	padding: .25rem 0 .25rem 1.25rem;
	border-left: 4px solid var(--sun);
	color: var(--muted);
}

.entry-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.5rem 0;
}

.entry-content th, .entry-content td {
	text-align: left;
	padding: .6rem .75rem;
	border-bottom: 1px solid var(--line);
}

.entry-content th {
	background: var(--meadow);
}

.button, .wp-block-button__link {
	display: inline-block;
	background: #143426;
	color: #fff;
	padding: .75rem 1.4rem;
	border-radius: 6px;
	font-weight: 700;
	text-decoration: none;
}

.button:hover {
	background: #246146;
}

.sidebar .widget {
	border-left: 4px solid var(--sun);
	padding: .25rem 0 .25rem 1.25rem;
	margin-bottom: 2rem;
}

.widget h2 {
	font-size: 1.15rem;
	margin: 0 0 .5rem;
}

.widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.widget li a {
	display: block;
	padding: .4rem 0;
	text-decoration: none;
	border-bottom: 1px solid #ddd;
	color: #143426;
}

.widget li a:hover {
	text-decoration: underline;
}

.widget .current a {
	font-weight: 700;
}

/* ---------- Footer ---------- */
.site-footer {
	background: var(--forest-dark);
	color: #333;
	border-top: 6px solid var(--sun);
	font-size: 1rem;
}

.site-footer a {
	color: #153426;
}

.site-footer a:hover {
	color: var(--sun);
}

.footer-grid {
	display: grid;
	gap: 2.5rem;
	padding: 3.5rem 0 2.5rem;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.footer-brand strong {
	display: block;
	color: #153426;
	font-size: 2rem;
	line-height: 1.1;
	margin-bottom: .75rem;
}

.site-footer h2 {
	color: #153426;
	font-size: 1.1rem;
	margin: 0 0 .75rem;
}

.site-footer ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-footer li {
	margin: .4rem 0;
}

.site-footer address {
	font-style: normal;
	margin-bottom: .75rem;
}

.footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, .18);
	padding: 1rem 0;
	font-size: .9rem;
}

.footer-bottom .container {
	display: flex;
	flex-wrap: wrap;
	gap: .4rem 2rem;
	justify-content: space-between;
}

@media (prefers-reduced-motion:reduce) {
	* {
		transition: none !important;
	}
}

/* ---------- Mobile Submenu Accordion Styles ---------- */
@media (max-width: 999px) {
	/* Hide desktop-embedded caret on mobile, use toggle button caret instead */
	.desktop-caret {
		display: none;
	}

	.menu > .has-sub {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		width: 100%;
	}

	.menu > .has-sub > a {
		flex: 1;
	}

	.has-sub .submenu {
		display: none;
		width: 100%;
		padding-left: 1rem;
		margin-top: 0.25rem;
	}

	.has-sub.is-dropdown-open > .submenu {
		display: block;
	}

	.submenu-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		background: transparent;
		border: none;
		padding: 0.65rem;
		cursor: pointer;
		color: var(--ink);
	}

	.submenu-toggle svg {
		width: 12px;
		height: 12px;
		fill: currentColor;
		transition: transform 0.25s ease;
	}

	.has-sub.is-dropdown-open > .submenu-toggle svg {
		transform: rotate(180deg);
	}
}

/* ---------- 4-Column Gallery Grid Layout ---------- */
.gallery-section {
  margin-bottom: 3rem;
}

.gallery-section h2 {
  font-size: 1.8rem;
  margin-bottom: 1.25rem;
  border-bottom: 3px solid var(--sun);
  padding-bottom: 0.4rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.25rem;
}

@media (min-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .hb img{
    width:300px;
}
}
@media (max-width: 900px) {
    .hb{
        gap:0!important;
    }
}

.gallery-item {
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--meadow);
}

.gallery-item img {
  width: 100%;
  height: 350px;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.gallery-item img:hover {
  transform: scale(1.04);
}

/* ---------- Active Menu Item Highlighting ---------- */

/* Highlight active child page link in dropdown */
.submenu .current-menu-item > a {
  background-color: var(--meadow);
  color: #153426!important;
  font-weight: 700;
}

/* ---------- Footer Navigation List Fix ---------- */
.site-footer nav ul {
  display: block !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.site-footer nav li {
  display: block !important;
  margin: 0.4rem 0 !important;
  padding: 0 !important;
  border: none !important;
}

.site-footer nav a {
  display: inline-block !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  color: #153426 !important;
  font-weight: 400 !important;
  text-decoration: underline !important;
}

.site-footer nav a:hover {
  color: var(--sun) !important;
}

/* ---------- Home Full-Width Splide Slider ---------- */
.home-hero-slider {
  width: 100%;
  position: relative;
  overflow: hidden;
}

.home-hero-slider .splide__slide {
  position: relative;
  height: 520px;
}

@media (max-width: 768px) {
  .home-hero-slider .splide__slide {
    height: 400px;
  }
}

.slide-background {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: center;
}

.slide-overlay {
  position: absolute;
  inset: 0;
  /*background: linear-gradient(180deg, rgba(31, 75, 55, 0.4) 0%, rgba(21, 52, 38, 0.75) 100%); */
  z-index: 1;
}

.slide-content {
  position: relative;
  z-index: 2;
  color: #fff;
  max-width: 800px;
}

.slide-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.8rem;
  color: #fff;
}

.slide-subtitle {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: #e6efe8;
}

.slide-button {
  background: var(--sun) !important;
  color: var(--ink) !important;
  font-size: 1.1rem;
  padding: 0.8rem 1.75rem;
}

.slide-button:hover {
  background: #e6b51e !important;
}

/* Custom Splide Controls Styling */
.splide__arrow {
  background: rgba(255, 255, 255, 0.8) !important;
  opacity: 1 !important;
}

.splide__arrow:hover {
  background: var(--sun) !important;
}

.splide__pagination__page.is-active {
  background: var(--sun) !important;
  transform: scale(1.3);
}

.home-html-content {
  padding: 3.5rem 0;
}
.hb{
    display:flex;
    gap:30px;
    flex-wrap:wrap;
}


/* ---------- Sticky Section Sidebar (Desktop Only) ---------- */
@media (min-width: 1000px) {
  /* Ensure parent container allows sticky positioning along the grid column */
  .page-layout {
    align-items: start;
  }

  /* Make sidebar widget sticky */
  .sidebar {
    position: sticky;
    top: 13rem; /* Offsets below the sticky site header */
    height: fit-content;
  }
}

/* School policies table: the whole table is one CSS grid.
   Two columns on desktop, stacked (title above date) on mobile. */
.policy-table{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 12rem;width:100%;margin:1.5rem 0;font-size:1.05rem}
.policy-table thead,
.policy-table tbody,
.policy-table tr{display:contents}
.policy-table caption{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

.policy-table th,
.policy-table td{padding:.8rem 1rem;text-align:left;border-bottom:1px solid var(--line,#d5e0d3)}
.policy-table th{background:#1f4b37;color:#fff;font-weight:700;border-bottom:0}
.policy-table tbody tr:nth-child(even) td{background:#f6f9f5}
.policy-table tbody tr:hover td{background:var(--meadow,#eaf1e6)}
.policy-table td a{font-weight:700;text-decoration:none;color:#1f4b37!important;}
.policy-table td a:hover{text-decoration:underline}
.policy-table time{color:var(--muted,#55645b)}

@media (max-width:640px){
  .policy-table{grid-template-columns:1fr}
  /* header row is hidden visually but stays available to screen readers */
  .policy-table th{position:absolute;width:1px;height:1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0)}
  .policy-table td:first-child{padding-bottom:.1rem;border-bottom:0}
  .policy-table td:last-child{padding-top:0;font-size:.92rem}
}

/* Child safeguarding risk assessment table.
   Each row is its own CSS grid: 3 columns on desktop, a stacked labelled card on mobile. */
.risk-table{
  --cols:minmax(0,.85fr) minmax(0,.85fr) minmax(0,1.5fr);
  position:relative;display:block;width:100%;margin:1.5rem 0;font-size:1rem;
}
.risk-table caption{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.risk-table thead,
.risk-table tbody{display:block}
.risk-table tr{display:grid;grid-template-columns:var(--cols)}

.risk-table th,
.risk-table td{padding:.9rem 1rem;text-align:left;vertical-align:top;border-bottom:1px solid var(--line,#d5e0d3)}
.risk-table thead th{background:var(--forest,#1f4b37);color:#fff;font-weight:700;border-bottom:0}
.risk-table tbody th{background:var(--meadow,#eaf1e6);font-weight:700}
.risk-table p{margin:0 0 .4rem}
.risk-table ul{margin:0;padding-left:1.1rem}
.risk-table li{margin:0 0 .4rem}
.risk-table th ul{margin-top:.25rem;font-weight:400}
.risk-table :is(p,li):last-child{margin-bottom:0}

/* Let the table use the full content width, and pair it with a page that has no sidebar */
.entry-content:has(.risk-table){max-width:none}

.risk-note{max-width:68ch;margin:2rem 0}
.signoff{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:2.5rem;margin:3rem 0 2rem}
.sign-line{display:grid;grid-template-columns:auto minmax(0,1fr) auto 7rem;gap:.5rem;align-items:end}
.sign-line i{display:block;height:1.6rem;border-bottom:1px solid var(--ink,#17231d)}
.signoff p{margin:.4rem 0 0;font-weight:700}

@media (max-width:899px){
  /* header row stays available to screen readers, hidden visually */
  .risk-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .risk-table tr{grid-template-columns:1fr;margin-bottom:1.25rem;border:1px solid var(--line,#d5e0d3);border-top:4px solid var(--forest,#1f4b37)}
  .risk-table th,
  .risk-table td{border-bottom:0}
  .risk-table td{padding-top:.6rem;padding-bottom:.6rem}
  .risk-table td::before{content:attr(data-label);display:block;margin-bottom:.25rem;font-weight:700;color:var(--forest,#1f4b37)}
  .sign-line{grid-template-columns:auto minmax(0,1fr) auto 5rem}
}

/* ---------- 404 page ---------- */
.error-page {
    padding: 3.5rem 0 4.5rem;
    text-align: center;
}
.error-page .container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 1.5rem;
}
.error-code {
    font-weight: 700;
    font-size: clamp(3.5rem, 12vw, 5rem);
    line-height: 1;
    color: #1a4d2e; /* Primary Forest Green */
    margin: 0 0 0.5rem 0;
}
.error-page h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin: 0.5rem 0 1rem;
    color: #222222;
}
.error-page p {
    color: #555555;
    max-width: 48ch;
    margin: 0 auto 1.5rem;
    line-height: 1.5;
}

/* Actions & Buttons */
.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    justify-content: center;
    margin: 1.75rem 0 2.5rem;
}
.error-actions .button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #1a4d2e;
    color: #ffffff !important;
    border: 2px solid #1a4d2e;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: 700;
    transition: all 0.2s ease;
}
.error-actions .button:hover {
    background: #123620;
    border-color: #123620;
}
.error-actions .button.secondary {
    background: #ffffff;
    color: #1a4d2e !important;
    border: 2px solid #1a4d2e;
}
.error-actions .button.secondary:hover {
    background: #e8f3ec;
}

/* Search Form */
.error-search {
    display: flex;
    gap: 0.5rem;
    max-width: 26rem;
    margin: 0 auto 2.5rem;
}
.error-search input[type="search"] {
    flex: 1;
    padding: 0.7rem 0.9rem;
    border: 2px solid #dddddd;
    border-radius: 6px;
    font: inherit;
    outline: none;
}
.error-search input[type="search"]:focus {
    border-color: #1a4d2e;
}
.error-search button {
    background: #1a4d2e;
    color: #ffffff;
    border: 0;
    border-radius: 6px;
    padding: 0.7rem 1.1rem;
    font-weight: 700;
    cursor: pointer;
}
.error-search button:hover {
    background: #123620;
}

/* Popular Links Grid */
.error-links {
    text-align: left;
    border-top: 1px solid #e5e5e5;
    padding-top: 2rem;
}
.error-links h2 {
    font-size: 1.1rem;
    margin: 0 0 1rem;
    color: #222222;
}
.error-links ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.error-links li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}
.error-links a {
    display: block;
    padding: 0.6rem 0.9rem;
    border: 1px solid #dddddd;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: 700;
    color: #1a4d2e !important;
    transition: background 0.2s ease;
}
.error-links a:hover {
    background: #e8f3ec;
    border-color: #1a4d2e;
}

/* Topbar Icon Spacing */
.topbar a i {
    margin-right: 6px;
}