/* =========================================================================
   Contact page design layer

   Adapts the Claude Design comp to the existing custom blocks rather than
   replacing them, so the page stays editable in Gutenberg. Only the
   submissions section is new markup (see inc/iola-contact.php).

   Comp colours mapped to the Kadence palette so the page tracks the site:
     comp #98291f accent  -> --global-palette1 (#088ccb), the site's brand blue
     comp #1b1b1a ink     -> --global-palette3 (#232424)
     comp #f7f5f1 paper   -> --global-palette7
     comp #e2ddd3 rule    -> --global-palette8
   The comp's crimson is deliberately not carried over; the masthead rule is
   the only red on the site and the buttons are blue.
   ========================================================================= */

.iola-submit,
.page .iola-contact-office-facts,
.page .iola-contact-routing,
.page .iola-writers-grid__inner {
	/* Site blue, not the comp's crimson: the accent tracks the Kadence palette
	   so the page follows the Customizer instead of pinning a second colour.
	   These two values drive every accent on the page. */
	--ic-accent: var(--global-palette1, #088ccb);
	--ic-accent-dark: #0a6ba3;
	--ic-paper: #f7f5f1;
	--ic-ink: var(--global-palette3, #232424);
	--ic-body: var(--global-palette4, #333);
	--ic-muted: var(--global-palette6, #777);
	--ic-rule: var(--global-palette8, #dedede);
	--ic-card: var(--global-palette9, #fff);
	--ic-wash: var(--global-palette7, #fcfcfc);
}

/* --- Section heading with trailing hairline (comp's cu-secthead) ---------- */
.iola-submit__head {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 18px;
}

.iola-submit__head h2 {
	margin: 0;
	white-space: nowrap;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-size: clamp(20px, 2.2vw, 26px);
	line-height: 1.1;
}

.iola-submit__head::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--ic-rule);
}

/* --- Submission cards ----------------------------------------------------- */

/* The shortcode renders a bare <section>, and the surrounding constrained
   block layout did not rein it in -- it ran full-bleed while the heading and
   lede above stayed centred, and the card row spilled past the viewport.
   Constrain it to the site content width explicitly, same value the rest of
   the page uses, so it lines up with the blocks above and below. */
.iola-submit {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--global-calc-content-width, 1290px);
	/* Top margin matters here: the intro block's trailing link used to provide
	   the separation, and removing it left the heading tight against the lede. */
	margin: 3.5rem auto 56px;
	padding: 0 var(--global-content-edge-padding, 1.5rem);
	background: transparent;
}

.iola-submit *,
.iola-submit *::before,
.iola-submit *::after {
	box-sizing: border-box;
}

.iola-submit__actions {
	display: grid;
	/* min() stops a track from forcing horizontal overflow when the viewport
	   is narrower than the 232px minimum. */
	/* Exactly three across, as the comp lays it out. auto-fit was giving four
	   at this content width (1242px fits 4x280 + gaps), so the count is fixed
	   rather than derived. minmax(0,1fr) lets tracks shrink below their
	   content width instead of forcing horizontal overflow. */
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
}

.iola-submit__action {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 18px 18px 20px;
	background: var(--ic-card);
	border: 1px solid var(--ic-rule);
	border-left: 4px solid var(--ic-accent);
	color: var(--ic-ink);
	text-decoration: none;
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.iola-submit__action:hover,
.iola-submit__action:focus-visible {
	border-color: var(--ic-accent);
	box-shadow: 0 6px 20px rgba(27, 27, 26, .09);
	transform: translateY(-2px);
	color: var(--ic-ink);
	text-decoration: none;
}

.iola-submit__action b {
	/* Serif, like the comp and like the site's headings. */
	font-family: var(--global-heading-font-family, Georgia, 'Times New Roman', serif);
	font-size: 21px;
	font-weight: 600;
	line-height: 1.25;
}

.iola-submit__action span {
	font-size: 15px;
	line-height: 1.4;
	color: var(--ic-muted);
}

/* --- Announcement strip --------------------------------------------------- */
.iola-submit__announce {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 28px;
	margin-top: 14px;
	padding: 20px;
	background: var(--ic-card);
	border: 1px solid var(--ic-rule);
	border-top: 3px solid var(--ic-ink);
}

.iola-submit__announce-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 200px;
}

.iola-submit__announce-text b {
	font-family: var(--global-heading-font-family, Georgia, 'Times New Roman', serif);
	font-size: 21px;
	font-weight: 600;
}
.iola-submit__announce-text span { font-size: 15px; color: var(--ic-muted); }

.iola-submit__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.iola-submit__chip {
	padding: 9px 15px;
	border: 1px solid var(--ic-rule);
	font-size: 15px;
	font-weight: 600;
	color: var(--ic-ink);
	text-decoration: none;
	transition: background .15s, border-color .15s, color .15s;
}

@supports (color: color-mix(in srgb, red 50%, black)) {
	.iola-submit {
		--ic-accent-dark: color-mix(in srgb, var(--ic-accent) 82%, #000);
	}
}

.iola-submit__chip:hover,
.iola-submit__chip:focus-visible {
	background: var(--ic-accent-dark, var(--ic-accent));
	border-color: var(--ic-accent);
	color: #fff;
	text-decoration: none;
}

/* --- Office facts: the comp's "Visit or call" panel -----------------------
   Markup is a core group > constrained inner > 4 core columns, each an
   <h4 class="iola-contact-fact__label"> plus a <p> of links.

   The dark fill was on the OUTER group, which is full-width, while the
   content sits in the constrained inner -- so it painted edge to edge with a
   lot of dead space. Moving the fill onto the inner container makes it a
   contained panel like the comp.
   -------------------------------------------------------------------------- */
.page .iola-contact-office-facts {
	background: transparent;
	padding: 0;
	margin-block: 2.5rem;
}

.page .iola-contact-office-facts > .wp-block-group__inner-container {
	max-width: var(--global-calc-content-width, 1290px);
	margin-inline: auto;
	padding: 30px 32px 32px;
	background: var(--ic-ink);
	color: var(--ic-paper, #f7f5f1);
}

/* Labels: small, tracked-out caps in a muted grey, as in the comp. */
.page .iola-contact-office-facts .iola-contact-fact__label {
	margin: 0 0 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: #a8a29a;
	border: 0;
	padding: 0;
}

/* Values: serif and considerably larger -- these are the details people came
   for, and they were previously set smaller than the labels above them. */
.page .iola-contact-office-facts p {
	margin: 0;
	font-family: var(--global-heading-font-family, Georgia, 'Times New Roman', serif);
	font-size: 21px;
	line-height: 1.4;
	color: var(--ic-paper, #f7f5f1);
}

/* The phone number is the primary action in this panel. */
.page .iola-contact-office-facts .wp-block-column:nth-child(3) p {
	font-size: 25px;
}

/* Email addresses are long; keep them readable rather than oversized. */
.page .iola-contact-office-facts .wp-block-column:nth-child(4) p {
	font-size: 16px;
	line-height: 1.65;
	word-break: break-word;
}

/* No underlines -- every value in this panel was a link, so the whole block
   read as underlined text. Underline appears on hover instead. */
.page .iola-contact-office-facts a {
	color: inherit;
	text-decoration: none;
	border-bottom: 0;
}

.page .iola-contact-office-facts a:hover,
.page .iola-contact-office-facts a:focus-visible {
	color: #fff;
	text-decoration: underline;
	text-underline-offset: .15em;
}

.page .iola-contact-office-facts a:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

@media (max-width: 900px) {
	.page .iola-contact-office-facts > .wp-block-group__inner-container {
		padding: 24px;
	}
	.page .iola-contact-office-facts p { font-size: 19px; }
	.page .iola-contact-office-facts .wp-block-column:nth-child(3) p { font-size: 22px; }
}

/* --- Routing cards: accent edge + lift ------------------------------------ */
.page .iola-contact-routing__card {
	background: var(--ic-card);
	border: 1px solid var(--ic-rule);
	border-left: 4px solid var(--ic-accent);
	padding: 18px 20px 20px;
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.page .iola-contact-routing__card:hover {
	border-color: var(--ic-accent);
	box-shadow: 0 6px 20px rgba(27, 27, 26, .09);
	transform: translateY(-2px);
}

/* --- Staff: role in accent caps, ruled department headings ---------------- */
.page .iola-writers-grid__inner > h2 {
	padding-bottom: 8px;
	margin-bottom: 18px;
	border-bottom: 2px solid var(--ic-ink);
}

.page .iola-writers-grid__role {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--ic-accent);
}

.page .iola-writers-grid__item {
	/* Deliberately NOT restyled as a bordered card. The block's own look --
	   vertical, centred, circular avatar, hairline dividers between items --
	   is the one being kept; only the portrait size changes below. */
}

/* Larger portraits. The block ships 5rem; these are 11rem, with the source
   image upgraded from the 150px 'thumbnail' in inc/iola-contact.php so the
   bigger size is not an upscale. */
.page .iola-writers-grid__image {
	width: 11rem;
	height: 11rem;
}

/* Department heading ("NEWSROOM"). Two fixes:

   1. Size -- the block sets this at meta size, smaller than the names beneath
      it, so it read as a label rather than the section heading it is.
   2. Font -- the block asks for var(--iola-font-ui), but none of the
      --iola-font-* variables are defined on this site, so it silently fell
      back to the body font while "Submit to the Register" and "Send us a
      message" (plain <h2>s) used Kadence's heading font. Match those. */
.page .iola-writers-grid__title {
	font-family: var(--global-heading-font-family, Georgia, 'Times New Roman', serif);
	font-size: clamp(20px, 2.2vw, 26px);
	letter-spacing: .06em;
	color: var(--ic-ink);
}

/* Names sit under the portraits, so they carry the card. */
.page .iola-writers-grid__name {
	font-size: clamp(19px, 1.6vw, 23px);
}

@media (max-width: 900px) {
	.page .iola-writers-grid__image {
		width: 9rem;
		height: 9rem;
	}
}

@media (max-width: 767px) {
	.page .iola-writers-grid__image {
		width: 8rem;
		height: 8rem;
	}
}

.page .iola-writers-grid__email {
	word-break: break-word;
}

@media (max-width: 900px) {
	.iola-submit__actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
	.iola-submit__actions { grid-template-columns: 1fr; }
	.iola-submit__action b { font-size: 19px; }
	.iola-submit__head h2 { white-space: normal; }
}

/* --- Two-column "Send us a message" / "Visit or call" ----------------------
   The office-facts panel now sits inside the right-hand column of the contact
   row (see the restructure of page 161). Its four core columns have to stack
   there -- side by side in a 40%-wide column they would be unreadable.
   -------------------------------------------------------------------------- */
.page .iola-contact-form-row__cols {
	gap: 40px;
	align-items: flex-start;
}

@media (min-width: 782px) {
	/* Slightly wider left column, as in the comp. */
	.page .iola-contact-form-row__cols > .wp-block-column:first-child { flex-basis: 55% !important; }
	.page .iola-contact-form-row__visit { flex-basis: 45% !important; }
}

/* Nested in a column, the panel is no longer a full-width band. */
.page .iola-contact-form-row__visit .iola-contact-office-facts {
	margin-block: 0;
}

.page .iola-contact-form-row__visit .iola-contact-office-facts > .wp-block-group__inner-container {
	max-width: none;
	margin-inline: 0;
	padding: 26px;
}

/* core/columns is flex with percentage bases; force a single stack. */
.page .iola-contact-form-row__visit .iola-contact-office-facts__cols {
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.page .iola-contact-form-row__visit .iola-contact-office-facts__cols > .wp-block-column {
	flex-basis: auto !important;
	flex-grow: 0;
	margin-left: 0 !important;
}

/* Section headings for both halves of the row, matching the submit section. */
.page .iola-contact-form-row__title {
	display: flex;
	align-items: center;
	gap: 16px;
	margin: 0 0 18px;
	font-size: clamp(20px, 2.2vw, 26px);
	text-transform: uppercase;
	letter-spacing: .06em;
	line-height: 1.1;
	white-space: nowrap;
}

.page .iola-contact-form-row__title::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--ic-rule, #dedede);
}

/* Newsletter now stands on its own beneath the row. */
.page .iola-contact-newsletter-row {
	margin-block-start: 3rem;
}

@media (max-width: 781px) {
	.page .iola-contact-form-row__cols { gap: 28px; }
	.page .iola-contact-form-row__title { white-space: normal; }
}

/* --- Panel colour + containment fixes --------------------------------------
   1. Colour is set on the container that carries the dark fill and inherited
      down, rather than on <p> alone -- a bare `.page .iola-contact-office-facts p`
      (0,2,1) was being outranked, leaving dark text on the dark panel.
   2. `is-layout-constrained` puts a max-width on its CHILDREN equal to the
      page content size (~1290px). Inside a 45% column that overflows to the
      right, which is why the panel ran off the edge.
   -------------------------------------------------------------------------- */
.page .iola-contact-office-facts > .wp-block-group__inner-container {
	color: #f7f5f1;
}

.page .iola-contact-office-facts > .wp-block-group__inner-container p,
.page .iola-contact-office-facts > .wp-block-group__inner-container a,
.page .iola-contact-office-facts > .wp-block-group__inner-container .wp-block-column {
	color: inherit;
}

.page .iola-contact-office-facts > .wp-block-group__inner-container > * {
	max-width: none;
}

.page .iola-contact-form-row__visit .iola-contact-office-facts,
.page .iola-contact-form-row__visit .iola-contact-office-facts * {
	min-width: 0;
	max-width: 100%;
}

/* Keep the labels muted against the inherited paper colour. */
.page .iola-contact-office-facts .iola-contact-fact__label {
	color: #a8a29a;
}

/* --- "Send us a message" form ----------------------------------------------
   Gravity Forms markup, styled to the comp: a bordered card, two-up rows for
   the short fields, uppercase field labels, solid submit button.
   -------------------------------------------------------------------------- */
.page .iola-contact-form-row__cols > .wp-block-column:first-child .gform_wrapper {
	background: var(--ic-card, #fff);
	border: 1px solid var(--ic-rule, #dedede);
	padding: 24px;
	margin: 0;
}

.page .iola-contact-form-row .gform_fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

/* Short fields share a row; message spans both. */
.page .iola-contact-form-row .gfield.iola-half { grid-column: span 1; }
.page .iola-contact-form-row .gfield:not(.iola-half) { grid-column: 1 / -1; }

.page .iola-contact-form-row .gfield_label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--ic-muted, #777);
}

.page .iola-contact-form-row .gform_wrapper input[type="text"],
.page .iola-contact-form-row .gform_wrapper input[type="email"],
.page .iola-contact-form-row .gform_wrapper input[type="tel"],
.page .iola-contact-form-row .gform_wrapper select,
.page .iola-contact-form-row .gform_wrapper textarea {
	width: 100%;
	padding: 11px 12px;
	font-size: 16px;
	color: var(--ic-ink, #232424);
	background: #fdfcfa;
	border: 1px solid var(--ic-rule, #dedede);
	border-radius: 0;
}

.page .iola-contact-form-row .gform_wrapper textarea { resize: vertical; min-height: 170px; }

.page .iola-contact-form-row .gform_wrapper input:focus,
.page .iola-contact-form-row .gform_wrapper select:focus,
.page .iola-contact-form-row .gform_wrapper textarea:focus {
	outline: 2px solid var(--ic-accent);
	outline-offset: -2px;
	border-color: var(--ic-accent);
}

.page .iola-contact-form-row .gform_footer {
	margin: 4px 0 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 18px;
	flex-wrap: wrap;
}

.page .iola-contact-form-row .gform_button {
	padding: 14px 30px;
	background: var(--ic-accent);
	color: #fff;
	border: 0;
	border-radius: 3px;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background .15s ease;
}

.page .iola-contact-form-row .gform_button:hover { background: var(--ic-accent-dark, var(--ic-accent)); }

@media (max-width: 600px) {
	.page .iola-contact-form-row .gform_fields { grid-template-columns: 1fr; }
	.page .iola-contact-form-row .gfield.iola-half { grid-column: 1 / -1; }
}

/* --- Map below the panel ---------------------------------------------------- */
.iola-contact-map {
	margin-top: 14px;
	border: 1px solid var(--ic-rule, #dedede);
	line-height: 0;
}

.iola-contact-map iframe {
	display: block;
	width: 100%;
	height: 240px;
	border: 0;
}
