/*
Theme Name: Luis Minimal
Theme URI: 
Author: Luis
Description: A minimal, lightweight WordPress theme inspired by note and minimaga, designed for classic editor.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: luis-minimal
*/

/* 1. CSS Variables & Reset */
:root {
  --color-bg: #ffffff;
  --color-text: #333333;
  --color-text-light: #777777;
  --color-link: #333333;
  --color-link-hover: #000000;
  --color-border: #eeeeee;
  
  --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}

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

body {
  margin: 0;
  padding: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family-base);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--color-link-hover);
  opacity: 0.7;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Utilities */
.strong {
  font-weight: 900;
}
.bold {
  font-weight: 700;
}

/* 2. Layout & Components */
.container {
  width: 92%;
  max-width: 1200px;
  margin: 0 auto;
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
}

/* Header */
.site-header {
  padding: 40px 0 0;
  text-align: center;
}

.site-title {
  font-size: 2.5rem;
  margin: 0 0 30px;
  font-weight: normal;
  letter-spacing: 0.05em;
  font-family: 'Dancing Script', cursive, serif;
}

.site-title a {
  color: var(--color-text);
}

.site-logo {
  margin: 0 0 30px;
}
.site-logo a {
  display: block;
}
.site-logo img {
  max-width: 100%;
  width: auto;
  height: 60px;
  margin: 0 auto;
}

/* Nav */
.site-nav {
  background-color: #f5f5f5;
  width: 100%;
  margin-bottom: 50px;
}

.site-nav ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
}

.site-nav li {
  margin: 0;
}

.site-nav a {
  display: block;
  padding: 15px 25px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.site-nav a:hover {
  background-color: var(--color-text);
  color: #ffffff;
  opacity: 1;
}

/* Hero (Front Page) */
.hero {
  margin-bottom: 60px;
}
.hero img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
}

/* Section Title */
.section-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: normal;
  margin: 0 0 40px;
  position: relative;
}
.section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background-color: var(--color-border);
  margin: 15px auto 0;
}

/* Grid Layout (New Topics) */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 40px;
  margin-bottom: 60px;
}

.post-card {
  display: flex;
  flex-direction: column;
}

.post-card-thumb {
  margin-bottom: 15px;
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-border);
}
.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.post-card:hover .post-card-thumb img {
  transform: scale(1.05);
}

.post-card-cat {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: bold;
}
.post-card-cat a {
  color: var(--color-text);
}

.post-card-meta {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-bottom: 5px;
}

.post-card-title {
  font-size: 1.1rem;
  font-weight: bold;
  margin: 0 0 10px;
  line-height: 1.4;
}

.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--color-text-light);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Entry Content (Single/Page) */
.site-main {
  padding-bottom: 80px;
}

.entry-header {
  text-align: center;
  margin-bottom: 40px;
}
.entry-title {
  font-size: 2rem;
  margin: 0 0 15px;
  line-height: 1.5;
  font-weight: 800;
}
.entry-meta {
  font-size: 0.9rem;
  color: var(--color-text-light);
}

.entry-thumbnail {
  margin-bottom: 40px;
}
.entry-thumbnail img {
  width: 100%;
  height: auto;
}

.entry-content {
  font-size: 1.1rem;
  line-height: 1.9;
  letter-spacing: 0.03em;
  margin-bottom: 60px;
}

.entry-content a {
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}

.entry-content a:hover {
  text-decoration-color: transparent;
}

.entry-content p {
  margin-bottom: 1.5em;
}

.entry-content h2 {
  font-size: 1.7rem;
  margin: 2.5em 0 1em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
  line-height: 1.5;
}

.entry-content h3 {
  font-size: 1.45rem;
  margin: 2em 0 1em;
  line-height: 1.5;
}

/* Responsive iframe (YouTube/Vimeo) */
.entry-content iframe[src*="youtube.com"],
.entry-content iframe[src*="youtu.be"],
.entry-content iframe[src*="vimeo.com"] {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  margin-bottom: 1.5em;
}

/* Custom Blocks (Boxes) */
.entry-content .box_gray {
  padding: 18px 24px;
  background-color: #f9f9f9;
  margin: 0 0 2em;
  font-size: 0.95rem;
  border-radius: 4px;
  color: var(--color-text-light);
}

.entry-content .box_border {
  padding: 18px 24px;
  border: 1px dashed #cccccc;
  margin: 0 0 2em;
  font-size: 0.95rem;
  border-radius: 4px;
  color: var(--color-text-light);
}

/* Custom Blocks (Reference) */
.entry-content .reference {
  display: flex;
  align-items: flex-start;
  background-color: #f9f9f9;
  padding: 20px;
  margin-bottom: 2em;
  border-radius: 4px;
  border-left: 4px solid var(--color-text);
}

.entry-content .reference p {
  font-weight: bold;
  margin: 0;
  padding: 0 20px 0 0;
  white-space: nowrap;
  font-size: 0.95rem;
}

.entry-content .reference ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry-content .reference ul li {
  margin: 0 0 10px 0;
  padding: 0;
  list-style: none;
  line-height: 1.5;
  font-size: 0.95rem;
}

.entry-content .reference ul li:last-child {
  margin-bottom: 0;
}

/* Custom Blocks (Shoplink) */
.entry-content .shoplink-box {
  display: flex;
  gap: 25px;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 2.5em;
  align-items: flex-start;
}

.entry-content .shoplink-image {
  flex-shrink: 0;
  width: 150px;
}
.entry-content .shoplink-image img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.entry-content .shoplink-info {
  flex-grow: 1;
}

.entry-content .shoplink-name {
  margin-bottom: 15px;
}
.entry-content .shoplink-name a {
  font-size: 1.1rem;
  font-weight: bold;
  line-height: 1.5;
  text-decoration: none;
  color: var(--color-text);
  display: block;
}
.entry-content .shoplink-name a:hover {
  text-decoration: underline;
  opacity: 0.8;
}

.entry-content .shoplink-powered-date {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-top: 5px;
}
.entry-content .shoplink-powered-date a {
  color: var(--color-text-light);
  text-decoration: underline;
}

.entry-content .shoplink-link1 {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.entry-content .shoplinkamazon,
.entry-content .shoplinkrakuten,
.entry-content .shoplinkkindle,
.entry-content .shoplinkyahoo {
  flex: 1 1 calc(50% - 10px);
  max-width: 220px;
}

.entry-content .shoplinkamazon a,
.entry-content .shoplinkrakuten a,
.entry-content .shoplinkkindle a,
.entry-content .shoplinkyahoo a {
  display: block;
  text-align: center;
  color: #fff;
  padding: 10px 0;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.9rem;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.entry-content .shoplinkamazon a { background-color: #f99000; }
.entry-content .shoplinkrakuten a { background-color: #bf0000; }
.entry-content .shoplinkkindle a { background-color: #0068ff; }
.entry-content .shoplinkyahoo a { background-color: #4070ff; }

.entry-content .shoplinkamazon a:hover,
.entry-content .shoplinkrakuten a:hover,
.entry-content .shoplinkkindle a:hover,
.entry-content .shoplinkyahoo a:hover {
  opacity: 0.8;
  color: #fff;
  text-decoration: none;
}

/* Tables */
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2em;
  font-size: 0.95rem;
}

.entry-content th,
.entry-content td {
  border: 1px solid var(--color-border);
  padding: 12px 15px;
  line-height: 1.6;
}

.entry-content th {
  background-color: #f9f9f9;
  font-weight: bold;
  text-align: left;
}

/* Mobile adjust for reference & shoplink & tables */
@media (max-width: 768px) {
  .entry-content .reference {
    flex-direction: column;
    padding: 15px;
  }
  .entry-content .reference p {
    padding: 0 0 10px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
    width: 100%;
  }
  
  .entry-content .shoplink-box {
    flex-direction: column;
    align-items: center;
    padding: 20px;
    gap: 15px;
  }
  .entry-content .shoplink-image {
    width: 100%;
    max-width: 180px;
  }
  .entry-content .shoplink-name a {
    font-size: 1.05rem;
  }
  .entry-content .shoplink-link1 {
    flex-direction: column;
    width: 100%;
  }
  .entry-content .shoplinkamazon,
  .entry-content .shoplinkrakuten,
  .entry-content .shoplinkkindle,
  .entry-content .shoplinkyahoo {
    flex: 1 1 100%;
    max-width: 100%;
  }

  /* Table horizontal scroll */
  .entry-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  
  .entry-content table::-webkit-scrollbar {
    height: 6px;
  }
  .entry-content table::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
  }
  .entry-content table::-webkit-scrollbar-thumb {
    background: #cccccc;
    border-radius: 4px;
  }
  
  /* Compatibility for old .tablescroll class */
  .tablescroll {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .tablescroll::-webkit-scrollbar {
    height: 6px;
  }
  .tablescroll::-webkit-scrollbar-track {
    background: #f5f5f5;
  }
  .tablescroll::-webkit-scrollbar-thumb {
    background: #cccccc;
  }
}

.entry-content ul, .entry-content ol {
  margin-bottom: 1.5em;
  padding-left: 1.5em;
  list-style: inherit;
}

.entry-content blockquote {
  margin: 2em 0;
  padding: 1em 1.5em;
  border-left: 4px solid var(--color-border);
  background: #f9f9f9;
  color: var(--color-text-light);
}

.entry-content img {
  margin-bottom: 1.5em;
  max-width: 100%;
  height: auto;
}

.entry-content figure {
  margin: 0 0 1.5em;
  padding: 0;
}

.entry-content figure img {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 1em;
}

.entry-content figcaption {
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text);
}

.entry-content .aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.entry-content .alignleft {
  float: left;
  margin-right: 1.5em;
  margin-bottom: 1.5em;
}
.entry-content .alignright {
  float: right;
  margin-left: 1.5em;
  margin-bottom: 1.5em;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 40px;
}
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  font-size: 0.9rem;
}
.pagination .page-numbers.current {
  background-color: var(--color-text);
  color: #fff;
  border-color: var(--color-text);
}

/* Footer */
.site-footer {
  background-color: #fafafa;
  padding: 60px 0 20px;
  border-top: 1px solid var(--color-border);
}

.footer-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-widgets .widget {
  margin-bottom: 40px;
}
.footer-widgets .widget:last-child {
  margin-bottom: 0;
}

.footer-widgets a {
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 2px;
  transition: text-decoration-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}

.footer-widgets a:hover {
  text-decoration-color: transparent;
}

.widget-title {
  font-size: 1rem;
  margin: 0 0 20px;
  font-weight: bold;
}

.footer-widgets ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.page-title {
  font-size: 2rem;
  margin: 0 0 30px;
  border-bottom: 2px solid var(--color-text);
  padding-bottom: 10px;
  line-height: 1.4;
}

.archive-title-label {
  font-size: 0.85rem;
  color: var(--color-text-light);
  display: block;
  font-weight: normal;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
}

.archive-title-name {
  display: block;
}

.footer-widgets ul li {
  margin-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 10px;
  font-size: 0.9rem;
}
.footer-widgets ul li:last-child {
  border-bottom: none;
}

/* Tag Cloud Widget Style */
.widget_tag_cloud .tagcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.widget_tag_cloud .tagcloud a {
  font-size: 0.8rem !important;
  border: 1px solid var(--color-border);
  padding: 4px 10px;
  border-radius: 20px;
  background: #fff;
  color: var(--color-text-light);
  text-decoration: none;
}
.widget_tag_cloud .tagcloud a:hover {
  background: var(--color-text);
  color: #fff;
  border-color: var(--color-text);
}

/* Comments Area */
.comments-area {
  margin-top: 60px;
  border-top: 1px solid var(--color-border);
  padding-top: 40px;
}

.comment-reply-title {
  font-size: 1.3rem;
  margin-bottom: 20px;
}

.comment-form label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.9rem;
  font-weight: bold;
}

.comment-form input[type="text"],
.comment-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 20px;
  font-family: inherit;
  font-size: 1rem;
}

.comment-form input[type="submit"] {
  background-color: var(--color-text);
  color: #fff;
  border: none;
  padding: 12px 24px;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 4px;
  transition: opacity 0.3s ease;
}

.comment-form input[type="submit"]:hover {
  opacity: 0.8;
}

/* Footer Widget Profile (dl) */
.footer-widgets dl {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 15px;
  margin: 0;
  padding: 0;
}

.footer-widgets dt {
  margin: 0;
  padding: 0;
}

.footer-widgets dt img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.footer-widgets dd {
  margin: 0 0 20px 0;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

.footer-widgets dd strong {
  display: block;
  margin-bottom: 5px;
  font-size: 0.95rem;
}

.site-info {
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-light);
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

/* Menu Toggle Button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 10px;
  cursor: pointer;
  z-index: 1001;
}

.menu-toggle-icon,
.menu-toggle-icon::before,
.menu-toggle-icon::after {
  display: block;
  background-color: var(--color-text);
  width: 24px;
  height: 2px;
  transition: transform 0.3s ease, background-color 0.3s ease;
}
.menu-toggle-icon {
  position: relative;
}
.menu-toggle-icon::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
}
.menu-toggle-icon::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 0;
}

/* Toggle Active State (X) */
.menu-toggle.is-active .menu-toggle-icon {
  background-color: transparent;
}
.menu-toggle.is-active .menu-toggle-icon::before {
  transform: translateY(8px) rotate(45deg);
}
.menu-toggle.is-active .menu-toggle-icon::after {
  transform: translateY(-8px) rotate(-45deg);
}

/* Prevent scroll when menu is open */
body.no-scroll {
  overflow: hidden;
}

/* Mobile only menu items */
.mobile-only {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .site-header {
    padding-top: 20px;
    margin-bottom: 40px;
  }
  .header-container {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .site-branding {
    flex-shrink: 0;
    width: 100%;
    text-align: center;
  }
  .site-logo {
    margin: 0;
  }
  .site-logo img {
    margin: 0 auto;
    height: 45px;
  }
  .site-title {
    font-size: 2rem;
    margin: 0;
  }
  .menu-toggle {
    display: block;
    align-self: flex-end;
    order: -1;
    margin-bottom: 15px;
  }
  
  .mobile-only {
    display: block;
  }

  /* Overlay Navigation */
  .site-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.98);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    z-index: 1000;
  }
  .site-nav.is-active {
    opacity: 1;
    visibility: visible;
  }
  
  .site-nav .container {
    width: 100%;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .site-nav a {
    font-size: 1.5rem;
    padding: 10px 20px;
    border: none;
    background: none;
  }
  
  .post-grid {
    grid-template-columns: 1fr;
  }
  .entry-title {
    font-size: 1.5rem;
  }
}

/* Contact Form 7 Custom Style */
.cf7-custom-form {
  max-width: 600px;
  margin: 0 auto;
}

.cf7-field {
  margin-bottom: 25px;
}

.cf7-field label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.cf7-field .required {
  background-color: #d9534f;
  color: #fff;
  font-size: 0.75rem;
  padding: 3px 6px;
  border-radius: 3px;
  margin-left: 10px;
  vertical-align: middle;
}

.cf7-field .optional {
  background-color: #999;
  color: #fff;
  font-size: 0.75rem;
  padding: 3px 6px;
  border-radius: 3px;
  margin-left: 10px;
  vertical-align: middle;
}

.cf7-custom-form input[type="text"],
.cf7-custom-form input[type="email"],
.cf7-custom-form textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background-color: #fafafa;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

.cf7-custom-form input[type="text"]:focus,
.cf7-custom-form input[type="email"]:focus,
.cf7-custom-form textarea:focus {
  outline: none;
  border-color: var(--color-text);
  background-color: #fff;
}

.cf7-custom-form textarea {
  min-height: 150px;
  resize: vertical;
}

.cf7-confirm-box {
  background-color: #f9f9f9;
  border: 1px solid var(--color-border);
  padding: 20px;
  border-radius: 4px;
  margin-bottom: 30px;
  text-align: center;
}

.cf7-notice {
  font-size: 0.85rem;
  color: #d9534f;
  margin-bottom: 15px !important;
  line-height: 1.5;
}

.cf7-acceptance {
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cf7-submit-wrapper {
  text-align: center;
}

.cf7-submit-wrapper input[type="submit"] {
  background-color: var(--color-text);
  color: #fff;
  border: none;
  padding: 15px 40px;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 30px;
  cursor: pointer;
  transition: opacity 0.3s ease;
  min-width: 200px;
}

.cf7-submit-wrapper input[type="submit"]:hover {
  opacity: 0.8;
}

/* disabled時の送信ボタン */
.cf7-submit-wrapper input[type="submit"]:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  opacity: 1;
}
