/* ==============================
   Base Reset & Variables
================================ */

:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #666666;
  --accent: #ff3b3b;
  --border: #e5e5e5;

  --max-width: 1100px;
  --reading-width: 900px;

  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  --font-heading: "Comic Sans MS", "Arial Black", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

/* ==============================
   Layout
================================ */

.page-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem;
}

header,
footer {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

main {
  margin-top: 2rem;
  padding:0 1rem;
}

/* ==============================
   Typography
================================ */

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

h1 {
  font-size: 2.2rem;
}

h2 {
  font-size: 1.6rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.small {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ==============================
   Comic Episode
================================ */

.comic-episode {
  max-width: var(--reading-width);
  margin: 0 auto;
  text-align: center;
}

.comic-episode h1 {
  margin-bottom: 1.5rem;
}

.comic-image img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* ==============================
   Comic Navigation
================================ */

.comic-navigation {
  display: flex;
  justify-content: space-between;
  margin: 2rem 0;
  font-weight: bold;
}

.comic-navigation a {
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.comic-navigation a:hover {
  background: var(--accent);
  color: #fff;
}

/* ==============================
   Comic Series
================================ */

.comic-series {
  max-width: var(--max-width);
  margin: 0 auto;
}

.series-cover img {
  max-width: 300px;
  height: auto;
  margin-bottom: 1rem;
}

.series-description {
  margin-bottom: 2rem;
}

.series-episodes {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

/* ==============================
   Views Grid
================================ */

.view-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.views-row {
  border: 1px solid var(--border);
  padding: 1rem;
  text-align: center;
}

.views-row img {
  max-width: 100%;
  height: auto;
}

/* ==============================
   Weekly Comic
================================ */

.weekly-comic {
  max-width: var(--reading-width);
  margin: 0 auto 3rem;
  text-align: center;
}

.weekly-comic img {
  max-width: 100%;
  height: auto;
}

/* ==============================
   Mobile Adjustments
================================ */

@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }

  .comic-navigation {
    flex-direction: column;
    gap: 1rem;
  }

  .comic-navigation a {
    width: 100%;
    text-align: center;
  }
}

/* ==============================
   Header / Site Branding
   ImmatureComics
================================ */

header[role="banner"] {
  width: 100%;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

/* Inner header wrapper */
header[role="banner"] > div {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: .2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Drupal site branding block */
#block-immaturecomics-sitebranding {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Logo link */
#block-immaturecomics-sitebranding a {
  display: inline-flex;
  align-items: center;
}

/* Logo image */
#block-immaturecomics-sitebranding img {
  max-width: 100%;
  height: auto;
  width: auto;
  max-height: 40px; /* Desktop size cap */
  display: block;
}

/* Hover interaction (subtle) */
#block-immaturecomics-sitebranding a:hover img {
  opacity: 0.9;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  header[role="banner"] > div {
    padding: 0.45rem 1rem;
  }

  #block-immaturecomics-sitebranding img {
    max-height: 36px;
  }
}

/* Large screens */
@media (min-width: 1200px) {
  #block-immaturecomics-sitebranding img {
    max-height: 42px;
  }
}
