/* Newsdesk — shared components. Per-site values come from theme.json presets
   (--wp--preset--color--*, --wp--preset--font-family--*) and body vars set in functions.php. */

:root { --nd-gap: clamp(1.25rem, 2.4vw, 2rem); }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.wp-site-blocks { display: flex; flex-direction: column; min-height: 100vh; }
.wp-site-blocks > main, .wp-site-blocks > .nd-main { flex: 1; }
.wp-site-blocks > * + * { margin-block-start: 0; }
img { max-width: 100%; height: auto; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

.nd-wrap { max-width: var(--wp--style--global--wide-size, 1240px); margin-inline: auto; padding-inline: clamp(16px, 4vw, 40px); box-sizing: content-box; }

/* ---------- Header ---------- */
.nd-header { background: var(--wp--preset--color--header-bg); color: var(--wp--preset--color--header-text); }
.nd-header a { color: inherit; text-decoration: none; }
.nd-header p { margin: 0; }

.nd-topbar { font-size: .8125rem; border-bottom: 1px solid color-mix(in srgb, currentColor 14%, transparent); }
.nd-topbar .nd-wrap { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: .5rem; }
.nd-date { text-transform: capitalize; opacity: .8; }
.nd-network { font-weight: 600; opacity: .9; }
.nd-network:hover { opacity: 1; text-decoration: underline !important; }

.nd-brand .nd-wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem 2rem; padding-block: clamp(1.1rem, 2.6vw, 1.75rem); flex-wrap: wrap; }
.nd-title { margin: 0; font-family: var(--wp--preset--font-family--heading); font-weight: var(--nd-title-weight, 800); text-transform: var(--nd-case, none);
	font-size: clamp(1.75rem, 4vw, 2.6rem); line-height: 1.05; letter-spacing: -.015em; color: inherit; }
.nd-mark { display: inline-block; width: .42em; height: .42em; margin-right: .32em; vertical-align: .14em; background: var(--wp--preset--color--accent); border-radius: min(var(--nd-radius, 4px), .21em); }
.nd-site-viral .nd-mark { background: #FFD23F; } /* header is already the accent colour */
.nd-tagline { margin-top: .4rem !important; font-size: .9375rem; opacity: .72; }

.nd-search input { font: inherit; font-size: .9rem; width: min(260px, 70vw); padding: .55rem .9rem; color: inherit;
	background: color-mix(in srgb, currentColor 7%, transparent); border: 1px solid color-mix(in srgb, currentColor 18%, transparent); border-radius: max(var(--nd-radius, 6px), 6px); }
.nd-search input::placeholder { color: inherit; opacity: .6; }
.nd-search input:focus { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 1px; }

.nd-topics { border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent); }
.nd-topics ul { display: flex; gap: .15rem; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.nd-topics ul::-webkit-scrollbar { display: none; }
.nd-topics a { display: block; padding: .8rem .75rem .7rem; font-size: .875rem; font-weight: 600; letter-spacing: .01em; text-transform: var(--nd-case, none);
	border-bottom: 3px solid transparent; opacity: .82; transition: opacity .15s, border-color .15s; }
.nd-topics a:hover { opacity: 1; border-bottom-color: color-mix(in srgb, var(--wp--preset--color--accent) 45%, transparent); }
.nd-topics .is-current a { opacity: 1; border-bottom-color: var(--wp--preset--color--accent); }

/* masthead: centered newspaper nameplate */
.nd-header-masthead .nd-brand .nd-wrap { flex-direction: column; text-align: center; padding-block: clamp(1.5rem, 4vw, 2.75rem) clamp(1.25rem, 3vw, 2rem); }
.nd-header-masthead .nd-title { font-size: clamp(2.3rem, 7vw, 4.4rem); letter-spacing: -.02em; }
.nd-header-masthead .nd-mark { display: none; }
.nd-header-masthead .nd-tagline { font-style: italic; }
.nd-header-masthead .nd-topics { border-top: 1px solid currentColor; border-bottom: 3px double currentColor; }
.nd-header-masthead .nd-topics ul { justify-content: safe center; }
.nd-header-bar .nd-header { box-shadow: 0 1px 0 color-mix(in srgb, var(--wp--preset--color--contrast) 10%, transparent); }

/* ---------- Main ---------- */
.nd-main { padding-block: clamp(1.5rem, 4vw, 3rem) clamp(2.5rem, 6vw, 4.5rem); }
.nd-archive-title { margin: 0 0 1.5rem; padding-bottom: .75rem; font-size: var(--wp--preset--font-size--x-large); border-bottom: 2px solid var(--wp--preset--color--contrast); }

/* ---------- Cards ---------- */
.nd-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--nd-gap); grid-template-columns: repeat(var(--nd-cols, 3), minmax(0, 1fr)); }
.nd-cards > li { margin: 0; min-width: 0; }
.nd-card { height: 100%; margin: 0; display: flex; flex-direction: column; background: var(--wp--preset--color--surface); border-radius: var(--nd-radius); overflow: hidden;
	transition: box-shadow .2s ease, transform .2s ease; }
.nd-card-media { margin: 0 !important; aspect-ratio: var(--nd-ratio, 16/9); overflow: hidden; background: color-mix(in srgb, var(--wp--preset--color--contrast) 7%, var(--wp--preset--color--base)); }
.nd-card-media a { display: block; height: 100%; }
.nd-card-media img { display: block; width: 100%; height: 100% !important; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.nd-card:hover .nd-card-media img { transform: scale(1.045); }
.nd-card-body { flex: 1; display: flex; flex-direction: column; gap: .55rem; padding: 1.05rem 1.15rem 1.2rem; }
.nd-card-body > * { margin: 0 !important; }
.nd-kicker { font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--wp--preset--color--accent); }
.nd-kicker a { color: inherit; text-decoration: none; }
.nd-kicker > a:first-of-type ~ * { display: none; } /* first tag only */
.nd-site-athlitika .nd-card-title, .nd-site-athlitika .nd-single-title, .nd-site-athlitika .nd-section-title { text-transform: none; }
.nd-site-athlitika:not(.paged) .nd-feed:not(.nd-feed-related) .nd-cards > li:first-child .nd-card-title { text-transform: uppercase; }
.nd-card-title { font-size: clamp(1.05rem, 1.35vw, 1.22rem); line-height: 1.28; }
.nd-card-title a { color: var(--wp--preset--color--contrast); text-decoration: none; background-image: linear-gradient(currentColor, currentColor);
	background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .25s, color .15s; }
.nd-card-title a:hover { color: var(--wp--preset--color--accent); background-size: 100% 1px; text-decoration: none; }
.nd-card-excerpt { color: var(--wp--preset--color--muted); font-size: .9375rem; line-height: 1.55; }
.nd-card-excerpt p { margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nd-card-date { margin-top: auto !important; padding-top: .25rem; font-size: .75rem !important; letter-spacing: .05em; text-transform: uppercase; color: var(--wp--preset--color--muted); }

.nd-cards-flat .nd-card { background: transparent; border-radius: 0; overflow: visible; }
.nd-cards-flat .nd-card-media { border-radius: var(--nd-radius); }
.nd-cards-flat .nd-card-body { padding: .95rem 0 0; }
.nd-cards-bordered .nd-card { border: 1px solid var(--wp--preset--color--border); }
.nd-cards-bordered .nd-card:hover { border-color: color-mix(in srgb, var(--wp--preset--color--accent) 55%, var(--wp--preset--color--border)); }
.nd-cards-shadow .nd-card { box-shadow: 0 1px 2px rgb(0 0 0 / .05), 0 6px 22px rgb(0 0 0 / .06); }
.nd-cards-shadow .nd-card:hover { box-shadow: 0 2px 4px rgb(0 0 0 / .06), 0 14px 36px rgb(0 0 0 / .1); transform: translateY(-3px); }

/* lead-grid: first story spans the row on page 1 */
.nd-layout-lead-grid:not(.paged) .nd-feed:not(.nd-feed-related) .nd-cards > li:first-child { grid-column: 1 / -1; }
.nd-layout-lead-grid:not(.paged) .nd-feed:not(.nd-feed-related) .nd-cards > li:first-child .nd-card { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.nd-layout-lead-grid:not(.paged) .nd-feed:not(.nd-feed-related) .nd-cards > li:first-child .nd-card-media { aspect-ratio: auto; min-height: clamp(260px, 32vw, 440px); }
.nd-layout-lead-grid:not(.paged) .nd-feed:not(.nd-feed-related) .nd-cards > li:first-child .nd-card-body { justify-content: center; padding: clamp(1.25rem, 3vw, 2.5rem); gap: .9rem; }
.nd-layout-lead-grid:not(.paged) .nd-feed:not(.nd-feed-related) .nd-cards > li:first-child .nd-card-title { font-size: clamp(1.6rem, 3vw, 2.5rem); line-height: 1.12; }
.nd-layout-lead-grid:not(.paged) .nd-feed:not(.nd-feed-related) .nd-cards > li:first-child .nd-card-excerpt { font-size: 1.05rem; }
.nd-layout-lead-grid:not(.paged) .nd-feed:not(.nd-feed-related) .nd-cards > li:first-child .nd-card-excerpt p { -webkit-line-clamp: 5; }
.nd-cards-flat.nd-layout-lead-grid:not(.paged) .nd-feed:not(.nd-feed-related) .nd-cards > li:first-child { padding-bottom: var(--nd-gap); border-bottom: 1px solid var(--wp--preset--color--border); }
.nd-cards-flat.nd-layout-lead-grid:not(.paged) .nd-feed:not(.nd-feed-related) .nd-cards > li:first-child .nd-card { gap: clamp(1.25rem, 3vw, 2.5rem); }
.nd-cards-flat.nd-layout-lead-grid:not(.paged) .nd-feed:not(.nd-feed-related) .nd-cards > li:first-child .nd-card-body { padding: 0; }

/* list: image left, text right */
.nd-layout-list .nd-feed:not(.nd-feed-related) { max-width: 980px; margin-inline: auto; }
.nd-layout-list .nd-feed:not(.nd-feed-related) .nd-cards { grid-template-columns: minmax(0, 1fr); gap: 0; }
.nd-layout-list .nd-feed:not(.nd-feed-related) .nd-card { flex-direction: row; align-items: flex-start; gap: clamp(1rem, 2.5vw, 1.75rem); padding: clamp(1rem, 2.5vw, 1.5rem);
	background: transparent; border: 0; border-bottom: 1px solid var(--wp--preset--color--border); border-radius: 0; box-shadow: none; transform: none; }
.nd-layout-list.nd-cards-bordered .nd-feed:not(.nd-feed-related) .nd-cards { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--border); border-radius: var(--nd-radius); overflow: hidden; }
.nd-layout-list .nd-feed:not(.nd-feed-related) .nd-cards > li:last-child .nd-card { border-bottom: 0; }
.nd-layout-list.nd-cards-flat .nd-feed:not(.nd-feed-related) .nd-card { padding-inline: 0; }
.nd-layout-list .nd-feed:not(.nd-feed-related) .nd-card-media { flex: 0 0 clamp(120px, 34%, 320px); border-radius: var(--nd-radius); }
.nd-layout-list .nd-feed:not(.nd-feed-related) .nd-card-body { padding: 0; }
.nd-layout-list .nd-feed:not(.nd-feed-related) .nd-card-title { font-size: clamp(1.15rem, 2vw, 1.55rem); line-height: 1.2; }
.nd-layout-list .nd-feed:not(.nd-feed-related) .nd-card-date { margin-top: .35rem !important; }

/* ---------- Pagination ---------- */
.nd-pagination { margin-top: clamp(2rem, 5vw, 3.5rem) !important; gap: .4rem; font-weight: 600; font-size: .9375rem; }
.nd-pagination a, .nd-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 2.5rem; height: 2.5rem; padding: 0 .85rem;
	border: 1px solid var(--wp--preset--color--border); border-radius: max(var(--nd-radius), 4px); color: var(--wp--preset--color--contrast); text-decoration: none; background: var(--wp--preset--color--surface); }
.nd-pagination a:hover { border-color: var(--wp--preset--color--accent); color: var(--wp--preset--color--accent); text-decoration: none; }
.nd-pagination .page-numbers.current { background: var(--wp--preset--color--accent); border-color: var(--wp--preset--color--accent); color: var(--wp--preset--color--accent-contrast); }
.nd-pagination .page-numbers.dots { border: 0; background: none; }
.nd-empty { text-align: center; color: var(--wp--preset--color--muted); padding: 3rem 0; }

/* ---------- Single article ---------- */
.nd-article { padding-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.nd-article > .nd-kicker { margin-bottom: -.25rem; }
.nd-single-title { font-size: clamp(1.9rem, 4.2vw, 3.1rem); line-height: 1.1; letter-spacing: -.015em; margin-block: .5rem 0; text-wrap: balance; }
.nd-meta { gap: .35rem 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--wp--preset--color--border); font-size: .875rem; color: var(--wp--preset--color--muted); }
.nd-meta > * { margin: 0 !important; }
.nd-meta-source { font-weight: 600; }
.nd-content .newsok-image { margin: 0 0 1.5rem; }
.nd-content .newsok-image img { width: 100%; border-radius: var(--nd-radius); }
.nd-content > p:not(.newsok-source) { font-size: clamp(1.1rem, 1.6vw, 1.25rem); line-height: 1.65; }
.nd-content .newsok-source { margin-top: 1.75rem; }
.nd-content .newsok-source a { display: inline-flex; align-items: center; gap: .4rem; padding: .85rem 1.35rem; border-radius: max(var(--nd-radius), 4px);
	background: var(--wp--preset--color--accent); color: var(--wp--preset--color--accent-contrast); font-weight: 700; text-decoration: none; transition: filter .15s, transform .15s; }
.nd-content .newsok-source a:hover { filter: brightness(1.08); transform: translateY(-1px); text-decoration: none; }
.nd-related { margin-top: clamp(1.5rem, 4vw, 3rem) !important; padding-top: clamp(1.5rem, 4vw, 2.5rem); border-top: 1px solid var(--wp--preset--color--border); }
.nd-section-title { font-size: var(--wp--preset--font-size--large); margin: 0 0 1.25rem; text-transform: var(--nd-case, none); }
.nd-feed-related .nd-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nd-feed-related .nd-card-media { aspect-ratio: 16 / 10; }

/* ---------- Page / portal ---------- */
.nd-page-title { margin-bottom: .5rem; }
.home .nd-page-title { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
.home .nd-page .nd-content > p { max-width: 62ch; color: var(--wp--preset--color--muted); }
.nd-portal { display: grid; gap: var(--nd-gap); grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-top: 1.5rem; }
.nd-portal-card { background: var(--wp--preset--color--surface); border-radius: var(--nd-radius); overflow: hidden; border-top: 5px solid var(--nd-site-accent);
	box-shadow: 0 1px 2px rgb(0 0 0 / .05), 0 6px 22px rgb(0 0 0 / .06); display: flex; flex-direction: column; }
.nd-portal-card header a { display: flex; justify-content: space-between; align-items: baseline; padding: 1rem 1.15rem .8rem; text-decoration: none; }
.nd-portal-label { font-family: var(--wp--preset--font-family--heading); font-weight: 800; font-size: 1.3rem; color: var(--wp--preset--color--contrast); }
.nd-portal-topic { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--wp--preset--color--muted); margin-top: .15rem; }
.nd-portal-more { font-size: .8rem; font-weight: 700; color: var(--nd-site-accent); }
.nd-portal-lead { display: block; text-decoration: none; color: var(--wp--preset--color--contrast); }
.nd-portal-lead img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.nd-portal-lead strong { display: block; padding: .85rem 1.15rem 0; font-family: var(--wp--preset--font-family--heading); font-size: 1.1rem; line-height: 1.3; }
.nd-portal-lead:hover strong { color: var(--nd-site-accent); }
.nd-portal-card ul { list-style: none; margin: .5rem 0 0; padding: 0 1.15rem 1rem; }
.nd-portal-card li { border-top: 1px solid var(--wp--preset--color--border); }
.nd-portal-card li a { display: block; padding: .6rem 0; font-size: .9rem; line-height: 1.4; color: var(--wp--preset--color--contrast); text-decoration: none; }
.nd-portal-card li a:hover { color: var(--nd-site-accent); }

/* ---------- Footer ---------- */
.nd-footer { margin-top: auto; background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); font-size: .9rem; }
.nd-site-texnologia .nd-footer { background: #060913; color: var(--wp--preset--color--contrast); }
.nd-footer a { color: inherit; text-decoration: none; opacity: .85; }
.nd-footer a:hover { opacity: 1; text-decoration: underline; }
.nd-footer-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 2rem clamp(2rem, 6vw, 5rem); padding-block: clamp(2rem, 5vw, 3.25rem); }
.nd-footer p { margin: 0 0 .6rem; opacity: .85; }
.nd-footer-title { font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: 1.15rem; opacity: 1 !important; margin-bottom: .8rem !important; }
.nd-footer-note { font-size: .8125rem; opacity: .65 !important; max-width: 52ch; }
.nd-footer-links { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 2rem; }
.nd-footer-links li { padding: .2rem 0; }
.nd-footer-bottom { display: flex; justify-content: space-between; padding-block: 1rem; border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent); font-size: .8rem; opacity: .7; }
.newsok-attrib { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
	.nd-cards { grid-template-columns: repeat(min(var(--nd-cols, 3), 3), minmax(0, 1fr)); }
	.nd-site-athlitika .nd-feed:not(.nd-feed-related) .nd-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
	.nd-cards, .nd-feed-related .nd-cards, .nd-site-athlitika .nd-feed:not(.nd-feed-related) .nd-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.nd-layout-lead-grid:not(.paged) .nd-feed:not(.nd-feed-related) .nd-cards > li:first-child .nd-card { grid-template-columns: minmax(0, 1fr); }
	.nd-layout-lead-grid:not(.paged) .nd-feed:not(.nd-feed-related) .nd-cards > li:first-child .nd-card-media { min-height: 0; aspect-ratio: 16 / 9; }
	.nd-search { order: 3; width: 100%; } .nd-search input { width: 100%; box-sizing: border-box; }
	.nd-header-masthead .nd-search { max-width: 420px; }
}
@media (max-width: 600px) {
	.nd-cards, .nd-feed-related .nd-cards, .nd-site-athlitika .nd-feed:not(.nd-feed-related) .nd-cards { grid-template-columns: minmax(0, 1fr); }
	.nd-layout-list .nd-feed:not(.nd-feed-related) .nd-card-media { flex-basis: 36%; aspect-ratio: 1 / 1; }
	.nd-layout-list .nd-feed:not(.nd-feed-related) .nd-card-excerpt { display: none; }
	.nd-topbar .nd-network { display: none; }
	.nd-footer-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .nd-card, .nd-card-media img, .nd-card-title a { transition: none; } .nd-card:hover .nd-card-media img { transform: none; } }
