/* ══════════════════════════════════════════════════════════════
   FridayCMS Public Theme — Zero Base
   Block styles come 100% from inline styles (= page builder).
   This file only provides: reset, body, header/nav/footer structure.
   ══════════════════════════════════════════════════════════════ */

/* ── Reset (matches Tailwind preflight) ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-width: 0;
  border-style: solid;
  border-color: currentColor;
}
html {
  scroll-behavior: smooth;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}
body {
  font-family:
    'Pretendard',
    -apple-system,
    BlinkMacSystemFont,
    system-ui,
    'Segoe UI',
    sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}
a {
  color: inherit;
  text-decoration: inherit;
}
ol,
ul,
menu {
  list-style: none;
}
blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
  margin: 0;
}
fieldset {
  margin: 0;
  padding: 0;
}
legend {
  padding: 0;
}
button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-feature-settings: inherit;
  font-variation-settings: inherit;
  font-size: 100%;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}
button,
select {
  text-transform: none;
}
table {
  text-indent: 0;
  border-color: inherit;
  border-collapse: collapse;
}
hr {
  height: 0;
  color: inherit;
  border-top-width: 1px;
}
b,
strong {
  font-weight: bolder;
}
sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sub {
  bottom: -0.25em;
}
sup {
  top: -0.5em;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
}

/* ── Layout ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.site-main {
  min-height: 60vh;
}

/* ── Header ── */
.site-header {
  padding: 16px 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background 0.3s,
    border-color 0.3s,
    box-shadow 0.3s;
}
.site-header.scrolled {
  background: rgba(13, 13, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo,
.block-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.site-logo:hover,
.block-logo:hover {
  opacity: 0.8;
  transition: opacity 0.3s;
}
.site-logo-img {
  height: 32px;
  width: auto;
}

/* ── Navigation ── */
.site-nav {
  display: flex;
  align-items: center;
}
.site-nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
  align-items: center;
}
.site-nav a {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s;
}
.site-nav a:hover {
  color: var(--primary);
}
.site-nav .has-children {
  position: relative;
}
.site-nav .submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 0;
  min-width: 180px;
  flex-direction: column;
  box-shadow: var(--shadow-medium);
  z-index: 10;
}
.site-nav .has-children:hover .submenu {
  display: flex;
}
.site-nav .submenu a {
  display: block;
  padding: 10px 20px;
  font-size: 13px;
}
.site-nav .submenu a:hover {
  background: var(--bg-hover);
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
}
.menu-toggle:hover {
  background: var(--bg-dark);
}
.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

/* ── User menu / Lang ── */
.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-left: 16px;
  white-space: nowrap;
}
.user-name {
  font-weight: 600;
  color: var(--text);
}
.user-sep {
  color: var(--text-dim);
}
.user-menu a {
  color: var(--text-mid);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s;
}
.user-menu a:hover {
  color: var(--primary);
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
}
.lang-switch select {
  appearance: none;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px 22px 3px 8px;
  font-size: 12px;
  color: var(--text-mid);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394A3B3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 60px;
  color: var(--text-dim);
  font-size: 13px;
}
.site-footer .block-navigation .menu-toggle,
.site-footer .block-navigation .user-menu {
  display: none !important;
}
.block-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Header dynamic: ensure block-row fills container width */
.site-header-dynamic .block-row {
  width: 100%;
}
.block-navigation .site-nav {
  display: flex;
  align-items: center;
}
.block-navigation .site-nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
  align-items: center;
  margin: 0;
  padding: 0;
}
.block-navigation .site-nav a {
  white-space: nowrap;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-nav a {
  color: var(--text-mid);
  font-size: 13px;
  text-decoration: none;
}

/* ── Minimal block helpers (no visual override) ── */
.block-link {
  color: inherit;
  text-decoration: none;
  display: block;
}
.block-action {
  cursor: pointer;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 24px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  box-sizing: border-box;
}
.btn:hover {
  transform: translateY(-1px);
}

/* ── Form controls ── */
.form-control {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
  appearance: none;
  -webkit-appearance: none;
}
.form-control::placeholder {
  color: var(--text-dim);
  opacity: 0.7;
}
.form-control:hover {
  border-color: var(--text-dim);
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--accent-a15);
  background: var(--bg);
}
.form-control:disabled,
.form-control[readonly] {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--bg-hover);
}
textarea.form-control {
  resize: vertical;
  min-height: 100px;
}
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.form-check input[type='checkbox'],
.form-check input[type='radio'] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}
.block-form {
  width: 100%;
}
.block-form + .block-form {
  margin-top: 4px;
}
.block-form .btn {
  width: 100%;
  font-weight: 600;
  padding: 10px 24px;
  font-size: 14px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
}

/* ── Auth pages ── */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50vh;
  padding: 40px 20px;
}
.auth-form {
  width: 100%;
  max-width: 400px;
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
}
.auth-form h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 20px;
  text-align: center;
}
.auth-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  outline: none;
  margin-bottom: 12px;
  box-sizing: border-box;
}
.auth-input:focus {
  border-color: var(--primary);
}
.auth-submit {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  cursor: pointer;
  border: none;
  margin-top: 4px;
  border-radius: 12px;
  background: var(--gradient-primary);
  color: #fff;
  font-weight: 700;
}
.auth-error {
  background: var(--coral-a10);
  color: var(--coral);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}
.auth-link {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-dim);
}

/* ── Error page ── */
.error-page {
  text-align: center;
  padding: 80px 20px;
  max-width: 500px;
  margin: 0 auto;
}
.error-code {
  font-size: 72px;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Dialog ── */
.block-dialog {
  border: none;
  border-radius: 16px;
  padding: 28px;
  max-width: 600px;
  width: calc(100% - 40px);
  background: var(--bg-card);
  color: var(--text);
}
.block-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}
.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-dim);
  cursor: pointer;
}

/* ── Accordion ── */
.accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 8px;
}
.accordion-item summary {
  padding: 14px 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.accordion-item summary::-webkit-details-marker {
  display: none;
}
.accordion-body {
  padding: 0 16px 16px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-mid);
}

/* ── Gallery ── */
.gallery-grid {
  display: grid;
  gap: 12px;
}
.gallery-item {
  overflow: hidden;
  border-radius: var(--radius);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Carousel ── */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 12px 0;
}
.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--primary);
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.carousel-dot.active {
  background: var(--primary);
}

/* ── Timeline ── */
.timeline-wrapper {
  position: relative;
  padding: 20px 0;
}
.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
  transform: translateX(-50%);
}
.timeline-step {
  display: flex;
  margin-bottom: 40px;
  position: relative;
}
.timeline-step.left {
  justify-content: flex-start;
  padding-right: 55%;
}
.timeline-step.right {
  justify-content: flex-end;
  padding-left: 55%;
}
.timeline-marker {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  z-index: 1;
}
.timeline-content {
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

/* ── Testimonial ── */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.testimonial-card {
  padding: 24px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.testimonial-stars {
  color: var(--gold);
  display: flex;
  gap: 2px;
  margin-bottom: 12px;
}
.testimonial-author {
  display: flex;
  align-items: center;
  gap: 10px;
}
.testimonial-avatar,
.testimonial-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

/* ── Social ── */
.footer-social {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}
.social-link {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mid);
  text-decoration: none;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  .menu-toggle {
    display: flex;
  }
  .site-header .container {
    position: relative;
  }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(13, 13, 20, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 99;
  }
  .site-nav.open {
    display: block;
  }
  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
  }
  .site-nav > ul > li > a {
    display: block;
    padding: 10px 20px;
  }
  .site-nav .has-children {
    position: static;
  }
  .site-nav .submenu {
    position: static;
    display: block;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0;
    min-width: auto;
    background: var(--bg-dark);
  }
  .site-nav .submenu a {
    padding: 8px 20px 8px 36px;
  }
  .footer-nav {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  .timeline-step.left,
  .timeline-step.right {
    padding: 0 0 0 50px;
    justify-content: flex-start;
  }
  .timeline-line,
  .timeline-marker {
    left: 18px;
  }
}

/* ── Light theme ── */
[data-theme='light'] {
  background: var(--bg);
  color: var(--text);
}
[data-theme='light'] .site-header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
[data-theme='light'] .site-header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.06);
}
@media (max-width: 768px) {
  [data-theme='light'] .site-nav {
    background: rgba(255, 255, 255, 0.95);
  }
  [data-theme='light'] .site-nav .submenu {
    background: var(--bg-panel);
  }
}

/* ── Dialog ── */
dialog.block-dialog {
  border: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  margin: auto;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
dialog.block-dialog[open] {
  display: flex;
}
dialog.block-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}
.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-dim);
  line-height: 1;
}
.dialog-close:hover {
  color: var(--text);
}

/* ── Scroll Animations ── */
[data-animate] {
  opacity: 0;
  will-change: opacity, transform;
}
[data-animate].anim-visible {
  animation-fill-mode: forwards;
}

/* fadeIn */
[data-animate='fadeIn'].anim-visible {
  animation-name: anim-fadeIn;
}
@keyframes anim-fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* slideUp */
[data-animate='slideUp'].anim-visible {
  animation-name: anim-slideUp;
}
@keyframes anim-slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* slideLeft */
[data-animate='slideLeft'].anim-visible {
  animation-name: anim-slideLeft;
}
@keyframes anim-slideLeft {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* slideRight */
[data-animate='slideRight'].anim-visible {
  animation-name: anim-slideRight;
}
@keyframes anim-slideRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* scaleIn */
[data-animate='scaleIn'].anim-visible {
  animation-name: anim-scaleIn;
}
@keyframes anim-scaleIn {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* bounceIn */
[data-animate='bounceIn'].anim-visible {
  animation-name: anim-bounceIn;
}
@keyframes anim-bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
