/*
 * PortalTech premium component layer.
 * Extends the lightweight Atlas base without a front-end framework.
 */

:root {
	--portal-blue: var(--atlas-accent, #155eef);
	--portal-blue-deep: #0b43bf;
	--portal-ink: #071632;
	--portal-navy: #09162e;
	--portal-soft: #f5f7fb;
	--portal-shadow: var(--atlas-card-shadow, 0 5px 18px rgba(10, 35, 75, .06));
	--portal-shadow-hover: 0 18px 36px rgba(10, 35, 75, .12);
	--portal-gap: var(--atlas-space, 16px);
}

body {
	background: #f7f9fd;
}

body.story-open {
	overflow: hidden;
}

.site-main {
	padding-top: 20px;
}

.site-header {
	background: rgba(255, 255, 255, .94);
	box-shadow: 0 1px 0 rgba(9, 22, 46, .07);
	transition: box-shadow .25s ease;
}

.site-header.is-compact {
	box-shadow: 0 8px 28px rgba(9, 22, 46, .1);
}

.portal-header-glass .site-header {
	background: rgba(255, 255, 255, .78);
	backdrop-filter: blur(18px);
}

.portal-header-dark .header-row {
	background: #09162e;
}

.portal-header-dark .portal-menu > li > a,
.portal-header-dark .portal-menu .category-toggle,
.portal-header-dark .icon-action {
	color: #fff;
}

.portal-cards-outlined .card,
.portal-cards-outlined .portal-row {
	box-shadow: none;
	border-color: #d6e1f3;
}

.portal-cards-flat .card,
.portal-cards-flat .portal-row {
	border-color: transparent;
	box-shadow: none;
}

.site-header.is-compact .header-row {
	min-height: 62px;
}

.header-topbar {
	background: #070f21;
}

.topbar-row {
	min-height: 40px;
	gap: 17px;
}

.topbar-date {
	padding: 4px 9px;
	background: rgba(255, 255, 255, .11);
	border-radius: 6px;
	color: #dbe4f7;
	font-size: .71rem;
	font-weight: 700;
	text-transform: uppercase;
}

.breaking-link {
	padding: 4px 10px;
	background: #ef334b;
	border-radius: 5px;
	color: #fff;
	font-size: .72rem;
	text-transform: uppercase;
}

.breaking-link span {
	width: auto;
	height: auto;
	background: transparent;
}

.breaking-headline {
	overflow: hidden;
	max-width: 330px;
	color: #e2e8f3;
	font-size: .76rem;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.topbar-social {
	align-items: center;
	font-size: .73rem;
}

.topbar-social a,
.topbar-social .mode-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 25px;
	height: 25px;
	background: rgba(255, 255, 255, .08);
	border: 0;
	border-radius: 50%;
	color: #fff;
	font-size: .7rem;
	font-weight: 700;
}

.header-row {
	min-height: 82px;
	gap: 23px;
	overflow: visible;
	transition: min-height .22s ease;
}

.site-branding {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	width: clamp(156px, 18vw, 224px);
	height: 54px;
	overflow: hidden;
}

.portaltech-logo {
	display: block;
	width: 100%;
}

.portaltech-logo img,
.site-branding .custom-logo-link,
.site-branding .custom-logo {
	display: block;
	max-width: 100%;
	max-height: 54px;
	width: auto;
	height: auto;
	object-fit: contain;
}

.logo-dark {
	display: none;
}

.portal-navigation {
	display: block;
	position: static;
	flex: 1;
	min-width: 0;
	padding: 0;
	background: transparent;
	border: 0;
}

.portal-menu {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: clamp(7px, 1vw, 17px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.portal-menu > li > a,
.portal-menu .category-toggle {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 13px 0;
	background: transparent;
	border: 0;
	color: #12223e;
	font-size: .84rem;
	font-weight: 700;
	white-space: nowrap;
}

.portal-menu > li > a:hover,
.portal-menu .category-toggle:hover {
	color: var(--portal-blue);
}

.mega-dropdown {
	position: relative;
}

.mega-panel {
	position: absolute;
	top: calc(100% + 17px);
	right: 0;
	z-index: 60;
	width: min(710px, calc(100vw - 30px));
	padding: 19px;
	background: #fff;
	border: 1px solid #e5ebf5;
	border-radius: 16px;
	box-shadow: 0 28px 55px rgba(8, 27, 62, .16);
}

.mega-heading {
	display: flex;
	justify-content: space-between;
	margin-bottom: 15px;
}

.mega-heading a {
	color: var(--portal-blue);
	font-size: .84rem;
	font-weight: 700;
}

.mega-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
}

.mega-card {
	display: block;
	padding: 12px;
	background: #f7faff;
	border: 1px solid #edf2fb;
	border-radius: 11px;
}

.mega-card strong {
	display: block;
	margin-bottom: 5px;
	color: var(--portal-blue-deep);
	font-size: .82rem;
}

.mega-card span {
	display: -webkit-box;
	overflow: hidden;
	color: #53637f;
	font-size: .72rem;
	line-height: 1.4;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.header-actions {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	gap: 4px;
}

.icon-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	background: transparent;
	border: 0;
	border-radius: 11px;
	color: #142440;
}

.icon-action:hover {
	background: #f0f5ff;
	color: var(--portal-blue);
}

.icon-action svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.menu-toggle { display: inline-flex; }

/* Dashboard and hero */
.portal-dashboard {
	display: grid;
	gap: var(--portal-gap);
}

.portal-components {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--portal-gap);
	min-width: 0;
}

.component,
.portal-row {
	min-width: 0;
	animation: portal-rise .45s ease both;
}

.will-reveal {
	opacity: 0;
	transform: translateY(14px);
}

.will-reveal.is-visible {
	opacity: 1;
	transform: translateY(0);
	transition: opacity .44s ease, transform .44s ease;
}

@keyframes portal-rise {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

.featured-news-grid {
	gap: 12px;
}

.featured-card {
	border-radius: 12px;
	box-shadow: var(--portal-shadow);
}

.featured-card-lead .featured-copy {
	right: 25px;
	bottom: 24px;
	left: 25px;
}

.featured-copy .category-pill {
	padding: 5px 10px;
	background: var(--portal-blue);
	font-size: .66rem;
}

.featured-copy h2 {
	margin-top: 10px;
	line-height: 1.25;
}

.featured-card-lead .featured-copy h2 {
	max-width: 590px;
	font-size: clamp(1.55rem, 3vw, 2.24rem);
}

.featured-excerpt {
	max-width: 500px;
	margin: 0 0 12px;
	color: rgba(255, 255, 255, .9);
	font-size: .9rem;
	line-height: 1.48;
}

.featured-card:hover,
.portal-row:hover,
.story-component:hover {
	box-shadow: var(--portal-shadow-hover);
}

/* Stories */
.story-component {
	padding: 16px 20px 14px;
	border-radius: 13px;
	box-shadow: var(--portal-shadow);
}

.component-title {
	margin-bottom: 11px;
}

.component-title h2,
.portal-row .section-heading h2,
.widget-title {
	position: relative;
	margin: 0;
	color: #0a3c9e;
	font-size: .9rem;
	font-weight: 800;
	letter-spacing: .01em;
	text-transform: uppercase;
}

.story-rail {
	display: flex;
	gap: clamp(14px, 3vw, 31px);
	padding: 1px 5px 0;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.story-rail::-webkit-scrollbar {
	display: none;
}

.story-tile {
	flex: 0 0 76px;
	padding: 0;
	background: transparent;
	border: 0;
	color: #12223e;
	font-size: .68rem;
	font-weight: 700;
	line-height: 1.3;
	scroll-snap-align: start;
}

.story-ring {
	display: block;
	width: 62px;
	height: 62px;
	margin: 0 auto 7px;
	padding: 3px;
	background: linear-gradient(135deg, #155eef, #f97316);
	border-radius: 50%;
}

.story-ring img,
.story-fallback {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: linear-gradient(135deg, #0b1736, #155eef);
	border: 2px solid #fff;
	border-radius: 50%;
}

.story-modal {
	position: fixed;
	inset: 0;
	z-index: 2000;
	display: grid;
	place-items: center;
	padding: 16px;
	background: rgba(3, 9, 21, .88);
	backdrop-filter: blur(9px);
}

.story-modal[hidden] {
	display: none;
}

.story-viewer {
	position: relative;
	overflow: hidden;
	width: min(410px, 100%);
	height: min(760px, calc(100dvh - 32px));
	background: #081122;
	border-radius: 20px;
}

.story-frame,
.story-frame img,
.story-frame-fallback {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.story-frame::after {
	position: absolute;
	inset: 30% 0 0;
	background: linear-gradient(transparent, rgba(3, 9, 21, .96));
	content: "";
}

.story-frame-fallback {
	background: linear-gradient(145deg, #0b1736, #155eef);
}

.story-caption {
	position: absolute;
	right: 22px;
	bottom: 28px;
	left: 22px;
	z-index: 2;
}

.story-caption h3 {
	margin: 10px 0 18px;
	color: #fff;
	font-size: 1.42rem;
}

.story-caption a {
	display: inline-flex;
	padding: 10px 17px;
	background: #fff;
	border-radius: 9px;
	color: #0b43bf;
	font-weight: 700;
}

.story-progress {
	position: absolute;
	top: 14px;
	right: 14px;
	left: 14px;
	z-index: 4;
	display: flex;
	gap: 4px;
}

.story-progress span {
	flex: 1;
	height: 3px;
	overflow: hidden;
	background: rgba(255, 255, 255, .32);
	border-radius: 4px;
}

.story-progress i {
	display: block;
	width: 0;
	height: 100%;
	background: #fff;
}

.story-progress .is-complete i {
	width: 100%;
}

.story-progress .is-active i {
	animation: story-timer var(--story-duration, 6000ms) linear forwards;
}

@keyframes story-timer {
	to { width: 100%; }
}

.story-close,
.story-nav {
	position: absolute;
	z-index: 5;
	background: rgba(0, 0, 0, .28);
	border: 0;
	border-radius: 50%;
	color: #fff;
}

.story-close {
	top: 27px;
	right: 17px;
	width: 38px;
	height: 38px;
	font-size: 1.5rem;
}

.story-nav {
	top: 48%;
	width: 42px;
	height: 50px;
	font-size: 1.7rem;
}

.story-prev { left: 10px; }
.story-next { right: 10px; }

/* Editorial rows */
.portal-row {
	padding: 14px;
	border-radius: 12px;
	box-shadow: var(--portal-shadow);
}

.portal-row .section-heading {
	align-items: flex-start;
	margin-bottom: 12px;
}

.portal-row .section-heading p {
	display: none;
}

.portal-row .section-heading > a {
	padding: 0;
	background: transparent;
	border: 0;
	color: #71809b;
	font-size: .72rem;
}

.portal-row-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 12px;
}

.post-card-lead {
	grid-row: auto;
}

.portal-row .post-card {
	border-color: transparent;
	border-radius: 8px;
}

.post-card-lead .card-image {
	aspect-ratio: 16 / 9;
}

.post-card-lead .card-body {
	padding: 10px 4px 0;
}

.post-card-lead .card-excerpt,
.post-card-lead .detail-chip {
	display: none;
}

.post-card-compact {
	display: grid;
	grid-template-columns: minmax(108px, 32%) minmax(0, 1fr);
	min-height: 92px;
	border: 0;
}

.post-card-compact .card-image {
	height: 100%;
	min-height: 92px;
	aspect-ratio: 4 / 3;
	border-radius: 7px;
}

.post-card-compact .card-body {
	min-width: 0;
	padding: 3px 2px 3px 12px;
}

.post-card-compact .category-pill,
.post-card-compact .entry-meta span {
	display: none;
}

.post-card-compact .card-title {
	display: -webkit-box;
	overflow: hidden;
	margin: 0 0 7px;
	font-size: .92rem;
	line-height: 1.38;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.post-card-compact .entry-meta {
	font-size: .73rem;
}

.portal-banner {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 78px;
	background: linear-gradient(100deg, #0a142c, #142346);
	color: rgba(255, 255, 255, .68);
	font-size: .68rem;
	letter-spacing: .08em;
}

.portal-banner strong {
	color: #fff;
	font-size: 1.25rem;
}

.newsletter-card {
	padding: 19px;
	box-shadow: var(--portal-shadow);
}

.newsletter-card h2 {
	margin: 0 0 8px;
	color: #0a3c9e;
	font-size: .9rem;
	text-transform: uppercase;
}

.newsletter-card p {
	margin: 0 0 13px;
	color: #66758e;
	font-size: .82rem;
}

.newsletter-form {
	display: grid;
	gap: 8px;
}

.newsletter-form input {
	width: 100%;
	min-height: 42px;
	padding: 0 12px;
	border: 1px solid #dae3f3;
	border-radius: 6px;
}

.newsletter-form button {
	min-height: 42px;
	background: linear-gradient(100deg, var(--portal-blue), #2b72ec);
	border: 0;
	border-radius: 6px;
	color: #fff;
	font-size: .8rem;
	font-weight: 700;
	text-transform: uppercase;
}

.media-strip,
.instagram-feed {
	padding: 15px;
	box-shadow: var(--portal-shadow);
}

.media-rail {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.media-rail::-webkit-scrollbar {
	display: none;
}

.media-tile {
	position: relative;
	flex: 0 0 min(158px, 47vw);
	overflow: hidden;
	border-radius: 9px;
	scroll-snap-align: start;
}

.media-tile img {
	width: 100%;
	height: 108px;
	object-fit: cover;
}

.media-tile strong {
	display: block;
	padding: 8px 3px 0;
	font-size: .75rem;
	line-height: 1.35;
}

.play-mark {
	position: absolute;
	top: 42px;
	left: 50%;
	display: grid;
	place-items: center;
	width: 29px;
	height: 29px;
	background: rgba(21, 94, 239, .94);
	border-radius: 50%;
	color: #fff;
	font-size: .72rem;
	transform: translate(-50%, -50%);
}

.instagram-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 7px;
}

.instagram-grid a,
.instagram-grid img,
.instagram-grid .card-fallback {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	border-radius: 7px;
	object-fit: cover;
}

.footer-logo img {
	width: min(190px, 100%);
	height: auto;
}

.footer-newsletter {
	padding-bottom: 26px;
}

.newsletter-popup {
	position: fixed;
	right: 18px;
	bottom: 18px;
	z-index: 150;
	width: min(355px, calc(100vw - 36px));
}

.newsletter-popup[hidden] {
	display: none;
}

.newsletter-popup-inner {
	position: relative;
}

.newsletter-popup .newsletter-card {
	border-color: #d8e3f5;
	box-shadow: 0 25px 55px rgba(6, 24, 58, .2);
}

.newsletter-popup-close {
	position: absolute;
	top: 9px;
	right: 9px;
	z-index: 1;
	width: 32px;
	height: 32px;
	background: #eff4fc;
	border: 0;
	border-radius: 50%;
	color: #173052;
	font-size: 1.25rem;
}

.site-footer .newsletter-card {
	background: transparent;
	border-color: rgba(255, 255, 255, .12);
	box-shadow: none;
}

.site-footer .newsletter-card h2,
.site-footer .newsletter-card p {
	color: #fff;
}

/* Sidebar */
.portal-sidebar {
	display: grid;
	align-content: start;
	gap: 14px;
}

.portal-sidebar .card,
.portal-sidebar .ad-slot {
	margin: 0;
	padding: 16px;
	border-radius: 12px;
	box-shadow: var(--portal-shadow);
}

.load-more-posts {
	display: block;
	width: min(290px, 100%);
	margin: 25px auto 0;
	padding: 13px 20px;
	background: var(--portal-blue);
	border: 0;
	border-radius: 9px;
	color: #fff;
	font-weight: 700;
}

.load-more-posts[disabled] {
	opacity: .65;
}

.portal-sidebar .widget-title {
	margin-bottom: 14px;
}

.sidebar-breaking .widget-title {
	margin: -16px -16px 13px;
	padding: 13px 16px;
	background: var(--portal-blue);
	border-radius: 12px 12px 0 0;
	color: #fff;
}

.breaking-list {
	display: grid;
	gap: 14px;
	margin: 0;
	padding: 0 0 0 15px;
	color: var(--portal-blue);
}

.breaking-list li {
	padding-left: 4px;
}

.breaking-list a {
	display: inline;
	color: #182641;
	font-size: .78rem;
	font-weight: 700;
	line-height: 1.42;
}

.breaking-list time {
	float: right;
	margin-left: 7px;
	color: #77859e;
	font-size: .68rem;
}

.tag-cloud {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}

.tag-cloud a,
.tag-cloud span {
	padding: 5px 9px;
	background: #edf4ff;
	border-radius: 13px;
	color: #2862ce;
	font-size: .68rem;
	font-weight: 650;
}

.portal-sidebar .ranked-list {
	padding: 0;
	list-style: none;
	counter-reset: rank;
}

.portal-sidebar .ranked-list li {
	display: grid;
	grid-template-columns: 22px 52px 1fr;
	align-items: center;
	gap: 9px;
	padding: 8px 0;
	color: var(--portal-blue);
	counter-increment: rank;
}

.portal-sidebar .ranked-list li::before {
	content: counter(rank);
	font-size: 1.3rem;
	font-weight: 800;
}

.portal-sidebar .ranked-list img {
	width: 52px;
	height: 44px;
	border-radius: 7px;
	object-fit: cover;
}

.portal-sidebar .ranked-list a {
	font-size: .72rem;
	line-height: 1.35;
}

.sidebar-story-grid {
	display: flex;
	justify-content: space-between;
	gap: 7px;
}

.sidebar-story-grid a {
	min-width: 0;
	color: #273652;
	font-size: .61rem;
	font-weight: 650;
	text-align: center;
}

.sidebar-story-grid img {
	width: 47px;
	height: 47px;
	margin: 0 auto 5px;
	padding: 2px;
	border: 2px solid var(--portal-blue);
	border-radius: 50%;
	object-fit: cover;
}

.ai-recommendations ul {
	margin: 0;
	padding-left: 17px;
}

.ai-recommendations li {
	margin-bottom: 9px;
	color: var(--portal-blue);
	font-size: .8rem;
}

.portal-sidebar .ad-slot {
	width: auto;
	min-height: 78px;
	background: #101a2c;
	color: #fff;
}

/* Single media experience */
.reading-progress {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 300;
	width: 0;
	height: 3px;
	background: linear-gradient(90deg, var(--portal-blue), #38bdf8);
	transition: width .08s linear;
}

.entry-subtitle {
	margin: -7px 0 16px;
	color: #556780;
	font-size: clamp(1rem, 2vw, 1.18rem);
	line-height: 1.55;
}

.single-layout .share-links {
	position: sticky;
	top: 130px;
}

.entry-content blockquote,
.entry-content .is-style-portal-quote {
	margin: 28px 0;
	padding: 22px 24px;
	background: #f3f7ff;
	border-left: 4px solid var(--portal-blue);
	border-radius: 0 12px 12px 0;
	color: #173053;
	font-size: 1.1rem;
}

.entry-content .is-style-portal-highlight {
	padding: 19px 22px;
	background: #edf5ff;
	border: 1px solid #d8e7ff;
	border-radius: 12px;
}

.entry-content iframe,
.entry-content video {
	max-width: 100%;
	border-radius: 12px;
}

.comparison-products {
	padding: 12px 16px;
	background: #edf5ff;
	border-radius: 10px;
	color: #173053;
	font-size: 1.02rem;
	font-weight: 700;
	text-align: center;
}

.comparison-products strong {
	margin: 0 12px;
	color: var(--portal-blue);
}

.comparison-table-copy {
	margin: 15px 0;
	color: #445570;
}

.comparison-result-grid {
	display: grid;
	gap: 10px;
}

@media (min-width: 560px) {
	.comparison-result-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Dark mode */
.atlas-dark .logo-light {
	display: none;
}

.atlas-dark .logo-dark {
	display: block;
}

.atlas-dark .portal-menu > li > a,
.atlas-dark .portal-menu .category-toggle {
	color: #e8eefc;
}

.atlas-dark .mega-panel,
.atlas-dark .mega-card {
	background: #111d32;
	border-color: #24324a;
}

.atlas-dark .mega-card span,
.atlas-dark .breaking-list a {
	color: #dbe5fa;
}

.atlas-dark .portal-banner {
	background: #070d1b;
}

.atlas-dark .tag-cloud a,
.atlas-dark .tag-cloud span,
.atlas-dark .entry-content blockquote,
.atlas-dark .entry-content .is-style-portal-highlight {
	background: #162742;
	border-color: #27436c;
	color: #dae5fb;
}
