/* ══════════════════════════════════════════════════════════════════════
   «Останні новини» на головній — картки нового сайту (dev3.getgrant.ua),
   перенесені на стару ПРОДівську тему `getgrants`.

   Правила `.hn-*` взято з astro-frontend/src/styles/main.css у вихідному
   порядку і зсунуто під `.hn-page`: префікс тримає їх подалі від решти
   головної і перебиває глобальні правила теми.
   ══════════════════════════════════════════════════════════════════════ */

.hn-page {
  --blue:       #0166b0;
  --blue-dark:  #0152A0;
  --navy:       #0D1B3E;
  --surface:    #F8F9FB;
  --border:     #E8ECEF;
  --border-mid: #D4D8DF;
  --text:       #1A202C;
  --text-body:  #374151;
  --text-muted: #6B7280;
  --text-faint: #9CA3AF;
  --r-xs: 4px; --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 2px 6px rgba(0,0,0,.06);
  --shadow-md: 0 4px 14px rgba(0,0,0,.07);
  --t: .16s ease;

  font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
}
.hn-page *, .hn-page *::before, .hn-page *::after { box-sizing: border-box; }
.hn-page h2, .hn-page h3, .hn-page p {
  margin: 0; padding: 0; font-family: inherit; text-transform: none; line-height: inherit;
}
.hn-page a { text-decoration: none; }
.hn-page img { max-width: 100%; }

/* Шапка розділу */
.hn-page .hn-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1.5rem; margin-bottom: 2rem; flex-wrap: wrap;
}
.hn-page .hn-see-all {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--blue);
  white-space: nowrap; transition: gap var(--t);
}
.hn-page .hn-see-all:hover { gap: 10px; color: var(--blue-dark); }

.hn-page .gh-container {
  max-width: 1160px; margin: 0 auto; padding: 0 1.5rem;
}
.hn-page .gh-hero .gh-container {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center;
}
@media(max-width: 768px) {
.hn-page .gh-hero .gh-container {
  grid-template-columns: 1fr; gap: 2rem;
}
}
@media (max-width: 768px) {
.hn-page .gh-hero .gh-container {
  grid-template-columns: 1fr;
}
}
.hn-page .gh-hero .gh-container {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center;
}
.hn-page .gh-hero .gh-container {
  position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center;
}
@media (max-width: 900px) {
.hn-page .gh-hero .gh-container {
  grid-template-columns: 1fr;
}
}
@media (min-width: 768px) and (max-width: 1023px) {
.hn-page .gh-container {
  padding: 0 1.5rem;
}
.hn-page .gh-hero .gh-container {
  grid-template-columns: 1fr 1fr; gap: 2rem;
}
}
@media (max-width: 767px) {
.hn-page .gh-container {
  padding: 0 1rem;
}
.hn-page .gh-hero .gh-container {
  grid-template-columns: 1fr; gap: 0;
}
}
.hn-page .hn-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.hn-page .hn-card {
  background: #fff;
  border: 1px solid var(--border, #E8ECEF);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .16s ease;
}
.hn-page .hn-card:hover {
  border-color: #C5CDD8;
}
.hn-page .hn-card-img {
  display: block;
  position: relative;
  height: 200px;          
  width: 100%;
  overflow: hidden;
  text-decoration: none;
  flex-shrink: 0;
}
.hn-page .hn-card-img-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .35;
}
.hn-page .hn-card-img-foot {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: linear-gradient(to top, rgba(0,0,0,.55) 0%, transparent 100%);
}
.hn-page .hn-card-cat-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 8px;
  border-radius: 4px;
  line-height: 1.5;
}
.hn-page .hn-card-date {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,.82);
  letter-spacing: .02em;
}
.hn-page .hn-card-body {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: 1.1rem 1.1rem 1rem;
  flex: 1;
}
.hn-page .hn-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-faint, #9CA3AF);
}
.hn-page .hn-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy, #0D1B3E);
  line-height: 1.4;
  margin: 0;
  letter-spacing: -.01em;
}
.hn-page .hn-card-title a {
  color: inherit; text-decoration: none;
}
.hn-page .hn-card-title a:hover {
  color: var(--blue, #0166b0);
}
.hn-page .hn-card-desc {
  font-size: 13px;
  color: var(--text-muted, #6B7280);
  line-height: 1.65;
  margin: 0;
  flex: 1;
  
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: visible;
}
.hn-page .hn-card-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue, #0166b0);
  text-decoration: none;
  margin-top: .2rem;
  transition: gap .15s;
}
.hn-page .hn-card-link:hover {
  gap: 8px;
}
.hn-page .hn-btn-blog {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue, #0166b0);
  background: #fff;
  border: 1.5px solid var(--border-mid, #D4D8DF);
  border-radius: 8px;
  padding: 12px 26px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.hn-page .hn-btn-blog:hover {
  border-color: var(--blue, #0166b0); background: #F0F5FB;
}
@media (max-width: 1023px) {
.hn-page .hn-grid {
  grid-template-columns: 1fr 1fr; gap: 1rem;
}
}
@media (max-width: 767px) {
.hn-page .hn-section {
  padding: 3rem 0;
}
.hn-page .hn-header {
  flex-direction: column; align-items: flex-start; gap: .85rem;
}
.hn-page .hn-see-all {
  display: none;
}
.hn-page .hn-grid {
  grid-template-columns: 1fr; gap: .85rem;
}
.hn-page .hn-card-img {
  height: 170px;
}
.hn-page .hn-card-body {
  padding: 1rem .9rem .85rem;
}
.hn-page .hn-card-title {
  font-size: 13px;
}
.hn-page .hn-btn-blog {
  width: 100%; justify-content: center;
}
.hn-page .hn-header-sub {
  font-size: 14px;
}
}
.hn-page .hn-card-img {
  display: block;
  position: relative;
  height: 200px;
  width: 100%;
  overflow: hidden;
  text-decoration: none;
  flex-shrink: 0;
}
.hn-page .hn-card-img-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .28;
}
.hn-page .hn-card-img-foot {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: linear-gradient(to top, rgba(0,0,0,.55) 0%, transparent 100%);
}
.hn-page .hn-card-cat-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 8px;
  border-radius: 4px;
  line-height: 1.5;
}
.hn-page .hn-card-date {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,.82);
  letter-spacing: .02em;
}
.hn-page .hn-section {
  background: #F4F7FB; border-top: 1px solid #E8ECF2; border-bottom: 1px solid #E8ECF2;
}
.hn-page .hn-section {
  background: #fff; padding: 5rem 0; border-top: 1px solid #EAECF0;
}
.hn-page .hn-header {
  display:flex; align-items:flex-end; justify-content:space-between; margin-bottom:2.5rem;
}
.hn-page .hn-header .gh-section-title {
  margin:0;
}
.hn-page .hn-see-all {
  display:inline-flex; align-items:center; gap:6px; font-size:13px; font-weight:600; color:#0166b0; cursor:pointer; white-space:nowrap; text-decoration:none;
}
.hn-page .hn-see-all:hover {
  text-decoration:underline;
}
.hn-page .hn-grid {
  display:grid; grid-template-columns:repeat(3,1fr); gap:1.5rem;
}
.hn-page .hn-card {
  background:#fff; border-radius:14px; overflow:hidden; border:1px solid #EAECF0; display:flex; flex-direction:column; transition:border-color .16s, box-shadow .16s;
}
.hn-page .hn-card:hover {
  border-color:#C5CDD8; box-shadow:0 6px 20px rgba(0,0,0,.07);
}
.hn-page .hn-card-img {
  display:block; position:relative; height:200px; text-decoration:none; flex-shrink:0; overflow:hidden;
}
.hn-page .hn-card-img-bg {
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
}
.hn-page .hn-card-img-overlay {
  position:absolute; inset:0; background:linear-gradient(to top,rgba(0,0,0,.3) 0%,rgba(0,0,0,0) 55%);
}
.hn-page .hn-card-body {
  padding:1.1rem 1.25rem 1rem; display:flex; flex-direction:column; gap:.5rem; flex:1;
}
.hn-page .hn-card-meta-row {
  display:flex; align-items:center; justify-content:space-between; gap:.5rem;
}
.hn-page .hn-tag {
  font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.07em; color:#6B7280; background:#F3F4F6; border-radius:4px; padding:2px 7px;
}
.hn-page .hn-card-date {
  font-size:12px; color:#9CA3AF; font-weight:400;
}
.hn-page .hn-card-title {
  font-size:15px; font-weight:700; color:#0D1B3E; line-height:1.42; letter-spacing:-.01em; margin:0;
}
.hn-page .hn-card--featured .hn-card-title {
  font-size:16px;
}
.hn-page .hn-card-title a {
  color:inherit; text-decoration:none;
}
.hn-page .hn-card-title a:hover {
  color:#0166b0;
}
.hn-page .hn-card-desc {
  font-size:13px; color:#6B7280; line-height:1.68; margin:0; flex:1;
}
.hn-page .hn-card-link {
  display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:600; color:#0166b0; text-decoration:none; margin-top:.35rem; transition:gap .15s;
}
.hn-page .hn-card-link:hover {
  gap:8px;
}
@media (max-width:1023px) {
.hn-page .hn-grid {
  grid-template-columns:1fr 1fr; gap:1.25rem;
}
}
@media (max-width:767px) {
.hn-page .hn-section {
  padding:3rem 0;
}
.hn-page .hn-header {
  flex-direction:column; align-items:flex-start; gap:.75rem;
}
.hn-page .hn-see-all {
  display:none;
}
.hn-page .hn-grid {
  grid-template-columns:1fr; gap:1rem;
}
.hn-page .hn-card-img {
  height:175px;
}
}
@media (max-width: 768px) {
.hn-page .gh-container {
  padding-left: 1rem; padding-right: 1rem;
}
}
@media (min-width: 769px) and (max-width: 1024px) {
.hn-page .gh-container {
  padding: 0 1.25rem;
}
}
.hn-page .hn-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 1.25rem !important;
  align-items: stretch !important;
}
@media (max-width: 800px) {
.hn-page .hn-grid {
  grid-template-columns: repeat(2, 1fr) !important;
}
}
@media (max-width: 560px) {
.hn-page .hn-grid {
  grid-template-columns: 1fr !important;
}
}
.hn-page .hn-card {
  display: flex !important;
  flex-direction: column !important;
}
.hn-page .hn-card-body {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
}
.hn-page .hn-card {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}
.hn-page .hn-card-img {
  height: 200px !important;
  flex-shrink: 0 !important;
}
.hn-page .hn-card-body {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 1.1rem 1.25rem 1.25rem !important;
}
.hn-page .hn-card-title {
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  margin: 0 0 .4rem !important;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hn-page .hn-card-desc {
  font-size: 14px !important;
  line-height: 1.65 !important;
  color: #6B7280 !important;
  margin: 0 !important;
  flex: 1 !important;
  
  display: block !important;
  overflow: visible !important;
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: unset !important;
}
.hn-page .hn-card-link {
  margin-top: .75rem !important;
  flex-shrink: 0;
}
.hn-page .hn-grid {
  align-items: start !important;
}
.hn-page .hn-card-desc {
  display: -webkit-box !important;
  -webkit-line-clamp: 5 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
.hn-page .gh-container {
  padding-left: 1rem !important; padding-right: 1rem !important;
}
.hn-page .hn-card {
  max-width: 100% !important;
    box-sizing: border-box !important;
}
/* Фокус із клавіатури. У джерелі це правило злите з переліком карток —
   на новому сайті бандлер його відкидає, а тут воно малювало синю обводку
   навколо кожної картки, тож лишаємо лише :focus-visible. */
.hn-page a:focus-visible,
.hn-page button:focus-visible {
  outline: 2px solid #0166b0;
  outline-offset: 2px;
  border-radius: 6px;
}
@media (min-width: 961px) {
.hn-page .gh-hero .gh-container {
  display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 3rem !important;
    align-items: center !important;
}
}
@media (max-width: 960px) {
.hn-page .gh-hero .gh-container {
  display: block !important;
    grid-template-columns: none !important;
}
}

/* Заголовок розділу — з design-system.css нового сайту */
.hn-page .gg-section-label {
  font-size: 12px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--blue); margin-bottom: .75rem;
}
.hn-page .gg-section-title {
  font-size: 24px; font-weight: 800; color: var(--navy);
  letter-spacing: -.02em; line-height: 1.6; margin: 0;
}
@media (max-width: 767px) {
  .hn-page .gg-section-title { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .hn-page * { animation: none !important; transition: none !important; }
}

/* Рамка плашки рубрики: у джерелі її ставить правило, яке до цього файлу
   не потрапило (живе поза `.hn-` селекторами), а на новому сайті вона є. */
.hn-page .hn-tag { border: 1px solid #E5E7EB; }

/* Фон розділу дає тема (.section-bg, #F0F4F8) — так само, як у «Можливості
   сервісу». Правило з нового сайту малює білий, тому знімаємо його. */
.hn-page .hn-section { background: transparent; }
/* Відступи вже дає .section теми — інакше вони подвоюються. */
.hn-page .hn-section { padding: 0; }
