/* ==========================================================================
   I Am Covered Ltd - Blog landing page
   ========================================================================== */

:root {
  --navy-900: #071b3d;
  --navy-800: #0b2b5c;
  --navy-700: #103a7a;
  --blue-600: #1257b0;
  --blue-500: #1e6fd9;
  --blue-300: #4fa8e8;
  --cyan-300: #2fc0f0;
  --orange:   #f26522;
  --orange-d: #d9531a;
  --ink:      #1c2536;
  --ink-soft: #4d5a70;
  --line:     #dfe5ee;
  --paper:    #ffffff;
  --paper-2:  #f4f7fb;
  --radius:   14px;
  --shadow:   0 6px 24px rgba(7, 27, 61, .10);
  --shadow-h: 0 14px 40px rgba(7, 27, 61, .18);
  --wrap:     1180px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper-2);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: .94rem;
  line-height: 1;
  padding: 13px 24px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.btn:hover { text-decoration: none; }

.btn-quote {
  background: var(--orange);
  color: #fff;
}
.btn-quote:hover {
  background: var(--orange-d);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(242, 101, 34, .32);
}
.btn-lg { padding: 16px 34px; font-size: 1rem; }

/* --- Header ------------------------------------------------------------- */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 104px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.logo { display: inline-flex; align-items: center; }
.logo:hover { text-decoration: none; }

.logo img {
  width: auto;
  height: 80px;
  max-width: 100%;
}

.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a {
  font-weight: 500;
  font-size: .95rem;
  color: var(--navy-800);
}
.site-nav a.is-active { color: var(--orange); }
.site-nav a.btn-quote { color: #fff; }

/* --- Page hero ---------------------------------------------------------- */

.page-hero {
  position: relative;
  padding: 66px 0 78px;
  color: #fff;
  background:
    radial-gradient(120% 90% at 88% 18%, rgba(242,101,34,.55) 0%, rgba(242,101,34,0) 55%),
    radial-gradient(100% 120% at 10% 90%, rgba(30,111,217,.65) 0%, rgba(30,111,217,0) 60%),
    linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 42%, var(--blue-600) 100%);
  /* Deliberately no overflow:hidden — it would clip the search dropdown.
     The decorative circle below is sized to stay inside the hero instead. */
}
.page-hero::after {
  content: "";
  position: absolute;
  right: 4%;
  top: 50%;
  transform: translateY(-50%);
  width: 420px;
  height: 420px;
  max-width: 46%;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.16);
  pointer-events: none;
}
.page-hero .wrap { position: relative; z-index: 1; }

.page-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4.4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.hero-intro {
  margin: 0 0 30px;
  max-width: 640px;
  font-size: 1.06rem;
  color: rgba(255,255,255,.86);
}

/* --- Search ------------------------------------------------------------- */

.search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 999px;
  padding: 6px 6px 6px 20px;
  backdrop-filter: blur(6px);
}

.search-form input[type="search"] {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  padding: 10px 0;
}
.search-form input::placeholder { color: rgba(255,255,255,.62); }
.search-form input[type="search"]::-webkit-search-cancel-button { filter: invert(1) opacity(.7); }

.btn-search {
  background: var(--orange);
  color: #fff;
  width: 44px; height: 44px;
  padding: 0;
  flex: 0 0 44px;
  border-radius: 50%;
}
.btn-search:hover { background: var(--orange-d); }

.clear-search {
  color: rgba(255,255,255,.8);
  font-size: .88rem;
  padding-right: 12px;
  white-space: nowrap;
}
.clear-search:hover { color: #fff; }

.result-count {
  margin: 18px 0 0;
  font-size: .94rem;
  color: rgba(255,255,255,.82);
}

/* --- Live search suggestions -------------------------------------------- */

.search-wrap {
  position: relative;
  max-width: 560px;
  z-index: 20;
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: 0 18px 46px rgba(7, 27, 61, .28);
  overflow: hidden;
  text-align: left;
}

.search-suggestions[hidden] { display: none; }

.search-suggestions.is-loading::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  height: 3px;
  width: 40%;
  background: var(--orange);
  animation: suggest-bar 1s ease-in-out infinite;
}

@keyframes suggest-bar {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

.suggest-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 340px;
  overflow-y: auto;
}

.suggest-item a {
  display: block;
  padding: 12px 16px;
  border-radius: 9px;
  font-size: .96rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--navy-800);
}
.suggest-item a:hover { text-decoration: none; }

.suggest-item:hover a,
.suggest-item.is-active a {
  background: var(--paper-2);
  color: var(--blue-600);
}

.suggest-item mark {
  background: rgba(242, 101, 34, .18);
  color: inherit;
  font-weight: 600;
  border-radius: 3px;
  padding: 0 1px;
}

.suggest-empty {
  margin: 0;
  padding: 18px 20px;
  font-size: .93rem;
  color: var(--ink-soft);
}

.suggest-more {
  margin: 0;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  font-size: .88rem;
  font-weight: 600;
}
.suggest-more a { color: var(--orange); }

/* --- Main --------------------------------------------------------------- */

.main-content { padding: 56px 24px 76px; }

/* --- Tile grid ---------------------------------------------------------- */

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.post-tile {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.post-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-h);
}

.tile-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}
.tile-link:hover { text-decoration: none; }

.tile-media {
  aspect-ratio: 16 / 9;
  background: var(--paper-2);
  overflow: hidden;
}
.tile-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.post-tile:hover .tile-media img { transform: scale(1.05); }

.tile-media-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--blue-600) 100%);
}
.fallback-mark {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, var(--orange) 0deg 250deg, rgba(255,255,255,.18) 250deg 360deg);
}

.tile-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 24px 26px;
}

.tile-date {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 10px;
}

.tile-title {
  margin: 0 0 10px;
  font-size: 1.16rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--navy-800);
}

.tile-excerpt {
  margin: 0 0 18px;
  font-size: .94rem;
  color: var(--ink-soft);
}

.tile-cta {
  margin-top: auto;
  font-size: .92rem;
  font-weight: 600;
  color: var(--blue-600);
}
.post-tile:hover .tile-cta { color: var(--orange); }

/* --- Pagination --------------------------------------------------------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 48px;
  flex-wrap: wrap;
}

.page-btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: .92rem;
  font-weight: 600;
  color: var(--navy-800);
}
a.page-btn:hover {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
  text-decoration: none;
}
.page-btn.is-disabled { opacity: .42; }

.page-status { font-size: .9rem; color: var(--ink-soft); }

/* --- Notices ------------------------------------------------------------ */

.notice {
  background: var(--paper);
  border-radius: var(--radius);
  border-left: 4px solid var(--blue-500);
  box-shadow: var(--shadow);
  padding: 26px 28px;
  max-width: 640px;
}
.notice p { margin: 0 0 8px; }
.notice p:last-child { margin-bottom: 0; }
.notice-error { border-left-color: var(--orange); }

/* --- Single post -------------------------------------------------------- */

.single { max-width: 820px; }

.back-link {
  display: inline-block;
  margin-bottom: 26px;
  font-size: .93rem;
  font-weight: 600;
  color: var(--blue-600);
}

.single-post {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.single-header { padding: 40px 44px 8px; }

.single-date {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 12px;
}

.single-title {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -.015em;
  color: var(--navy-800);
}

.single-author {
  margin: 0;
  font-size: .9rem;
  color: var(--ink-soft);
}

.single-media { margin: 30px 0 0; }
.single-media img { width: 100%; }

.single-content { padding: 34px 44px 8px; }
.single-content > *:first-child { margin-top: 0; }

.single-content p { margin: 0 0 1.25em; }

.single-content h2,
.single-content h3,
.single-content h4 {
  color: var(--navy-800);
  font-weight: 600;
  line-height: 1.3;
  margin: 1.9em 0 .6em;
}
.single-content h2 { font-size: 1.5rem; }
.single-content h3 { font-size: 1.24rem; }
.single-content h4 { font-size: 1.08rem; }

.single-content ul,
.single-content ol { margin: 0 0 1.35em; padding-left: 1.35em; }
.single-content li { margin-bottom: .5em; }

.single-content blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 22px;
  border-left: 4px solid var(--orange);
  color: var(--ink-soft);
  font-style: italic;
}

.single-content img { border-radius: 10px; margin: 1.6em 0; }

.single-content a { color: var(--blue-600); text-decoration: underline; }
.single-content a:hover { color: var(--orange); }

.single-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: .94rem;
}
.single-content th,
.single-content td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
}
.single-content th { background: var(--paper-2); font-weight: 600; }

.single-origin {
  margin: 26px 44px 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.single-origin p { margin: 0; }
.single-origin a {
  font-weight: 600;
  color: var(--orange);
}

/* --- Footer ------------------------------------------------------------- */

.site-footer {
  color: #fff;
  background:
    radial-gradient(110% 120% at 85% 15%, rgba(242,101,34,.42) 0%, rgba(242,101,34,0) 58%),
    linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 48%, var(--blue-600) 100%);
  padding: 62px 0 44px;
}

.footer-cta {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 52px;
}
.footer-cta h2 {
  margin: 0 0 12px;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
}
.footer-cta p {
  margin: 0 0 26px;
  color: rgba(255,255,255,.84);
}

/* Footer columns */

.footer-cols {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  text-align: left;
}

.footer-col h3 {
  margin: 0 0 16px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: rgba(255,255,255,.62);
}

.footer-blurb {
  margin: 0 0 22px;
  max-width: 34ch;
  font-size: .93rem;
  line-height: 1.7;
  color: rgba(255,255,255,.78);
}

.footer-badge {
  display: block;
  line-height: 0;
  opacity: .9;
  transition: opacity .18s ease;
}
.footer-badge:hover { opacity: 1; text-decoration: none; }
.footer-badge img { height: 36px; width: auto; border: 0; }

.footer-links,
.footer-social {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li { margin-bottom: 11px; }
.footer-links a {
  font-size: .92rem;
  color: rgba(255,255,255,.82);
}
.footer-links a:hover { color: #fff; text-decoration: none; }

.footer-social li { margin-bottom: 11px; }

.footer-social a {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: .92rem;
  color: rgba(255,255,255,.82);
}
.footer-social a:hover { color: #fff; text-decoration: none; }

.footer-social svg {
  flex: 0 0 auto;
  color: #fff;
  transition: transform .18s ease;
}
.footer-social a:hover svg { transform: translateY(-2px); }

.footer-legal {
  border-top: 1px solid rgba(255,255,255,.18);
  padding-top: 28px;
  font-size: .78rem;
  line-height: 1.65;
  color: rgba(255,255,255,.6);
  text-align: left;
  max-width: 900px;
}
.footer-legal p { margin: 0 0 10px; }
.copyright {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.5);
}

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 860px) {
  .header-inner { flex-wrap: wrap; min-height: 0; }
  .site-nav { gap: 18px; }
  .single-header,
  .single-content { padding-left: 26px; padding-right: 26px; }
  .single-origin { margin-left: 26px; margin-right: 26px; }
  .footer-cols {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .footer-col-brand { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .page-hero { padding: 46px 0 56px; }
  .post-grid { grid-template-columns: 1fr; gap: 22px; }
  .search-form { padding-left: 16px; }
  .site-nav a:not(.btn) { font-size: .9rem; }
  .main-content { padding-top: 40px; }
  .logo img { height: 85px; }
  .footer-cols {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}
