/* ══════════════════════════════════════════
   BASE PORTAL LAYOUT — shared across all themes
   ══════════════════════════════════════════ */

.portal {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body-font);
  line-height: 1.6;
  --edge-pad: max(32px, calc(50% - 518px));
}

/* ─ Utility bar ─ */
.portal .utility-bar {
  font-size: 14px;
  padding: 10px var(--edge-pad);
  display: flex;
  justify-content: flex-end;
  gap: 24px;
}
.portal .utility-bar a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}
.portal .utility-bar a:hover { opacity: 0.8; text-decoration: underline; }

/* ─ Nav ─ */
.portal nav {
  background: var(--nav-bg);
  color: var(--nav-text);
  padding: 0 var(--edge-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.portal .nav-logo {
  font-family: var(--heading-font);
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}
.portal .nav-links {
  display: flex;
  gap: 28px;
  font-size: 15px;
  font-weight: 500;
}
.portal .nav-links a {
  color: inherit;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.portal .nav-links a:hover { opacity: 1; }
/* Hamburger — hidden by default, shown in mobile preview */
.portal .nav-hamburger { display: none; }

/* ─ Hero ─ */
.portal .hero {
  background: var(--hero-bg);
  color: #fff;
  padding: 56px var(--edge-pad);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.portal .hero h1 {
  font-family: var(--heading-font);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}
.portal .hero p {
  font-size: 18px;
  opacity: 0.92;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}
.portal .hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.portal .btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 14px 32px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--body-font);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.portal .btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.portal .btn-secondary {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 14px 32px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--body-font);
  cursor: pointer;
  transition: background 0.2s;
}
.portal .btn-secondary:hover { background: rgba(255,255,255,0.22); }

/* ─ Emergency strip ─ */
.portal .emergency-strip {
  padding: 14px var(--edge-pad);
  text-align: center;
  font-size: 15px;
  font-weight: 500;
}
.portal .emergency-strip strong { font-weight: 700; }

/* ─ Sections ─ */
.portal .section {
  padding: 48px 32px;
  max-width: 1100px;
  margin: 0 auto;
}
.portal .section-title {
  font-family: var(--heading-font);
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 24px;
}
.portal .section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}
.portal .section-header a {
  font-size: 15px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.portal .section-header a:hover { text-decoration: underline; }

/* ─ Quick links grid ─ */
.portal .quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.portal .quick-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius, 10px);
  padding: 24px;
  transition: box-shadow 0.25s, transform 0.2s;
  cursor: pointer;
}
.portal .quick-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  transform: translateY(-3px);
}
.portal .quick-card .qc-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--card-radius, 10px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}
.portal .quick-card .qc-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.75;
}
.portal .quick-card h3 {
  font-family: var(--heading-font);
  font-size: 17px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
}
.portal .quick-card p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ─ Announcements ─ */
.portal .announcement-list { display: flex; flex-direction: column; gap: 12px; }
.portal .announcement-item {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius, 10px);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  transition: box-shadow 0.25s;
  cursor: pointer;
}
.portal .announcement-item:hover { box-shadow: 0 3px 14px rgba(0,0,0,0.06); }
.portal .announcement-item h4 {
  font-size: 17px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}
.portal .announcement-item p { font-size: 15px; color: var(--text-secondary); line-height: 1.6; }
.portal .announcement-meta {
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}
.portal .badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: var(--badge-radius, 50px);
  margin-right: 8px;
  vertical-align: middle;
}
.portal .badge-pin {
  background: #fff3cd !important;
  color: #856404 !important;
}

/* ─ Info bar ─ */
.portal .info-bar {
  background: var(--card);
  border-top: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  padding: 36px var(--edge-pad);
}
.portal .info-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.portal .info-grid h4 {
  font-family: var(--heading-font);
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}
.portal .info-grid p,
.portal .info-grid li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.portal .info-grid ul { list-style: none; }
.portal .info-grid li::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: middle;
}

/* ─ Footer ─ */
.portal footer {
  padding: 44px var(--edge-pad);
  font-size: 14px;
  line-height: 1.8;
}
.portal .footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  text-align: left;
}
.portal footer h4 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  opacity: 0.6;
}
.portal footer a { color: inherit; text-decoration: none; }
.portal footer a:hover { text-decoration: underline; }
.portal .footer-bottom {
  grid-column: 1 / -1;
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  opacity: 0.6;
  font-size: 13px;
}

/* ─ Search bar (gov.pl style) ─ */
.portal .hero-search {
  max-width: 500px;
  margin: 0 auto 24px;
  display: flex;
  position: relative;
  z-index: 1;
}
.portal .hero-search input {
  flex: 1;
  padding: 14px 16px;
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 16px;
  font-family: var(--body-font);
  outline: none;
}
.portal .hero-search input::placeholder { color: rgba(255,255,255,0.6); }
.portal .hero-search button {
  padding: 14px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 16px;
  cursor: pointer;
}

/* ─ Category tabs ─ */
.portal .category-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--card-border);
  padding: 0 var(--edge-pad);
  background: var(--bg);
}
.portal .category-tabs button {
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  font-family: var(--body-font);
  transition: all 0.2s;
}
.portal .category-tabs button.active {
  color: var(--primary);
  border-bottom-color: var(--accent);
}
.portal .category-tabs button:hover { color: var(--primary); }

/* ─ Breadcrumbs ─ */
.portal .breadcrumbs {
  padding: 12px var(--edge-pad);
  font-size: 14px;
  color: var(--text-secondary);
  background: var(--bg);
}
.portal .breadcrumbs a {
  color: var(--accent);
  text-decoration: none;
}
.portal .breadcrumbs a:hover { text-decoration: underline; }
.portal .breadcrumbs span { margin: 0 6px; opacity: 0.5; }

/* ─ Dark mode toggle ─ */
.dark-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
  color: #ccc;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 12px;
}
.dark-toggle:hover { border-color: rgba(255,255,255,0.4); color: #fff; }
.dark-toggle.active { background: rgba(255,255,255,0.15); color: #fff; }

/* ══════════════════════════════════════════
   MOBILE PREVIEW — scoped to .mobile-preview
   ══════════════════════════════════════════ */

.mobile-preview .portal {
  --edge-pad: 16px;
}

/* ─ Utility bar ─ */
.mobile-preview .portal .utility-bar {
  font-size: 12px;
  gap: 12px;
  padding: 8px 16px;
}

/* ─ Nav ─ */
.mobile-preview .portal nav {
  height: 56px;
  padding: 0 16px;
}
.mobile-preview .portal .nav-logo {
  font-size: 15px;
}
.mobile-preview .portal .nav-links {
  display: none;
}
.mobile-preview .portal .nav-hamburger {
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 8px;
}
.mobile-preview .portal .nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

/* ─ Hero ─ */
.mobile-preview .portal .hero {
  padding: 36px 16px;
}
.mobile-preview .portal .hero h1 {
  font-size: 24px;
}
.mobile-preview .portal .hero p {
  font-size: 15px;
  margin-bottom: 20px;
}
.mobile-preview .portal .hero-actions {
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}
.mobile-preview .portal .btn-primary,
.mobile-preview .portal .btn-secondary {
  padding: 12px 20px;
  font-size: 15px;
  text-align: center;
  width: 100%;
}

/* ─ Hero search ─ */
.mobile-preview .portal .hero-search {
  max-width: 100%;
}
.mobile-preview .portal .hero-search input {
  padding: 12px 14px;
  font-size: 14px;
}
.mobile-preview .portal .hero-search button {
  padding: 12px 16px;
  font-size: 14px;
}

/* ─ Category tabs ─ */
.mobile-preview .portal .category-tabs {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px;
}
.mobile-preview .portal .category-tabs button {
  padding: 12px 16px;
  font-size: 12px;
  white-space: nowrap;
}

/* ─ Emergency strip ─ */
.mobile-preview .portal .emergency-strip {
  padding: 12px 16px;
  font-size: 13px;
}

/* ─ Sections ─ */
.mobile-preview .portal .section {
  padding: 32px 16px;
}
.mobile-preview .portal .section-title {
  font-size: 20px;
  margin-bottom: 16px;
}

/* ─ Quick grid ─ */
.mobile-preview .portal .quick-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}
.mobile-preview .portal .quick-card {
  padding: 20px;
}

/* ─ Announcements ─ */
.mobile-preview .portal .announcement-item {
  flex-direction: column;
  padding: 16px;
  gap: 8px;
}
.mobile-preview .portal .announcement-meta {
  align-self: flex-start;
}

/* ─ Info bar ─ */
.mobile-preview .portal .info-bar {
  padding: 28px 16px;
}
.mobile-preview .portal .info-grid {
  grid-template-columns: 1fr;
  gap: 24px;
}

/* ─ Footer ─ */
.mobile-preview .portal footer {
  padding: 32px 16px;
}
.mobile-preview .portal .footer-inner {
  grid-template-columns: 1fr;
  gap: 24px;
}
.mobile-preview .portal .footer-bottom {
  padding-top: 16px;
}

/* ══════════════════════════════════════════
   REAL MOBILE — @media queries for phones
   ══════════════════════════════════════════ */

@media (max-width: 768px) {
  .portal { --edge-pad: 16px; }

  /* Utility bar */
  .portal .utility-bar { font-size: 12px; gap: 12px; padding: 8px 16px; }

  /* Nav */
  .portal nav { height: 56px; padding: 0 16px; }
  .portal .nav-logo { font-size: 15px; }
  .portal .nav-links { display: none; }
  .portal .nav-hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 8px;
  }
  .portal .nav-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
  }

  /* Hero */
  .portal .hero { padding: 36px 16px; text-align: center; }
  .portal .hero h1 { font-size: 24px; max-width: 100%; }
  .portal .hero p { font-size: 15px; margin-bottom: 20px; max-width: 100%; }
  .portal .hero-actions {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    justify-content: center;
  }
  .portal .btn-primary,
  .portal .btn-secondary {
    padding: 12px 20px;
    font-size: 15px;
    text-align: center;
    width: 100%;
  }

  /* Hero search */
  .portal .hero-search { max-width: 100%; }
  .portal .hero-search input { padding: 12px 14px; font-size: 14px; }
  .portal .hero-search button { padding: 12px 16px; font-size: 14px; }

  /* Category tabs */
  .portal .category-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0 16px; }
  .portal .category-tabs button { padding: 12px 16px; font-size: 12px; white-space: nowrap; }

  /* Emergency strip */
  .portal .emergency-strip { padding: 12px 16px; font-size: 13px; }

  /* Sections */
  .portal .section { padding: 32px 16px; max-width: 100%; }
  .portal .section-title { font-size: 20px; margin-bottom: 16px; }

  /* Quick grid */
  .portal .quick-grid { grid-template-columns: 1fr; gap: 12px; }
  .portal .quick-card { padding: 20px; }

  /* Announcements */
  .portal .announcement-item { flex-direction: column; padding: 16px; gap: 8px; }
  .portal .announcement-meta { align-self: flex-start; }

  /* Info bar */
  .portal .info-bar { padding: 28px 16px; }
  .portal .info-grid { grid-template-columns: 1fr; gap: 24px; }

  /* Footer */
  .portal footer { padding: 32px 16px; }
  .portal .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .portal .footer-bottom { padding-top: 16px; }

  /* Photo banners */
  .modern .photo-banner,
  .modern-gov .photo-banner { grid-template-columns: 1fr; }
  .modern .photo-banner-content,
  .modern-gov .photo-banner-content { padding: 28px 20px; }
  .modern .photo-banner-img,
  .modern-gov .photo-banner-img { min-height: 140px; }

  /* Gov.pl promo */
  .govpl .promo-banner { grid-template-columns: 1fr; }
  .govpl .promo-content { padding: 28px 20px; }
  .govpl .promo-content h2 { font-size: 20px; }
  .govpl .promo-photo { min-height: 160px; }
  .govpl .govpl-benefits { grid-template-columns: 1fr; gap: 20px; }
  .govpl .govpl-benefits-section { padding: 28px 16px; }

  /* Green wave — reduce padding */
  .green .hero { padding-bottom: 52px; }

  /* Civic */
  .civic .section { max-width: 100%; }
}
