/* ==========================================================================
   Coral Drift Theme — inspired by Telephasic's warm gradient + pattern DNA
   ========================================================================== */

/* --- CSS Variables --- */
:root {
  --color-bg: #f5f7fa;
  --color-surface: #ffffff;
  --color-text: #52575c;
  --color-heading: #42474c;
  --color-accent: #f35858;
  --color-accent-soft: rgba(243, 88, 88, 0.12);
  --color-border: #d2d7dc;
  --color-border-light: #e8e8e8;
  --color-muted: #a2a7ac;
  --color-hero-start: #FF7088;
  --color-hero-end: #F2B69D;
  --color-hero-mid: #f08c89;
  --color-input-bg: #f9fbfe;
  --radius: 0.35em;
  --font-main: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --container: 1140px;
  --transition: 0.25s ease-in-out;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  font-size: 14pt;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a {
  color: inherit;
  text-decoration: none;
  border-bottom: dotted 1px #62676c;
  transition: color var(--transition), border-color var(--transition);
}
a:hover {
  color: var(--color-accent);
  border-bottom-color: transparent;
}
h1, h2, h3, h4, h5, h6 {
  color: var(--color-heading);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
h1 { font-size: 2.4em; }
h2 { font-size: 1.8em; }
h3 { font-size: 1.35em; }
h4 { font-size: 1.1em; }
p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }
hr {
  border: 0;
  border-top: solid 1px var(--color-border);
  margin: 2em 0;
}
blockquote {
  border-left: solid 0.5em var(--color-border);
  padding: 0.5em 0 0.5em 1.5em;
  font-style: italic;
}

/* --- Container --- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 2em;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.65em 2em;
  border: solid 1px var(--color-border);
  border-radius: var(--radius);
  background: none;
  color: inherit;
  font-family: var(--font-main);
  font-size: 1em;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  border-bottom: solid 1px var(--color-border);
  line-height: 1.5;
}
.btn:hover {
  color: var(--color-accent);
  border-color: rgba(243, 88, 88, 0.5);
  background: none;
}
.btn--hero {
  background: #fff;
  border-color: transparent;
  color: var(--color-hero-mid);
  font-size: 1.1em;
}
.btn--hero:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.75);
  color: #fff;
}
.btn--accent {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}
.btn--accent:hover {
  background: #e04545;
  border-color: #e04545;
  color: #fff;
}

/* --- Pattern overlay (Telephasic DNA) --- */
.has-pattern {
  position: relative;
}
.has-pattern::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='6' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 0h1L0 5V4zM6 5v1H5z' fill='%23ffffff' fill-opacity='0.04'/%3E%3C/svg%3E");
  background-size: 6px 6px;
  pointer-events: none;
  z-index: 0;
}
.has-pattern > * { position: relative; z-index: 1; }

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header-wrap {
  background: linear-gradient(75deg, var(--color-hero-start) 15%, var(--color-hero-end) 55%);
  background-color: var(--color-hero-mid);
  position: relative;
}
.site-header-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='6' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 0h1L0 5V4zM6 5v1H5z' fill='%23ffffff' fill-opacity='0.06'/%3E%3C/svg%3E");
  background-size: 6px 6px;
  pointer-events: none;
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1em 2em;
  max-width: var(--container);
  margin: 0 auto;
}

.site-logo a {
  display: inline-block;
  padding: 0.3em 1.5em;
  background: rgba(255,255,255,0.15);
  border: solid 1px rgba(255,255,255,0.75);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  color: #fff;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 1.1em;
  border-bottom: solid 1px rgba(255,255,255,0.75);
}
.site-logo a:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* Desktop Nav */
.main-nav { display: flex; align-items: center; gap: 0.25em; }
.main-nav a {
  color: #fff;
  border: solid 1px transparent;
  border-radius: var(--radius);
  padding: 0.3em 1em;
  border-bottom: solid 1px transparent;
  transition: border-color var(--transition), background var(--transition);
  font-size: 0.95em;
  white-space: nowrap;
}
.main-nav a:hover {
  border-color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5em;
  z-index: 100;
}
.hamburger span {
  display: block;
  width: 26px;
  height: 3px;
  background: #fff;
  margin: 5px 0;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.is-active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.hamburger.is-active span:nth-child(2) { opacity: 0; }
.hamburger.is-active span:nth-child(3) { transform: rotate(-45deg) translate(6px, -7px); }

/* Mobile Nav */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 90;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5em;
}
.mobile-nav.is-open { display: flex; }
.mobile-nav a {
  color: #fff;
  font-size: 1.5em;
  font-weight: 600;
  border-bottom: dotted 1px rgba(255,255,255,0.3);
  padding: 0.25em 0;
}
.mobile-nav a:hover { color: var(--color-hero-end); border-bottom-color: transparent; }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 5em 2em 6em;
  max-width: var(--container);
  margin: 0 auto;
  color: #fff;
}
.hero h1 {
  color: #fff;
  font-size: 2.75em;
  margin-bottom: 0.3em;
  font-weight: 700;
}
.hero .hero-subtitle {
  font-size: 1.35em;
  line-height: 1.6;
  margin-bottom: 1.5em;
  opacity: 0.92;
}
.hero .hero-subtitle p { margin-bottom: 0.5em; }
.hero .hero-subtitle a {
  color: #fff;
  border-bottom-color: rgba(255,255,255,0.5);
}
.hero .hero-subtitle a:hover { border-bottom-color: transparent; }

/* ==========================================================================
   SECTIONS — alternating bg from Telephasic
   ========================================================================== */
.section { padding: 5em 0; }
.section--white { background: var(--color-surface); }
.section--grey { background: var(--color-bg); }
.section--accent {
  background: linear-gradient(75deg, var(--color-hero-start) 15%, var(--color-hero-end) 55%);
  color: #fff;
}
.section--accent h2, .section--accent h3 { color: #fff; }

.section-header {
  text-align: center;
  margin-bottom: 3em;
}
.section-header h2 {
  font-size: 2em;
  margin-bottom: 0.4em;
}
.section-header p {
  color: var(--color-muted);
  font-size: 1.15em;
}

/* ==========================================================================
   TOPICS — 2-column asymmetric inspired by Telephasic features
   ========================================================================== */
.topics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3em;
}
.topic-card {
  position: relative;
  padding: 2em 0;
}
.topic-card:nth-child(even) { padding-top: 4em; }
.topic-card h3 {
  font-size: 1.5em;
  margin-bottom: 0.6em;
}
.topic-card .topic-desc { line-height: 1.7; }
.topic-card::after {
  content: '';
  display: block;
  width: 3em;
  height: 3px;
  background: var(--color-accent);
  margin-top: 1.5em;
  border-radius: 2px;
}

/* ==========================================================================
   LATEST POSTS — editorial staggered layout
   ========================================================================== */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5em 3em;
}
.post-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: solid 1px var(--color-border-light);
  transition: box-shadow var(--transition);
}
.post-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.post-card:first-child {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: stretch;
}
.post-card:first-child .post-card__img { min-height: 320px; }
.post-card__img {
  position: relative;
  overflow: hidden;
  min-height: 200px;
  background: var(--color-bg);
}
.post-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.post-card__body { padding: 1.75em 2em; }
.post-card__date {
  display: inline-block;
  font-size: 0.85em;
  color: var(--color-muted);
  margin-bottom: 0.6em;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.post-card__title {
  font-size: 1.35em;
  margin-bottom: 0.5em;
}
.post-card__title a { border-bottom: none; }
.post-card__title a:hover { color: var(--color-accent); }
.post-card__excerpt {
  color: var(--color-text);
  line-height: 1.7;
  margin-bottom: 1em;
}
.post-card__link {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85em;
  letter-spacing: 1px;
  border-bottom: dotted 1px;
}

/* ==========================================================================
   FAQ — editorial accordion style
   ========================================================================== */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item {
  border-top: solid 1px var(--color-border);
  padding: 1.5em 0;
}
.faq-item:last-child { border-bottom: solid 1px var(--color-border); }
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.1em;
  color: var(--color-heading);
  gap: 1em;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-main);
  padding: 0;
  line-height: 1.5;
}
.faq-question:hover { color: var(--color-accent); }
.faq-icon {
  flex-shrink: 0;
  width: 1.5em;
  height: 1.5em;
  border: solid 1px var(--color-border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
  transition: transform var(--transition), background var(--transition);
  color: var(--color-muted);
  line-height: 1;
}
.faq-item.is-open .faq-icon {
  transform: rotate(45deg);
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}
.faq-answer {
  display: none;
  padding-top: 1em;
  line-height: 1.8;
}
.faq-item.is-open .faq-answer { display: block; }

/* ==========================================================================
   PROMO BANNER — Telephasic-inspired CTA band
   ========================================================================== */
.promo-banner {
  text-align: center;
  padding: 5em 2em;
  position: relative;
  overflow: hidden;
}
.promo-banner .promo-inner {
  display: inline-flex;
  align-items: center;
  gap: 1.5em;
  background: rgba(255,255,255,0.05);
  border: solid 1px rgba(255,255,255,0.25);
  border-radius: 0.5em;
  padding: 1.75em 2.5em;
  flex-wrap: wrap;
  justify-content: center;
}
.promo-banner h2 {
  font-size: 1.6em;
  margin: 0;
  color: #fff;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer-wrap {
  border-top: solid 1px var(--color-border);
  padding: 4em 0 3em;
  position: relative;
  background: var(--color-bg);
}
.site-footer-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 0 L40 20 L20 40 L0 20Z' fill='none' stroke='%23d2d7dc' stroke-width='0.5' opacity='0.3'/%3E%3C/svg%3E");
  background-size: 40px 40px;
  pointer-events: none;
}

.site-footer {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 3em;
}
.footer-brand .footer-name {
  font-size: 1.3em;
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 0.5em;
}
.footer-brand .footer-tagline {
  color: var(--color-muted);
  line-height: 1.7;
  margin-bottom: 1em;
}
.footer-heading {
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-muted);
  margin-bottom: 1.2em;
  font-weight: 600;
}
.footer-nav { list-style: none; }
.footer-nav li { padding: 0.35em 0; }
.footer-nav a { border-bottom: dotted 1px var(--color-border); }
.footer-nav a:hover { color: var(--color-accent); border-bottom-color: transparent; }

.footer-contact-email a {
  border-bottom: dotted 1px;
}

.site-copyright {
  position: relative;
  z-index: 1;
  text-align: center;
  border-top: solid 1px var(--color-border);
  padding-top: 2.5em;
  margin-top: 3em;
  color: var(--color-muted);
  font-size: 0.9em;
}

/* ==========================================================================
   PAGE TEMPLATE
   ========================================================================== */
.page-header-wrap {
  padding: 3em 0 2em;
}
.page-title {
  color: #fff;
  text-align: center;
  font-size: 2.4em;
}
.page-content {
  background: var(--color-surface);
  padding: 4em 0;
}
.page-content .content-area {
  max-width: 780px;
  margin: 0 auto;
  line-height: 1.85;
}
.page-content .content-area h2 { margin: 1.5em 0 0.6em; }
.page-content .content-area h3 { margin: 1.3em 0 0.5em; }
.page-content .content-area p { margin-bottom: 1.2em; }
.page-content .content-area ul,
.page-content .content-area ol {
  margin: 0 0 1.2em 1.5em;
}
.page-content .content-area a {
  color: var(--color-accent);
}

/* ==========================================================================
   BLOG INDEX
   ========================================================================== */
.blog-header { text-align: center; margin-bottom: 3em; }
.blog-header h1 { font-size: 2.2em; }

.blog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5em;
}
.blog-card {
  background: var(--color-surface);
  border: solid 1px var(--color-border-light);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.blog-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.blog-card__img {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: var(--color-bg);
}
.blog-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.blog-card__body { padding: 1.5em 1.75em; }
.blog-card__date {
  font-size: 0.8em;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5em;
  display: block;
}
.blog-card__title {
  font-size: 1.25em;
  margin-bottom: 0.5em;
}
.blog-card__title a { border-bottom: none; }
.blog-card__title a:hover { color: var(--color-accent); }
.blog-card__excerpt { line-height: 1.7; }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  margin-top: 3em;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5em;
  height: 2.5em;
  padding: 0.25em 0.75em;
  border: solid 1px var(--color-border);
  border-radius: var(--radius);
  font-weight: 600;
  transition: all var(--transition);
  border-bottom: solid 1px var(--color-border);
}
.pagination a:hover {
  color: var(--color-accent);
  border-color: rgba(243,88,88,0.5);
}
.pagination .active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

/* ==========================================================================
   POST TEMPLATE
   ========================================================================== */
.post-header-wrap {
  padding: 3em 0 2em;
}
.post-meta {
  text-align: center;
  color: rgba(255,255,255,0.75);
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.post-hero-title {
  text-align: center;
  color: #fff;
  font-size: 2.4em;
  margin-top: 0.3em;
}
.post-cover {
  max-width: 900px;
  margin: -2em auto 0;
  position: relative;
  z-index: 2;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.post-cover img {
  width: 100%;
  display: block;
}
.post-body {
  background: var(--color-surface);
  padding: 4em 0;
}
.post-body .content-area {
  max-width: 740px;
  margin: 0 auto;
  line-height: 1.85;
}
.post-body .content-area h2 { margin: 1.8em 0 0.6em; font-size: 1.6em; }
.post-body .content-area h3 { margin: 1.5em 0 0.5em; }
.post-body .content-area p { margin-bottom: 1.2em; }
.post-body .content-area img { border-radius: var(--radius); margin: 1.5em 0; }
.post-body .content-area ul,
.post-body .content-area ol { margin: 0 0 1.2em 1.5em; }
.post-body .content-area a { color: var(--color-accent); }
.post-body .content-area blockquote {
  border-left-color: var(--color-accent);
  margin: 1.5em 0;
  padding: 0.75em 1.5em;
  background: var(--color-accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.post-excerpt-block {
  font-size: 1.15em;
  color: var(--color-muted);
  border-left: 3px solid var(--color-accent);
  padding-left: 1.25em;
  margin-bottom: 2em;
  line-height: 1.7;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Tablet */
@media screen and (max-width: 1080px) {
  body { font-size: 13pt; }
  .section { padding: 4em 0; }
  .hero { padding: 3em 2em 4em; }
  .hero h1 { font-size: 2.2em; }
  .topics-grid { gap: 2em; }
  .topic-card:nth-child(even) { padding-top: 2em; }
  .site-footer { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .post-card:first-child { grid-template-columns: 1fr; }
  .post-card:first-child .post-card__img { min-height: 240px; }
}

/* Mobile */
@media screen and (max-width: 768px) {
  body { font-size: 12pt; }
  .container { padding: 0 1.25em; }
  .section { padding: 3em 0; }

  /* Nav */
  .main-nav { display: none; }
  .hamburger { display: block; }

  /* Hero */
  .hero { padding: 2em 1.25em 3em; }
  .hero h1 { font-size: 1.8em; }
  .hero .hero-subtitle { font-size: 1.1em; }

  /* Grids → single column */
  .topics-grid { grid-template-columns: 1fr; gap: 1em; }
  .topic-card { padding: 1.5em 0; }
  .topic-card:nth-child(even) { padding-top: 1.5em; }

  .posts-grid { grid-template-columns: 1fr; }
  .post-card:first-child { grid-template-columns: 1fr; }

  .blog-grid { grid-template-columns: 1fr; }

  /* Footer */
  .site-footer { grid-template-columns: 1fr; gap: 2em; }

  /* Promo */
  .promo-banner { padding: 3em 1.25em; }
  .promo-banner .promo-inner {
    flex-direction: column;
    text-align: center;
    padding: 1.5em;
  }
  .promo-banner h2 { font-size: 1.3em; }

  /* Post */
  .post-hero-title { font-size: 1.8em; }
  .page-title { font-size: 1.8em; }
}

/* Small mobile */
@media screen and (max-width: 480px) {
  .hero h1 { font-size: 1.5em; }
  .section-header h2 { font-size: 1.5em; }
  .btn { padding: 0.5em 1.25em; font-size: 0.9em; }
}

/* Focus styles */
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Skip nav */
.skip-nav {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--color-accent);
  color: #fff;
  padding: 0.75em 1.5em;
  border: none;
  border-bottom: none;
}
.skip-nav:focus {
  left: 0;
}
