/* ============================================
   Hosting Manual - Hugo Theme CSS
   Based on GeneratePress theme from original site
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 17px;
  line-height: 1.8;
  color: #333;
  background: #fff;
}

a {
  color: #1e73be;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #482d70;
  text-decoration: underline;
}

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

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.6em;
  color: #222;
}

h1 { font-size: 2em; }
h2 { font-size: 1.6em; }
h3 { font-size: 1.3em; }
h4 { font-size: 1.1em; }

p {
  margin-bottom: 1.2em;
}

ul, ol {
  margin-bottom: 1.2em;
  padding-left: 2em;
}

blockquote {
  border-left: 4px solid #482d70;
  padding: 1em 1.5em;
  margin: 1.5em 0;
  background: #f9f9fb;
  font-style: italic;
}

pre, code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9em;
}

pre {
  background: #f4f4f6;
  padding: 1.2em;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1.5em;
}

code {
  background: #f4f4f6;
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

pre code {
  background: none;
  padding: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1.5em;
}

th, td {
  border: 1px solid #ddd;
  padding: 0.6em 1em;
  text-align: left;
}

th {
  background: #f4f4f6;
  font-weight: 600;
}

/* --- Grid Container --- */
.grid-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Header --- */
.site-header {
  background: rgba(27, 27, 66, 0.96);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.inside-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  position: relative;
}

.site-branding {
  flex-shrink: 0;
}

.site-logo img {
  display: block;
}

/* --- Navigation --- */
.main-navigation {
  display: flex;
  align-items: center;
}

.main-nav > ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav .menu > li {
  position: relative;
}

/* Link row: keeps link + arrow on one line */
.menu-item-link-row {
  display: flex;
  align-items: stretch;
}

.main-nav .menu > li > a,
.menu-item-link-row > a {
  display: flex;
  align-items: center;
  padding: 0 18px;
  height: 50px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
}

.main-nav .menu > li > a:hover,
.main-nav .menu > li:hover > .menu-item-link-row > a {
  color: #f2f5fa;
  background: rgba(255, 255, 255, 0.08);
}

/* Dropdown Toggle Arrow */
.dropdown-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0 10px;
  transition: transform 0.2s ease;
}

.dropdown-menu-toggle svg {
  transition: transform 0.3s ease;
}

.dropdown-menu-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* Sub-menus — desktop: hover popup */
.sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(27, 27, 66, 0.98);
  min-width: 240px;
  list-style: none;
  padding: 0;
  margin: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 1001;
}

.menu-item-has-children:hover > .sub-menu {
  display: block;
}

.sub-menu li a {
  display: block;
  padding: 10px 20px;
  color: #fff;
  font-size: 14px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease;
}

.sub-menu li a:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.sub-menu li:last-child a {
  border-bottom: none;
}

/* Hamburger Menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  flex-direction: column;
  gap: 5px;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s ease;
}

/* --- Main Content --- */
.site-main {
  padding: 40px 0;
  min-height: 60vh;
}

/* --- Post List (Homepage / Archive) --- */
.post-list {
  display: grid;
  gap: 30px;
}

.post-summary {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 25px;
  padding-bottom: 30px;
  border-bottom: 1px solid #eee;
}

.post-image img {
  border-radius: 8px;
  width: 100%;
  height: auto;
  display: block;
}

.post-content-summary .entry-title {
  font-size: 1.4em;
  margin-bottom: 0.3em;
}

.post-content-summary .entry-title a {
  color: #222;
  text-decoration: none;
}

.post-content-summary .entry-title a:hover {
  color: #482d70;
}

.entry-meta {
  color: #888;
  font-size: 0.9em;
  margin-bottom: 0.8em;
}

.entry-meta time {
  margin-right: 10px;
}

.cat-links {
  display: inline-block;
  margin-left: 5px;
}

.cat-links a {
  color: #482d70;
  font-weight: 500;
}

.entry-summary p {
  color: #555;
  margin-bottom: 0.8em;
}

.read-more {
  display: inline-block;
  color: #482d70;
  font-weight: 600;
  font-size: 0.95em;
}

.read-more:hover {
  color: #1e73be;
  text-decoration: underline;
}

/* --- Single Post --- */
.single-post {
  max-width: 800px;
  margin: 0 auto;
}

.single-post .entry-header {
  margin-bottom: 25px;
}

.single-post .entry-title {
  font-size: 2.2em;
  line-height: 1.2;
}

.featured-image {
  margin-bottom: 30px;
}

.featured-image img {
  border-radius: 8px;
  width: 100%;
}

.entry-content {
  line-height: 1.8;
}

.entry-content img {
  border-radius: 8px;
  margin: 1em 0;
}

.entry-content h2 {
  margin-top: 1.8em;
}

.entry-content h3 {
  margin-top: 1.5em;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #eee;
}

.pagination a,
.pagination .current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 4px;
  font-weight: 500;
}

.pagination a {
  background: #f4f4f6;
  color: #333;
}

.pagination a:hover {
  background: #482d70;
  color: #fff;
  text-decoration: none;
}

.pagination .current {
  background: #482d70;
  color: #fff;
}

/* --- Footer --- */
.site-footer {
  background: rgba(27, 27, 66, 0.96);
  color: #ccc;
  padding: 30px 0;
  margin-top: 40px;
}

.inside-footer {
  text-align: center;
}

.footer-nav ul {
  display: flex;
  justify-content: center;
  gap: 25px;
  list-style: none;
  padding: 0;
  margin-bottom: 15px;
}

.footer-nav a {
  color: #ddd;
  font-size: 0.9em;
}

.footer-nav a:hover {
  color: #fff;
  text-decoration: underline;
}

.copyright p {
  font-size: 0.85em;
  color: #999;
  margin: 0;
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 45px;
  height: 45px;
  background: rgba(27, 27, 66, 0.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: #482d70;
}

/* --- Page Title --- */
.page-title {
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 2px solid #482d70;
}

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

/* --- GeneratePress-style inline overrides --- */
.drop-shadow {
  box-shadow: 0px 0px 20px rgba(200, 200, 200, 0.2);
}

.round-top-corners img {
  border-radius: 8px 8px 0 0;
}

/* WP Block styles */
.wp-block-image {
  margin: 1.5em 0;
}

.wp-block-image img {
  border-radius: 8px;
}

.wp-block-image figcaption {
  font-size: 0.85em;
  color: #666;
  text-align: center;
  margin-top: 0.5em;
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.alignleft {
  float: left;
  margin: 0.5em 1.5em 1em 0;
}

.alignright {
  float: right;
  margin: 0.5em 0 1em 1.5em;
}

/* WP button styles */
.wp-block-button__link,
a.wp-block-button__link {
  display: inline-block;
  padding: 12px 28px;
  background: #482d70;
  color: #fff;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
}

.wp-block-button__link:hover {
  background: rgba(72, 45, 112, 0.85);
  color: #fff;
  text-decoration: none;
}

/* WP columns */
.wp-block-columns {
  display: flex;
  gap: 2em;
  margin-bottom: 1.5em;
}

.wp-block-column {
  flex: 1;
}

/* Nav button style (Domain Search) */
.nav-button a {
  color: rgba(72, 45, 112, 1.0) !important;
  border: 3px solid !important;
  line-height: 36px !important;
  border-radius: 2px !important;
  margin-left: 20px !important;
  transition: all 0.6s ease 0s !important;
  text-transform: uppercase;
  font-weight: 600;
}

.nav-button a:hover {
  color: rgba(72, 45, 112, 0.8) !important;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .post-summary {
    grid-template-columns: 250px 1fr;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  /* Keep header as a single row: logo left, hamburger right */
  .inside-header {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
  }

  .main-navigation {
    flex-shrink: 0;
  }

  .menu-toggle {
    display: flex;
  }

  /* Full-width menu below header row */
  #primary-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(27, 27, 66, 0.98);
    z-index: 1001;
  }

  #primary-menu.toggled {
    display: block;
  }

  .main-nav > ul {
    flex-direction: column;
  }

  /* Parent link row */
  .menu-item-link-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .menu-item-link-row > a {
    flex: 1;
    padding: 14px 15px;
  }

  .main-nav .menu > li > a {
    padding: 14px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Arrow toggle button — tappable area on the right */
  .dropdown-menu-toggle {
    padding: 14px 18px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Accordion sub-menus: hidden by default, no absolute positioning */
  .sub-menu {
    display: none;
    position: static;
    box-shadow: none;
    background: rgba(20, 20, 55, 1);
    min-width: 0;
  }

  /* On mobile: disable desktop hover, use JS accordion only */
  .menu-item-has-children:hover > .sub-menu,
  .menu-item-has-children:focus-within > .sub-menu {
    display: none;
  }

  .menu-item-has-children > .sub-menu.toggled {
    display: block;
  }

  .sub-menu li a {
    padding: 12px 15px 12px 30px;
    font-size: 14px;
  }

  .post-summary {
    grid-template-columns: 1fr;
  }

  .single-post .entry-title {
    font-size: 1.6em;
  }

  .footer-nav ul {
    flex-direction: column;
    gap: 10px;
  }

  .grid-container {
    padding: 0 15px;
  }

  .wp-block-columns {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .inside-header {
    padding: 8px 15px;
  }

  .site-logo img {
    max-width: 150px;
  }

  .site-main {
    padding: 20px 0;
  }
}
