/*
Theme Name: The Rebel Doc
Theme URI: https://therebeldoc.com
Author: The Rebel Doc
Description: Custom WordPress theme for therebeldoc.com. Built from design mockup.
Version: 1.0
License: Private
*/

  :root {
    --paper:       #f4f0e8;
    --paper-dark:  #ede8dc;
    --paper-ruled: #e8e2d4;
    --ink:         #1a1611;
    --ink-mid:     #3d3428;
    --ink-light:   #6b5e4a;
    --ink-faint:   #9c8f7a;
    --red:         #c0392b;
    --red-dark:    #96261f;
    --rule:        #c8bfac;
    --rule-light:  #ddd6c6;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  html { font-size: 16px; scroll-behavior: smooth; }

  body {
    background: var(--paper);
    color: var(--ink);
    font-family: 'Source Serif 4', Georgia, serif;
    -webkit-font-smoothing: antialiased;
  }

  /* ── TOP BAR ── */
  .top-bar {
    background: var(--ink);
    color: var(--paper);
    font-family: 'Arvo', serif;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 8px 0;
    text-align: center;
    border-bottom: 3px solid var(--red);
  }
  .top-bar span { color: var(--ink-faint); margin: 0 12px; }

  /* ── MASTHEAD ── */
  .masthead {
    border-bottom: 3px double var(--rule);
    position: relative;
    overflow: hidden;
    background: var(--paper);
    padding: 18px 0;
  }
  .masthead-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    min-height: 110px;
  }
  /* Dark nameplate zone — matches logo bg exactly */
  .logo-band {
    background: #22272a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    flex-shrink: 0;
  }
  .logo-band a { display: block; line-height: 0; }
  .logo-band img { display: block; height: 92px; width: auto; }
  /* Warm paper zone */
  .masthead-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 20px 20px 24px;
    text-align: left;
    gap: 10px;
  }
  @media (min-width: 768px) {
    .masthead-inner { min-height: 130px; }
    .logo-band img { height: 120px; }
    .masthead-right {
      padding: 24px 32px 24px 28px;
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      text-align: left;
    }
  }
  .site-title {
    font-family: 'Zilla Slab', Georgia, serif;
    font-size: clamp(2.8rem, 6vw, 5rem);
    font-weight: 700;
    line-height: 0.92;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-decoration: none;
  }
  .site-title em {
    font-style: italic;
    color: var(--red);
  }
  .tagline {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1.15rem;
    font-style: italic;
    font-weight: 400;
    color: var(--ink-mid);
    line-height: 1.5;
  }
  .masthead-rule {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 0;
  }
  @media (min-width: 768px) {
    .masthead-rule { margin: 20px auto 0; padding: 0 32px; }
  }
  .masthead-rule::before,
  .masthead-rule::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--rule);
  }
  .ornament {
    color: var(--red);
    font-size: 1.1rem;
    padding: 0 12px;
    line-height: 1;
  }

  /* ── NAV ── */
  nav {
    background: var(--paper-dark);
    border-bottom: 1px solid var(--rule);
  }
  nav ul {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    list-style: none;
    display: flex;
    gap: 0;
    flex-wrap: wrap;
  }
  @media (min-width: 768px) {
    nav ul { padding: 0 32px; flex-wrap: nowrap; }
  }
  nav li a {
    display: block;
    padding: 13px 18px;
    font-family: 'Arvo', serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-mid);
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
    border-right: 1px solid var(--rule-light);
  }
  nav li:first-child a { border-left: 1px solid var(--rule-light); }
  nav li a:hover { color: var(--red); background: var(--paper); }
  nav li.active a { color: var(--red); }

  /* ── LAYOUT — mobile-first ── */
  .site-body {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
  }
  @media (min-width: 768px) {
    .site-body {
      padding: 48px 32px;
      grid-template-columns: 1fr 300px;
      gap: 56px;
    }
  }

  /* ── SECTION HEADERS ── */
  .section-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
  }
  .section-head h2 {
    font-family: 'Arvo', serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-light);
    white-space: nowrap;
  }
  .section-head::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--rule);
  }

  /* ── FEATURED POST ── */
  .featured-post {
    border-bottom: 2px solid var(--ink);
    padding-bottom: 40px;
    margin-bottom: 40px;
    position: relative;
  }
  .post-tag {
    display: inline-block;
    font-family: 'Arvo', serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--paper);
    background: var(--red);
    padding: 3px 8px;
    margin-bottom: 14px;
  }
  .featured-post h3 {
    font-family: 'Zilla Slab', Georgia, serif;
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-bottom: 14px;
  }
  .featured-post h3 a { text-decoration: none; color: inherit; }
  .featured-post h3 a:hover { color: var(--red); }
  .post-meta {
    font-family: 'Arvo', serif;
    font-size: 0.72rem;
    color: var(--ink-faint);
    letter-spacing: 0.04em;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: center;
  }
  .post-meta .dot { color: var(--rule); }
  .post-excerpt {
    font-size: 1.05rem;
    font-weight: 400;
    line-height: 1.75;
    color: var(--ink-mid);
    max-width: 68ch;
  }
  .read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    font-family: 'Arvo', serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--red);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s;
  }
  .read-more:hover { border-bottom-color: var(--red); }
  .read-more::after { content: '→'; }

  /* ── POST LIST ── */
  .post-list { display: flex; flex-direction: column; gap: 0; }
  .post-item {
    padding: 24px 0;
    border-bottom: 1px solid var(--rule-light);
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
  }
  @media (min-width: 540px) {
    .post-item { grid-template-columns: 1fr auto; gap: 16px; }
  }
  .post-item:first-child { padding-top: 0; }
  .post-item-tag {
    font-family: 'Arvo', serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 8px;
  }
  .post-item h3 {
    font-family: 'Zilla Slab', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ink);
    margin-bottom: 8px;
  }
  .post-item h3 a { text-decoration: none; color: inherit; }
  .post-item h3 a:hover { color: var(--red); }
  .post-item p {
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.65;
    color: var(--ink-light);
  }
  .post-item-meta {
    font-family: 'Arvo', serif;
    font-size: 0.65rem;
    color: var(--ink-faint);
    text-align: right;
    white-space: nowrap;
    padding-top: 4px;
  }

  /* ── SIDEBAR ── */
  .sidebar { display: flex; flex-direction: column; gap: 36px; }

  .sidebar-widget {
    border-top: 2px solid var(--ink);
    padding-top: 20px;
  }
  .widget-title {
    font-family: 'Arvo', serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 16px;
  }

  /* About widget */
  .about-widget p {
    font-size: 0.88rem;
    font-weight: 400;
    line-height: 1.7;
    color: var(--ink-mid);
    margin-bottom: 12px;
  }
  .about-widget .byline {
    font-family: 'Arvo', serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-faint);
  }

  /* Categories */
  .cat-list { list-style: none; }
  .cat-list li {
    border-bottom: 1px solid var(--rule-light);
  }
  .cat-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-family: 'Source Serif 4', serif;
    font-size: 0.88rem;
    color: var(--ink-mid);
    text-decoration: none;
    transition: color 0.15s;
  }
  .cat-list li a:hover { color: var(--red); }
  .cat-list li a span {
    font-family: 'Arvo', serif;
    font-size: 0.7rem;
    color: var(--ink-faint);
  }

  /* Subscribe widget */
  .subscribe-widget {
    background: var(--ink);
    padding: 24px;
    margin: 0 -0px;
  }
  .subscribe-widget .widget-title { color: var(--paper); margin-bottom: 10px; }
  .subscribe-widget p {
    font-size: 0.85rem;
    font-weight: 400;
    font-style: italic;
    color: var(--ink-faint);
    line-height: 1.6;
    margin-bottom: 16px;
  }
  .sub-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--paper-dark);
    border: 1px solid var(--rule);
    color: var(--ink);
    font-family: 'Source Serif 4', serif;
    font-size: 0.85rem;
    margin-bottom: 10px;
    outline: none;
  }
  .sub-input:focus { border-color: var(--red); }
  .sub-button {
    width: 100%;
    padding: 10px;
    background: var(--red);
    border: none;
    color: var(--paper);
    font-family: 'Arvo', serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s;
  }
  .sub-button:hover { background: var(--red-dark); }

  /* ── PAGE DIVIDER ── */
  .view-all-wrap {
    text-align: center;
    padding: 32px 0 0;
  }
  .view-all {
    display: inline-block;
    font-family: 'Arvo', serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-mid);
    text-decoration: none;
    border: 1px solid var(--rule);
    padding: 10px 24px;
    transition: all 0.15s;
  }
  .view-all:hover {
    border-color: var(--ink);
    color: var(--ink);
    background: var(--paper-dark);
  }

  /* ── SINGLE POST PAGE ── */

  .post-header {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px 28px;
    border-bottom: 2px solid var(--ink);
  }
  @media (min-width: 768px) {
    .post-header { padding: 48px 32px 40px; }
  }
  .post-header .post-tag { margin-bottom: 18px; }
  .post-header h1 {
    font-family: 'Zilla Slab', Georgia, serif;
    font-size: clamp(1.8rem, 4.5vw, 3.2rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--ink);
    max-width: 780px;
    margin-bottom: 20px;
  }
  .post-header .post-meta { margin-bottom: 0; }
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px 48px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
  }
  @media (min-width: 768px) {
    .post-body {
      padding: 48px 32px 64px;
      grid-template-columns: 1fr 300px;
      gap: 56px;
    }
  }
  .post-content {
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.85;
    color: var(--ink-mid);
  }
  .post-content p { margin-bottom: 1.5em; }
  .post-content p:first-child::first-letter {
    font-family: 'Zilla Slab', Georgia, serif;
    font-size: 4.2em;
    font-weight: 700;
    float: left;
    line-height: 0.75;
    margin-right: 0.1em;
    margin-top: 0.1em;
    color: var(--ink);
  }
  .post-content h2 {
    font-family: 'Zilla Slab', Georgia, serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--ink);
    margin: 2em 0 0.75em;
    letter-spacing: -0.01em;
  }
  .post-content blockquote {
    border-left: 3px solid var(--red);
    margin: 2em 0;
    padding: 4px 0 4px 24px;
    font-size: 1.15rem;
    font-style: italic;
    color: var(--ink);
  }
  .post-footer {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid var(--rule);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
  }
  .post-footer .back-link {
    font-family: 'Arvo', serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-mid);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .post-footer .back-link::before { content: '←'; }
  .post-footer .back-link:hover { color: var(--red); }
  .tag-list { display: flex; gap: 8px; flex-wrap: wrap; }
  .tag {
    font-family: 'Arvo', serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-mid);
    border: 1px solid var(--rule);
    padding: 4px 10px;
    text-decoration: none;
    transition: all 0.15s;
  }
  .tag:hover { border-color: var(--red); color: var(--red); }

  /* ── FOOTER ── */
  .site-footer {
    background: var(--ink);
    color: var(--paper);
    padding: 40px 0;
    border-top: 3px solid var(--red);
  }
  .footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
  }
  @media (min-width: 768px) {
    .footer-inner { padding: 0 32px; grid-template-columns: 1fr 1fr 1fr; gap: 40px; }
  }
  .footer-brand .site-title {
    font-size: 1.8rem;
    color: var(--paper);
    display: block;
    margin-bottom: 10px;
  }
  .footer-brand .site-title em { color: var(--red); }
  .footer-brand p {
    font-size: 0.82rem;
    font-weight: 400;
    font-style: italic;
    color: var(--ink-faint);
    line-height: 1.6;
  }
  .footer-social, .masthead-social {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .footer-social { margin-top: 16px; color: var(--paper-ruled); }
  .masthead-social { color: var(--ink-mid); }
  .social-icon {
    color: inherit;
    display: inline-flex;
    line-height: 0;
    transition: color 0.15s;
  }
  .social-icon:hover { color: var(--red); }
  .social-icon svg { display: block; }
  .footer-col h4 {
    font-family: 'Arvo', serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 14px;
  }
  .footer-col ul { list-style: none; }
  .footer-col ul li { margin-bottom: 8px; }
  .footer-col ul li a {
    font-size: 0.88rem;
    color: var(--paper-ruled);
    text-decoration: none;
    transition: color 0.15s;
  }
  .footer-col ul li a:hover { color: var(--red); }
  .footer-bottom {
    max-width: 1100px;
    margin: 32px auto 0;
    padding: 20px 20px 0;
    border-top: 1px solid #333;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: 'Arvo', serif;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    color: var(--ink-faint);
    text-align: center;
  }
  @media (min-width: 768px) {
    .footer-bottom {
      padding: 20px 32px 0;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      text-align: left;
    }
  }
  .disclaimer {
    font-size: 0.65rem;
    font-style: italic;
    color: #555;
    max-width: 400px;
    text-align: right;
  }


  /* ── ANIMATIONS ── */
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .masthead, nav, .site-body, .site-footer {
    animation: fadeUp 0.4s ease both;
  }
  nav { animation-delay: 0.05s; }
  .site-body { animation-delay: 0.1s; }
  .site-footer { animation-delay: 0.15s; }
