/**
 * Site Portrait - 海報風格樣式
 * 八種風格：包浩斯 (Bauhaus)、瑞士國際主義 (Swiss)、酸性故障 (Acid)、
 *          極簡主義 (Minimal)、賽博龐克 (Cyberpunk)、復古打字機 (Typewriter)、
 *          玻璃擬態 (Glass)、野獸派 (Brutalist)
 */

/* ========================================
   基礎海報結構
   ======================================== */

.poster {
  position: relative;
  overflow: hidden;
  font-family: var(--font-sans);
}

/* 尺寸變體 */
.poster[data-ratio="1:1"] {
  width: 400px;
  height: 400px;
}

.poster[data-ratio="4:5"] {
  width: 400px;
  height: 500px;
}

.poster[data-ratio="16:9"] {
  width: 640px;
  height: 360px;
}

.poster[data-ratio="A4"] {
  width: 420px;
  height: 594px;
}

/* ========================================
   風格 A：極簡包浩斯 (Bauhaus)
   特徵：幾何圖形、留白、細線條
   ======================================== */

.poster.style-bauhaus {
  background: var(--poster-bg, #f5f5f5);
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 10%;
}

.poster.style-bauhaus .bauhaus-shape {
  position: absolute;
  border-radius: 50%;
}

.poster.style-bauhaus .shape-primary {
  width: 60%;
  height: 60%;
  top: 10%;
  right: -15%;
  background: var(--poster-accent, #e63946);
  opacity: 0.9;
}

.poster.style-bauhaus .shape-secondary {
  width: 25%;
  height: 25%;
  bottom: 25%;
  left: 10%;
  background: var(--poster-secondary, #1d3557);
}

.poster.style-bauhaus .bauhaus-line {
  position: absolute;
  background: var(--poster-line, #000);
}

.poster.style-bauhaus .line-h {
  height: 1px;
  width: 40%;
  top: 50%;
  left: 5%;
}

.poster.style-bauhaus .line-v {
  width: 1px;
  height: 30%;
  bottom: 10%;
  right: 30%;
}

.poster.style-bauhaus .bauhaus-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
}

.poster.style-bauhaus .bauhaus-title {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--poster-text, #000);
  line-height: 1.1;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  letter-spacing: 0.1em;
}

.poster.style-bauhaus .bauhaus-domain {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--poster-muted, #666);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-top: auto;
}

.poster.style-bauhaus .bauhaus-year {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  color: var(--poster-text, #000);
  opacity: 0.1;
  position: absolute;
  bottom: 5%;
  left: 5%;
}

/* ========================================
   風格 B：瑞士國際主義 (Swiss)
   特徵：嚴謹網格、巨大無襯線字體、高對比
   ======================================== */

.poster.style-swiss {
  background: var(--poster-bg, #000);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 2px;
}

.poster.style-swiss .swiss-block {
  background: var(--poster-accent, #ff0000);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.poster.style-swiss .block-title {
  grid-column: 1 / 4;
  grid-row: 1 / 4;
  background: var(--poster-bg, #000);
  padding: 8%;
  align-items: flex-end;
  justify-content: flex-start;
}

.poster.style-swiss .swiss-title {
  font-family: var(--font-sans);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--poster-text, #fff);
  line-height: 0.85;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  word-break: break-word;
  hyphens: auto;
}

.poster.style-swiss .block-image {
  grid-column: 4;
  grid-row: 1 / 3;
  padding: 0;
}

.poster.style-swiss .block-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(120%);
}

.poster.style-swiss .block-accent {
  grid-column: 4;
  grid-row: 3;
  background: var(--poster-accent, #ff0000);
}

.poster.style-swiss .block-desc {
  grid-column: 1 / 3;
  grid-row: 4 / 6;
  background: var(--poster-secondary, #1a1a1a);
  padding: 8%;
  align-items: flex-start;
  justify-content: flex-start;
}

.poster.style-swiss .swiss-desc {
  font-family: var(--font-sans);
  font-size: 0.625rem;
  color: var(--poster-muted, rgba(255,255,255,0.6));
  line-height: 1.5;
  text-align: left;
}

.poster.style-swiss .block-meta {
  grid-column: 3 / 5;
  grid-row: 4 / 6;
  background: var(--poster-bg, #000);
  padding: 8%;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 4px;
}

.poster.style-swiss .swiss-domain {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: var(--poster-accent, #ff0000);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.poster.style-swiss .swiss-year {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--poster-text, #fff);
}

/* ========================================
   風格 C：酸性故障 (Acid Glitch)
   特徵：流體漸層、金屬質感、反色文字、Y2K 元素
   ======================================== */

.poster.style-acid {
  background: var(--poster-gradient);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8%;
  overflow: hidden;
}

/* 流體漸層背景 */
.poster.style-acid::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: var(--poster-gradient);
  animation: acidRotate 20s linear infinite;
  filter: blur(40px);
  opacity: 0.8;
}

@keyframes acidRotate {
  to { transform: rotate(360deg); }
}

/* 噪點紋理 */
.poster.style-acid::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.15;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.poster.style-acid .acid-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

/* 主圖片（圓形裁切 + 特效） */
.poster.style-acid .acid-image {
  width: 50%;
  max-width: 180px;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    0 0 40px rgba(255, 0, 128, 0.5),
    0 0 80px rgba(0, 255, 255, 0.3);
}

.poster.style-acid .acid-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: hue-rotate(var(--hue-shift, 0deg)) saturate(150%) contrast(110%);
}

/* 標題（反色混合模式） */
.poster.style-acid .acid-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  mix-blend-mode: difference;
  text-shadow:
    2px 2px 0 rgba(255, 0, 128, 0.8),
    -2px -2px 0 rgba(0, 255, 255, 0.8);
  line-height: 1.1;
}

/* 描述 */
.poster.style-acid .acid-desc {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 80%;
  line-height: 1.4;
}

/* 裝飾元素 */
.poster.style-acid .acid-decor {
  position: absolute;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.5rem;
}

.poster.style-acid .decor-star-1 {
  top: 10%;
  left: 15%;
}

.poster.style-acid .decor-star-2 {
  top: 20%;
  right: 10%;
}

.poster.style-acid .decor-star-3 {
  bottom: 15%;
  left: 10%;
}

.poster.style-acid .decor-crosshair {
  bottom: 10%;
  right: 15%;
  font-size: 1rem;
  font-family: var(--font-mono);
}

/* 域名標籤 */
.poster.style-acid .acid-domain {
  position: absolute;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
}

/* ========================================
   響應式調整
   ======================================== */

@media (max-width: 768px) {
  .poster[data-ratio="16:9"] {
    width: 100%;
    max-width: 400px;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .poster.style-swiss .swiss-title {
    font-size: 1.5rem;
  }

  .poster.style-acid .acid-title {
    font-size: 1.25rem;
  }
}

/* ========================================
   風格 D：極簡主義 (Minimal)
   特徵：大量留白、黑白配色、等寬字體
   ======================================== */

.poster.style-minimal {
  background: var(--poster-bg, #FAFAFA);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 15%;
  position: relative;
}

.poster.style-minimal .minimal-line {
  position: absolute;
  background: var(--poster-line, #1A1A1A);
}

.poster.style-minimal .line-top {
  top: 8%;
  left: 10%;
  right: 10%;
  height: 1px;
}

.poster.style-minimal .line-bottom {
  bottom: 8%;
  left: 10%;
  right: 10%;
  height: 1px;
}

.poster.style-minimal .minimal-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
}

.poster.style-minimal .minimal-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--poster-text, #1A1A1A);
  line-height: 1.2;
  letter-spacing: -0.02em;
  max-width: 90%;
}

.poster.style-minimal .minimal-desc {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.625rem;
  color: var(--poster-muted, #666);
  line-height: 1.6;
  max-width: 80%;
}

.poster.style-minimal .minimal-domain {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.5rem;
  color: var(--poster-muted, #999);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  position: absolute;
  bottom: 12%;
}

.poster.style-minimal .minimal-year {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.5rem;
  color: var(--poster-muted, #999);
  position: absolute;
  top: 12%;
  right: 10%;
}

/* ========================================
   風格 E：賽博龐克 (Cyberpunk)
   特徵：霓虹色、深色背景、網格、發光效果
   ======================================== */

.poster.style-cyberpunk {
  background: #0A0A0F;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8%;
  overflow: hidden;
}

/* 網格背景 */
.poster.style-cyberpunk::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* 掃描線效果 */
.poster.style-cyberpunk::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    transparent 50%,
    rgba(0, 0, 0, 0.1) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  opacity: 0.3;
}

.poster.style-cyberpunk .cyber-content {
  position: relative;
  z-index: 10;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.poster.style-cyberpunk .cyber-image {
  width: 45%;
  max-width: 160px;
  aspect-ratio: 1;
  border: 2px solid var(--poster-accent, #00F0FF);
  box-shadow:
    0 0 20px var(--poster-accent, #00F0FF),
    inset 0 0 20px rgba(0, 240, 255, 0.1);
  overflow: hidden;
}

.poster.style-cyberpunk .cyber-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(120%) contrast(110%);
}

.poster.style-cyberpunk .cyber-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow:
    0 0 10px var(--poster-accent, #00F0FF),
    0 0 30px var(--poster-accent, #00F0FF);
  line-height: 1.1;
}

.poster.style-cyberpunk .cyber-desc {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.5rem;
  color: rgba(255, 255, 255, 0.6);
  max-width: 80%;
  line-height: 1.5;
}

.poster.style-cyberpunk .cyber-decor {
  position: absolute;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.5rem;
  color: var(--poster-accent, #00F0FF);
  opacity: 0.6;
}

.poster.style-cyberpunk .decor-tl {
  top: 5%;
  left: 5%;
}

.poster.style-cyberpunk .decor-tr {
  top: 5%;
  right: 5%;
}

.poster.style-cyberpunk .decor-bl {
  bottom: 5%;
  left: 5%;
}

.poster.style-cyberpunk .cyber-domain {
  position: absolute;
  bottom: 5%;
  right: 5%;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.4rem;
  color: var(--poster-secondary, #FF00FF);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-shadow: 0 0 5px var(--poster-secondary, #FF00FF);
}

/* ========================================
   風格 F：復古打字機 (Typewriter)
   特徵：紙張紋理、打字機字體、相框邊框
   ======================================== */

.poster.style-typewriter {
  background: #F4EFE6;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 10%;
  border: 3px double #2C2416;
}

/* 紙張紋理 */
.poster.style-typewriter::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" /><feColorMatrix values="0 0 0 0 0, 0 0 0 0 0, 0 0 0 0 0, 0 0 0 0.04 0" /></filter><rect width="200" height="200" filter="url(%23n)" /></svg>');
  opacity: 0.5;
  pointer-events: none;
}

.poster.style-typewriter .tw-header {
  position: relative;
  z-index: 1;
  border-bottom: 1px solid #D4C4B0;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.poster.style-typewriter .tw-title {
  font-family: 'Special Elite', cursive;
  font-size: 1.5rem;
  color: #2C2416;
  line-height: 1.2;
}

.poster.style-typewriter .tw-body {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.poster.style-typewriter .tw-image {
  width: 60%;
  max-width: 200px;
  border: 4px solid #2C2416;
  box-shadow: 4px 4px 0 rgba(44, 36, 22, 0.2);
  align-self: center;
  overflow: hidden;
}

.poster.style-typewriter .tw-image img {
  width: 100%;
  height: auto;
  filter: sepia(0.3) contrast(110%);
}

.poster.style-typewriter .tw-desc {
  font-family: 'Courier Prime', monospace;
  font-size: 0.625rem;
  color: #6B5D4F;
  line-height: 1.8;
}

.poster.style-typewriter .tw-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid #D4C4B0;
  padding-top: 1rem;
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.poster.style-typewriter .tw-domain {
  font-family: 'Courier Prime', monospace;
  font-size: 0.5rem;
  color: #8B4513;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.poster.style-typewriter .tw-year {
  font-family: 'Special Elite', cursive;
  font-size: 0.75rem;
  color: #2C2416;
}

/* ========================================
   風格 G：玻璃擬態 (Glass)
   特徵：毛玻璃、漸層背景、大圓角
   ======================================== */

.poster.style-glass {
  background: var(--poster-gradient, linear-gradient(135deg, #E879F9 0%, #F97316 50%, #FB7185 100%));
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10%;
  overflow: hidden;
}

/* 裝飾圓形 */
.poster.style-glass .glass-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.6;
}

.poster.style-glass .orb-1 {
  width: 60%;
  height: 60%;
  top: -20%;
  right: -20%;
  background: rgba(255, 255, 255, 0.3);
}

.poster.style-glass .orb-2 {
  width: 40%;
  height: 40%;
  bottom: -10%;
  left: -10%;
  background: rgba(0, 0, 0, 0.1);
}

.poster.style-glass .glass-card {
  position: relative;
  z-index: 10;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 2rem;
  width: 85%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.poster.style-glass .glass-image {
  width: 50%;
  max-width: 120px;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.poster.style-glass .glass-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster.style-glass .glass-title {
  font-family: 'Manrope', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: #FFFFFF;
  text-align: center;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.poster.style-glass .glass-desc {
  font-family: 'Manrope', sans-serif;
  font-size: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  line-height: 1.5;
}

.poster.style-glass .glass-domain {
  position: absolute;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Manrope', sans-serif;
  font-size: 0.5rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.1em;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 1rem;
  border-radius: 2rem;
  backdrop-filter: blur(10px);
}

/* ========================================
   風格 H：野獸派 (Brutalist)
   特徵：粗框、高對比、硬陰影、無圓角
   ======================================== */

.poster.style-brutalist {
  background: var(--poster-bg, #FFE135);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 6%;
  overflow: hidden;
}

/* 網格背景 */
.poster.style-brutalist::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.poster.style-brutalist .brutal-header {
  position: relative;
  z-index: 1;
  background: #000000;
  color: var(--poster-bg, #FFE135);
  padding: 0.75rem 1rem;
  margin: -6%;
  margin-bottom: 1rem;
}

.poster.style-brutalist .brutal-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 2rem;
  text-transform: uppercase;
  line-height: 0.9;
  letter-spacing: -0.02em;
}

.poster.style-brutalist .brutal-body {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.poster.style-brutalist .brutal-image {
  width: 70%;
  border: 4px solid #000000;
  box-shadow: 8px 8px 0 #000000;
  align-self: center;
  overflow: hidden;
}

.poster.style-brutalist .brutal-image img {
  width: 100%;
  height: auto;
  filter: contrast(120%) saturate(110%);
}

.poster.style-brutalist .brutal-desc {
  font-family: 'Archivo Black', sans-serif;
  font-size: 0.625rem;
  color: #000000;
  line-height: 1.6;
  text-transform: uppercase;
  background: #FFFFFF;
  padding: 0.5rem;
  border: 2px solid #000000;
}

.poster.style-brutalist .brutal-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 4px solid #000000;
}

.poster.style-brutalist .brutal-domain {
  font-family: 'Archivo Black', sans-serif;
  font-size: 0.5rem;
  color: #000000;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.poster.style-brutalist .brutal-badge {
  background: var(--poster-accent, #FF0000);
  color: #FFFFFF;
  font-family: 'Archivo Black', sans-serif;
  font-size: 0.5rem;
  padding: 0.25rem 0.5rem;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 #000000;
}
